MCP 报告工具是一款实用工具,可生成关于模型上下文协议(MCP)服务器功能的全面报告。借助该工具,开发者能了解 MCP 服务器生态系统的可用功能。此外,还能程序化地使用它为文档生成报告,或集成到其他工具中。
MCP 报告工具可帮助你生成 MCP 服务器功能的全面报告。以下是使用前的准备步骤:
# 克隆仓库
git clone https://github.com/cyanheads/mcp-reporter.git
cd mcp-reporter
# 安装依赖项
npm install
# 构建项目
npm run build
# 创建符号链接(可选)
npm link
# 从示例创建配置文件
cp mcp-servers.json.example mcp-servers.json
# 克隆仓库
git clone https://github.com/cyanheads/mcp-reporter.git
cd mcp-reporter
# 安装依赖项
npm install
# 构建项目
npm run build
# 创建符号链接(可选)
npm link
MCP 报告工具需要一个配置文件,该文件定义了要分析的 MCP 服务器:
# 从示例创建配置文件
cp mcp-servers.json.example mcp-servers.json
以下是 MCP 报告工具支持的主要命令行选项:
| 选项 | 描述 |
|---|---|
--help |
显示帮助信息 |
--version |
显示版本号 |
--config <配置文件> |
指定要使用的配置文件路径 |
// cli.ts
import { program } from 'commander';
program
.version('1.0.1')
.description('MCP Reporter CLI工具')
.option('--config <类型>', '指定配置文件路径', parseConfig)
.action((options: IOptions) => {
// 处理逻辑
});
program.parse(process.argv);
// index.ts
export interface IReporterConfig {
servers: string[];
output?: string;
}
export class Reporter {
private config: IReporterConfig;
constructor(config: IReporterConfig) {
this.config = config;
}
public generateReport(): void {
// 生成报告的逻辑
}
}
// 示例报告结构
interface ReportStructure {
servers: ServerInfo[];
summary?: Summary;
}
interface ServerInfo {
name: string;
version: string;
features: Feature[];
}
enum Feature {
ContextService = 'context_service',
ModelManager = 'model_manager'
}
mcp-reporter/
├── src/ # 源代码
│ ├── cli.ts # 命令行接口
│ ├── index.ts # 主程序代码
│ ├── types/ # TypeScript 类型定义
│ └── utils/ # 工具函数
├── scripts/ # 构建和维护脚本
├── docs/ # 文档
├── output/ # 默认报告输出目录
└── mcp-servers.json # 服务器配置文件(从示例创建)
# 清理构建 artifacts
npm run clean
# 重建项目
npm run rebuild
# 生成项目结构可视化
npm run tree
本项目在 Apache 2.0 许可证下发布 - 有关详细信息,请参阅 LICENSE 文件。
Casey Hand (@cyanheads)