返回市场
报告器

报告器

作者:cyanheads10 星标更新:2025-11-18

项目介绍

MCP Reporter

TypeScript Model Context Protocol 版本 许可证 状态 GitHub

MCP Reporter 是一个用于生成关于模型上下文协议(MCP)服务器功能的综合报告的工具,帮助开发者了解其MCP服务器生态系统中可用的功能。也可以通过编程方式生成报告以供文档编写或输入到其他工具中。

目录

特性

  • 服务器发现:自动连接到所有启用的MCP服务器
  • 能力分析:提取工具、资源和资源模板
  • Markdown报告生成:生成组织良好的文档
  • 进度监控:在执行过程中提供实时反馈

生成报告的图像预览(部分)

图像预览

安装

先决条件

  • Node.js 16.x 或更高版本
  • npm 或 yarn

从源代码安装

# 克隆仓库
git clone https://github.com/cyanheads/mcp-reporter.git
cd mcp-reporter

# 安装依赖
npm install

# 构建项目
npm run build

# 创建符号链接(可选)
npm link

配置

MCP Reporter 需要一个定义您想要分析的MCP服务器的配置文件:

# 从示例创建配置文件
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 [选项]
选项描述默认值
-c, --config <路径>MCP服务器配置文件路径mcp-servers.json
-o, --output <路径>报告输出路径output/mcp_server_report.md
-s, --schemas包含输入模式true
-m, --metadata包含服务器元数据true
-e, --examples包含示例true

示例

您可以运行mcp-reporter,要么通过 'npm run start',要么通过安装期间创建的符号链接(可选):

# 使用默认设置生成报告
npm run start

# 使用符号链接生成报告
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);

报告结构

生成的Markdown报告包括:

  1. 所有被分析的MCP服务器的概要
  2. 对于每个服务器:
    • 服务器元数据
    • 可用工具及其描述和输入模式
    • 可用资源及其URI和描述
    • 可用资源模板及其URI模板

项目结构

mcp-reporter/
├── src/               # 源代码
│   ├── cli.ts         # 命令行接口
│   ├── index.ts       # 主库代码
│   ├── types/         # TypeScript类型定义
│   └── utils/         # 工具函数
├── scripts/           # 构建和维护脚本
├── docs/              # 文档
├── output/            # 报告默认输出目录
└── m.mcp-servers.json   # 服务器配置(从示例创建)

开发

# 清理构建工件
npm run clean

# 重新构建项目
npm run rebuild

# 生成项目结构可视化
npm run tree

许可证

本项目根据Apache 2.0许可证授权 - 查看LICENSE文件获取详细信息。

作者

Casey Hand (@cyanheads)