基于 FastAPI 和 MCP(Model Context Protocol)协议的 Burp Suite Montoya API 文档查询服务端。
- 📚 完整 API 覆盖 - 收录所有 186 个接口和 820 个方法
- 🗄️ SQLite 存储 - 预解析并建立索引,查询速度快
- 🔌 MCP 协议支持 - 标准 MCP 工具接口,支持所有 MCP 客户端
- 🌐 HTTP SSE 模式 - 兼容支持 HTTP SSE 传输的任何 MCP 客户端
- 🔍 智能搜索 - 支持接口、方法、包名搜索
- 🚀 一键启动 - 提供 Windows、Linux、Mac 启动脚本
- 包 (Packages): 48 个
- 接口 (Interfaces): 186 个
- 方法 (Methods): 820 个
- 数据文件大小: ~540KB
| 工具名 | 功能描述 |
|---|---|
search_api |
搜索 API - 可按名称搜索接口、方法或包 |
get_interface |
获取接口详情 - 包含所有方法、继承关系、文档说明 |
list_interfaces |
列出所有接口 - 可按包名筛选 |
get_method_signature |
获取方法签名 - 包含参数、返回值、异常说明 |
get_package_info |
获取包信息 - 包含包内所有接口列表 |
- Python 3.11+
- uv 包管理器
Windows (CMD):
start.batWindows (PowerShell):
.\start.ps1Linux / Mac:
chmod +x start.sh
./start.sh脚本会自动完成:
- ✅ 检查 uv 是否安装
- ✅ 创建虚拟环境
- ✅ 安装依赖
- ✅ 检查数据库是否存在(不存在则自动构建)
- ✅ 检查端口是否被占用
- ✅ 启动 MCP 服务端
# 进入项目目录
cd burp-api-mcp
# 安装依赖
uv sync
# 构建数据库(首次使用需要)
uv run python scripts/parse_and_import.py
# 启动服务器
uv run python scripts/run_server.py启动后,服务运行在:http://localhost:8000
| 端点 | 功能 |
|---|---|
GET / |
服务信息 |
GET /health |
健康检查 |
GET /sse |
MCP SSE 端点 |
{
"name": "search_api",
"arguments": {
"query": "HttpRequest",
"type": "interface",
"limit": 5
}
}{
"name": "get_interface",
"arguments": {
"name": "HttpRequest"
}
}{
"name": "list_interfaces",
"arguments": {
"package": "burp.api.montoya.http",
"limit": 20
}
}{
"name": "get_method_signature",
"arguments": {
"interface": "HttpRequest",
"method": "withBody"
}
}Claude Desktop 支持 HTTP SSE 模式的 MCP 服务器配置。
步骤 1:先启动服务
在项目目录运行启动脚本:
# Windows
start.bat
# Linux/Mac
./start.sh服务将运行在 http://localhost:8000
步骤 2:配置 Claude Desktop
编辑 claude_desktop_config.json:
{
"mcpServers": {
"burp-api": {
"url": "http://localhost:8000/sse"
}
}
}配置文件位置:
- Windows:
%APPDATA%/Claude/claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
步骤 3:重启 Claude Desktop
配置完成后,重启 Claude Desktop 即可连接 MCP 服务器。
注意: 本服务是 HTTP SSE 模式,不支持 stdio 传输。请确保服务已启动后再配置 Claude Desktop。
任何支持 MCP 协议的客户端都可以通过 SSE 连接:
- Cursor
- Continue
- 其他支持 MCP 的 IDE 插件
burp-api-mcp/
├── 📄 start.bat # Windows CMD 启动脚本
├── 📄 start.ps1 # PowerShell 启动脚本
├── 📄 start.sh # Linux/Mac 启动脚本
├── 📄 LICENSE # Apache 2.0 许可证
├── 📄 README.md # 中文文档(本文档)
├── 📄 README_EN.md # 英文文档
├── 🗄️ burp_api.db # SQLite 数据库(自动生成)
├── 📂 src/burp_api_mcp/
│ ├── __init__.py
│ ├── main.py # FastAPI + MCP 服务端
│ ├── models.py # SQLAlchemy 数据模型
│ └── parser.py # Java 接口解析器
├── 📂 scripts/
│ ├── parse_and_import.py # 解析 Java 文件到 SQLite
│ └── run_server.py # 服务端入口
└── 📄 pyproject.toml # uv 项目配置
- 解析 Java 接口文件
- 提取 Javadoc 注释
- 分析方法签名、参数、返回值
- 处理继承关系
- Package:包结构
- Interface:接口定义
- Method:方法详情
- Import:导入语句
- FastAPI Web 框架
- MCP 协议实现
- 5 个核心查询工具
- SSE 传输支持
如果修改了解析器或需要刷新数据:
# 删除旧数据库
rm burp_api.db
# 重新构建
uv run python scripts/parse_and_import.py# 测试数据库连接
uv run python -c "from src.burp_api_mcp.models import init_db, get_session; engine = init_db('burp_api.db'); session = get_session(engine); print('数据库连接成功!')"
# 测试解析器
uv run python -c "from src.burp_api_mcp.parser import JavaInterfaceParser; from pathlib import Path; p = JavaInterfaceParser(Path('api')); print('解析器工作正常!')"# 详细日志输出
uv run python scripts/run_server.py --log-level debug如果服务器显示 "database": "Not initialized":
- 确保
burp_api.db存在于项目根目录 - 检查文件权限
- 重新构建:
rm burp_api.db && uv run python scripts/parse_and_import.py
如果提示端口 8000 被占用:
# 查找占用端口的进程
# Windows:
netstat -ano | findstr :8000
# Linux/Mac:
lsof -i :8000
# 修改端口(修改 scripts/run_server.py 中的 port 参数)确保使用虚拟环境:
# 查看当前 Python 路径
which python # Linux/Mac
where python # Windows
# 应该指向 .venv/Scripts/python
# 手动激活虚拟环境
source .venv/bin/activate # Linux/Mac
.venv\Scripts\activate # Windows如果提示 uv 未安装:
# 安装 uv
curl -LsSf https://astral.sh/uv/install.sh | sh # Linux/Mac
powershell -c "irm https://astral.sh/uv/install.ps1 | iex" # Windows本项目采用 Apache License 2.0 开源协议。
Copyright 2024 Burp API MCP Server Contributors
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
这是一个社区工具,非官方项目。欢迎提交 Issue 和 PR!
- 🐛 Bug 报告:请提供复现步骤和环境信息
- ✨ 功能请求:请描述使用场景和期望功能
- 📖 文档改进:请指出具体问题或改进建议
- Fork 本仓库
- 创建特性分支 (
git checkout -b feature/AmazingFeature) - 提交更改 (
git commit -m 'Add some AmazingFeature') - 推送到分支 (
git push origin feature/AmazingFeature) - 创建 Pull Request
- 项目地址: [GitHub Repository]
- Issue 追踪: [GitHub Issues]
- 邮件: [your-email@example.com]
- Burp Suite - 提供 Montoya API 文档
- MCP - Model Context Protocol
- FastAPI - Web 框架
- uv - Python 包管理器
- SQLAlchemy - ORM 框架
本项目是社区开发的非官方工具,与 PortSwigger 公司无任何关联。Burp Suite 是 PortSwigger 公司的注册商标。
使用本工具查询的 API 信息仅供参考,实际开发请参考 Burp Suite 官方文档。
Made with ❤️ by the Security Community