Back to MCP directory
publicPublicdnsLocal runtime

mcp-reporter

MCP Reporter是一个用于生成Model Context Protocol(MCP)服务器能力报告的实用工具,帮助开发者了解其MCP服务器生态系统中可用的功能。

article

README

🚀 MCP 报告工具

MCP 报告工具是一款实用工具,可生成关于模型上下文协议(MCP)服务器功能的全面报告。借助该工具,开发者能了解 MCP 服务器生态系统的可用功能。此外,还能程序化地使用它为文档生成报告,或集成到其他工具中。

🚀 快速开始

MCP 报告工具可帮助你生成 MCP 服务器功能的全面报告。以下是使用前的准备步骤:

  1. 确保安装 Node.js 16.x 或更高版本,以及 npm 或 yarn。
  2. 克隆仓库并安装依赖项。
  3. 创建配置文件,定义要分析的 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

✨ 主要特性

  • 服务器发现:自动连接到所有启用的 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 报告工具需要一个配置文件,该文件定义了要分析的 MCP 服务器:

# 从示例创建配置文件
cp mcp-servers.json.example mcp-servers.json

使用方法

命令行选项

以下是 MCP 报告工具支持的主要命令行选项: | 选项 | 描述 | |------|------| | --help | 显示帮助信息 | | --version | 显示版本号 | | --config <配置文件> | 指定要使用的配置文件路径 |

示例代码

命令行界面(CLI)
// 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)

help

Runtime guide

cloud

Hosted runtime

Hosted servers run from a provider-managed environment. You usually connect the MCP client to the hosted endpoint or follow the provider's authorization flow, without keeping a local process alive

  1. Open provider connection page
  2. Authorize or copy endpoint
  3. Connect from your MCP client
terminal

Local runtime / other methods

Local servers run on your own machine or infrastructure. You normally copy the server_config into your MCP client, install the required package, and provide env variables from env_schema when needed

  1. Copy server_config
  2. Install required package
  3. Fill env variables and restart client