MCP报告器
  ](<>)   ](https://github.com/cyanheads/mcp-reporter)
MCP Reporter是一个实用程序,用于生成有关模型上下文协议(MCP)服务器功能的综合报告,帮助开发人员了解其MCP服务器生态系统中可用的功能。还可以通过编程方式生成报告,用于文档编制或输入其他工具。
目录
特性
- 服务器发现:自动连接到所有启用的MCP服务器
- 能力分析:提取工具、资源和资源模板
- Markdown报告生成:制作组织良好的文件
- 进度监控:在执行过程中提供实时反馈
生成报告的图像预览(部分)
安装
先决条件
- Node.js 16.x或更高版本
- npm或纱线
从源代码安装
# Clone the repository
git clone https://github.com/cyanheads/mcp-reporter.git
cd mcp-reporter
# Install dependencies
npm install
# Build the project
npm run build
# Create a symlink (optional)
npm link配置
MCP Reporter需要一个配置文件来定义要分析的MCP服务器:
# Create a configuration file from the example
cp mcp-servers.json.example mcp-servers.json配置示例:
{
"mcpServers": {
"atlas-mcp-server": {
"command": "/path/to/node",
"args": ["/path/to/atlas-mcp-server/dist/index.js"],
"env": {
"NEO4J_URI": "bolt://localhost:7687",
"NEO4J_USER": "neo4j",
"NEO4J_PASSWORD": "your-password-here"
}
},
"another-server": {
"command": "/path/to/node",
"args": ["/path/to/another-server.js"],
"env": {}
}
}
}用法
命令行接口
mcp-reporter [options]| 选项 | 描述 | 默认值 |
|---|---|---|
| `-c, --config | ||
| ` | MCP服务器配置路径 | mcp-servers.json |
| `-o, --output | ||
| ` | 报告的输出路径 | output/mcp_server_report.md |
-s, --schemas | 包括输入模式 | true |
-m, --metadata | 包含服务器元数据 | true |
-e, --examples | 包括示例 | true |
例子
您可以通过“npm run start”或使用安装过程中创建的符号链接(可选)运行mcp reporter:
# Generate a report with default settings
npm run start
# Generate a report using symlink
mcp-reporter程序化使用
import { McpReporter } from "mcp-reporter";
async function generateReport() {
const reporter = new McpReporter("./my-config.json", {
outputPath: "./reports/mcp-report.md",
includeInputSchemas: true,
includeServerMetadata: true,
});
await reporter.run();
}
generateReport().catch(console.error);报告结构
生成的降价报告包括:
- 分析的所有MCP服务器摘要
- 对于每台服务器:
- 服务器元数据 - 具有描述和输入模式的可用工具 - 具有URI和描述的可用资源 - 具有URI模板的可用资源模板
项目结构
mcp-reporter/
├── src/ # Source code
│ ├── cli.ts # Command line interface
│ ├── index.ts # Main library code
│ ├── types/ # TypeScript type definitions
│ └── utils/ # Utility functions
├── scripts/ # Build and maintenance scripts
├── docs/ # Documentation
├── output/ # Default output directory for reports
└── mcp-servers.json # Server configuration (create from example)发展
# Clean build artifacts
npm run clean
# Rebuild the project
npm run rebuild
# Generate project structure visualization
npm run tree许可证
此项目在Apache 2.0许可证下获得许可-有关详细信息,请参阅License文件。
作者
凯西·汉德(@cyanheads)
