ZeroPath MCP服务器
通过MCP兼容工具与ZeroPath安全发现进行交互。
此MCP服务器直接调用ZeroPath tRPC V2过程(无REST包装器),并返回适合代理使用的结构化JSON响应。
博客文章
了解更多关于我们为什么构建这个以及它如何适应不断发展的人工智能开发生态系统的信息:
与您的AppSec扫描聊天:介绍ZeroPath MCP服务器
安装
快速安装(推荐)
直接从GitHub安装:```bash
Using pip
pip install git+https://github.com/ZeroPathAI/zeropath-mcp-server.git
Using uvx (run without installing)
uvx --from git+https://github.com/ZeroPathAI/zeropath-mcp-server zeropath-mcp-server
您还可以固定到特定版本:```bash
# Specific version tag
pip install git+https://github.com/ZeroPathAI/zeropath-mcp-server.git@v0.1.0
# Latest from main branch
uvx --from "git+https://github.com/ZeroPathAI/zeropath-mcp-server@main" zeropath-mcp-server
来源```bash
git clone https://github.com/ZeroPathAI/zeropath-mcp-server.git
cd zeropath-mcp-server
uv sync
### 来自PyPI(可选)
如果软件包已发布到PyPI,您还可以通过以下方式安装:```bash
pip install zeropath-mcp-server
设置
1.生成API密钥
从ZeroPath设置生成用户操作的或管理员API密钥。
2.配置环境变量```bash
export ZEROPATH_BASE_URL="https://zeropath.com" # optional (defaults to https://zeropath.com)
export ZEROPATH_TOKEN_ID=your_token_id
export ZEROPATH_TOKEN_SECRET=your_token_secret
export ZEROPATH_ORG_ID=your_org_id
使用 `ZEROPATH_BASE_URL` 例如:```bash
export ZEROPATH_BASE_URL="https://staging.branch.zeropath.com"
配置
将以下内容添加到MCP配置文件中(Claude Desktop、Cursor等):
使用GitHub URL(推荐)```json
{
"mcpServers": {
"zeropath": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/ZeroPathAI/zeropath-mcp-server",
"zeropath-mcp-server"
],
"env": {
"ZEROPATH_BASE_URL": "https://zeropath.com",
"ZEROPATH_TOKEN_ID": "your_token_id",
"ZEROPATH_TOKEN_SECRET": "your_token_secret",
"ZEROPATH_ORG_ID": "your_org_id"
}
}
}
}
### 使用源代码安装```json
{
"mcpServers": {
"zeropath": {
"command": "uv",
"args": [
"run",
"--project",
"/path/to/zeropath-mcp-server",
"python",
"-m",
"zeropath_mcp_server"
],
"env": {
"ZEROPATH_BASE_URL": "https://zeropath.com",
"ZEROPATH_TOKEN_ID": "your_token_id",
"ZEROPATH_TOKEN_SECRET": "your_token_secret",
"ZEROPATH_ORG_ID": "your_org_id"
}
}
}
}
使用PyPI安装(可选)```json
{
"mcpServers": {
"zeropath": {
"command": "zeropath-mcp-server",
"env": {
"ZEROPATH_BASE_URL": "https://zeropath.com",
"ZEROPATH_TOKEN_ID": "your_token_id",
"ZEROPATH_TOKEN_SECRET": "your_token_secret",
"ZEROPATH_ORG_ID": "your_org_id"
}
}
}
}
______________________________________________________________________
## 刀具表面(tRPC V2)
工具在启动时从ZeroPath前端的MCP清单动态加载。
所有工具调用都使用tRPC V2过程,直接使用tRPC v10 HTTP约定:
- 查询: `GET /trpc/?input=`
- 突变: `POST /trpc/` 将原始JSON输入对象作为主体(未包装)。
成功的响应以结构化JSON的形式返回,其中包含 `{ "result": { "data": ... } }` 包装已拆下。错误返回tRPC `error` 对象直接。
服务器还使用每个工具执行尽力而为的客户端输入验证 `inputSchema` 从清单中提取并返回 `BAD_REQUEST` 输入无效时调用tRPC前出错。如果模式使用不受支持的JSON模式功能,则该调用将跳过客户端验证(服务器端验证仍然具有权威性)。
______________________________________________________________________
## 示例通话
列出问题:```json
{
"tool": "issues.list",
"input": {
"page": 1,
"pageSize": 25,
"statuses": ["PENDING_REVIEW"],
"sortBy": "score",
"sortOrder": "desc"
}
}
存档问题:```json
{
"tool": "issues.archive",
"input": {
"issueIds": ["issue_123", "issue_456"],
"reason": "Confirmed duplicate"
}
}
创建规则:```json
{
"tool": "rules.create",
"input": {
"name": "Detect unsafe eval",
"rule": "Detect any use of eval() on user input",
"globPattern": "**/*.js",
"sourceTypes": ["FILE_HANDLER"],
"repositoryIds": ["repo_123"]
}
}
获取统计摘要:```json
{
"tool": "stats.summary",
"input": {
"organizationId": "org_123"
}
}
______________________________________________________________________
## 发展
### 运行测试```bash
uv run pytest tests/ -v
构建包```bash
uv build
### 发布到PyPI(可选)```bash
uv publish
贡献
我们欢迎来自安全、人工智能和开发工具社区的贡献。
- 发现bug了吗? 打开一个问题
- 想要改进工具或添加新工具?提交拉取请求
许可证
MIT许可证-请参阅 许可证 了解详情。
