Back to MCP directory
publicPublicdnsLocal runtime

repo-analyzer-mcp

一个基于MCP协议的代码仓库分析服务器,专注于Nostr相关项目的代码结构、依赖关系和变更历史分析,提供多种代码分析工具和搜索功能。

article

README

🚀 仓库分析器 MCP 服务器

仓库分析器 MCP 服务器是一款专门用于分析代码仓库的工具,尤其聚焦于 Nostr 相关项目。它具备丰富功能,可读取文件内容、列出目录结构,还能对 Nostr 开发工具包(NDK)和 Nostr 协议进行深度剖析。

🚀 快速开始

仓库分析器 MCP 服务器能助力你对代码仓库进行全面分析。以下为你介绍其安装和启动方式。

📦 安装指南

要安装仓库分析器 MCP 服务器,请按以下步骤操作:

  1. 克隆仓库:git clone <repository-url>
  2. 进入仓库目录:cd repository-analyzer-mcp
  3. 安装依赖项:npm install

💻 使用示例

启动

  • 开发模式:npm run dev
  • 生产模式:npm start

📚 详细文档

配置

环境变量

设置以下环境变量可自定义服务器行为:

  • NODE_ENV:设置为 developmentproduction 以切换运行模式。
  • PORT:定义服务器监听的端口,默认为 3000

示例配置

{
  "name": "repository-analyzer-mcp",
  "version": "1.0.0",
  "description": "A tool for analyzing code repositories, with a focus on Nostr-related projects.",
  "main": "index.js",
  "scripts": {
    "dev": "webpack --mode development",
    "start": "node dist/index.js"
  },
  "dependencies": {
    "express": "^4.18.2",
    "cors": "^2.8.5"
  }
}

功能

分析工具

NDK 分析器

可对 Nostr 开发工具包仓库进行分析,支持以下选项:

  • ndk:分析 NDK 实现。
  • migrations:分析迁移历史。
  • all:综合分析。
Nostr 协议分析器

可对 Nostr 协议仓库进行分析,支持以下选项:

  • events:分析事件类型和结构。
  • implementations:分析不同语言的实现细节。
  • social-context:分析社交上下文相关实现。

文件访问

  • file://{filePath}:阅读仓库中的文件内容。
  • dir://{dirPath}:列出目录的内容。

结构要求

NDK 仓库结构

需满足以下特征之一:

  • 根目录包含名为 package.json 的文件,且其名称为 @nostr-dev-kit/ndk
  • 包含一个 ndk 目录,其中有一个名为 package.json 的文件,名称为 @nostr-dev-kit/ndk

Nostr 协议仓库结构

需满足以下特征之一:

  • 仓库包含一个 nips 目录,其中有 Markdown 格式的 NIP 文件。
  • 仓库的 README 文件提及“NIP”和“Nostr 实现可能性”。
  • 仓库的 package.json 文件在名称、描述或关键字中提及“nostr”。

资源

服务器提供以下资源访问方式:

  • file://{filePath}:阅读文件内容。
  • dir://{dirPath}:列出目录内容。

开发

若要以开发模式运行,请执行:npm run dev

📄 许可证

本项目采用 MIT 许可证。

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