Token导航 LogoToken导航

MCP Server · 开发工具

GitHub Fetcher MCP

一个用于从GitHub仓库获取文件内容和目录结构的MCP服务器工具,支持通过CLI或请求参数灵活配置,适用于代码分析和开发辅助。

stdio官方级别未说明来源级核验工具 3@smithery/cli@latest
GitHub工具代码分析TypeScriptClaude开发工具Claude DesktopCursorWindsurfClineVS Code

快速开始

作者 / 组织
Vooster-AI
提供方
Vooster-AI
运行时
Node.js

工具数量

3

来源目录标注

资源数量

0

来源目录标注

提示词数量

0

来源目录标注

GitHub Star

12

仓库热度

收录来源

1 个

MCP World

选型结论

GitHub Fetcher MCP 属于开发工具类 MCP Server,公开资料标注 3 个工具,通过stdio 本地进程接入,适配 Claude Desktop、Claude、Cursor,有可以直接复制的安装命令;接入前先确认权限范围。

分类

开发工具

传输方式

stdio

认证方式

无需认证

部署方式

公开资料未说明

安装与配置

安装命令

npx -y @smithery/cli@latest install github-fetcher-mcp --client <CLIENT_NAME>

公开命令不是通用的启动方式,拼不出可靠配置示例;请在客户端 MCP 配置里按官方文档填写 command 和 args。

上手步骤

  1. 1

    准备运行环境

    stdio 服务在本地起进程,需要先装好 Node.js,再按安装命令拉取依赖。

  2. 2

    安装服务

    复制下面的安装命令执行;命令里带占位符的位置换成自己的密钥或路径。

  3. 3

    写入客户端配置

    在客户端的 MCP 配置里填启动命令和参数,保存后完全退出客户端再打开,让新配置生效。

  4. 4

    验证是否可用

    连接成功后客户端会列出 3 个工具,随便调一个只读工具确认能返回结果。

接入前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

详细介绍

GitHub Fetcher MCP(注:MCP在此处可能代表某个特定项目、模块或配置的名称,但根据上下文无法确定具体含义,因此直接保留原样)

用于获取GitHub仓库文件和目录树的MCP(模型上下文协议)服务器。

特点/功能

  • 获取文件从GitHub仓库获取原始文件内容
  • 获取子目录树以Unix树形格式获取目录树结构
  • 获取子树(或拉取子树) ⭐ 新增:增强的目录树功能,支持显示文件大小、深度限制、统计信息和过滤功能
  • 通过CLI参数或每个请求的参数进行灵活配置
  • 使用TypeScript构建以确保类型安全
  • 全面的测试覆盖率(79项测试)

安装

NPM(Node Package Manager,节点包管理器)

npm install -g github-fetcher-mcp

Smithery(这个单词在英语中并不常见,可能是Smith的某种变体或特定语境下的用词,但直接翻译并无对应中文词汇,若理解为与“Smith”相关或类似的概念,可大致译为“史密斯工坊”或“史密斯制造”,具体需根据上下文确定)

通过(某种方式)为任何客户端自动安装GitHub Fetcher MCP服务器 Smithery(此处根据常见用法,可译为“铁匠铺”或泛指“锻造工坊”,具体翻译需结合上下文):

npx -y @smithery/cli@latest install github-fetcher-mcp --client 

可用客户端: cursor, claude, vscode, windsurf, cline, zed等。

光标示例:

npx -y @smithery/cli@latest install github-fetcher-mcp --client cursor

这将自动在您选择的客户端中配置MCP服务器。

MCP客户端集成

GitHub Fetcher MCP 可以与各种支持模型上下文协议(MCP)的AI编码助手和集成开发环境(IDE)进行集成。

要求

  • Node.js 版本 >= 18.0.0
  • 一个与MCP兼容的客户端(Cursor、Claude Code、VS Code、Windsurf等)

Install in Cursor

首选 Settings -> Cursor Settings -> MCP -> Add new global MCP server

在您的(配置/设置中)添加以下配置 ~/.cursor/mcp.json 文件:

{
  "mcpServers": {
    "github-fetcher": {
      "command": "npx",
      "args": ["-y", "github-fetcher-mcp", "--repoIdentifier", "facebook/react/main"]
    }
  }
}

没有repoIdentifier (根据请求指定仓库):

{
  "mcpServers": {
    "github-fetcher": {
      "command": "npx",
      "args": ["-y", "github-fetcher-mcp"]
    }
  }
}

Install in Claude Code

运行此命令:

claude mcp add github-fetcher -- npx -y github-fetcher-mcp --repoIdentifier facebook/react/main

或者没有repoIdentifier:

claude mcp add github-fetcher -- npx -y github-fetcher-mcp

Install in VS Code

将此添加到您的 VS Code MCP 配置文件中。参见 VS Code MCP 文档 如需更多信息。

"mcp": {
  "servers": {
    "github-fetcher": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "github-fetcher-mcp", "--repoIdentifier", "facebook/react/main"]
    }
  }
}

Install in Windsurf

将此添加到您的帆板MCP配置文件中:

{
  "mcpServers": {
    "github-fetcher": {
      "command": "npx",
      "args": ["-y", "github-fetcher-mcp", "--repoIdentifier", "facebook/react/main"]
    }
  }
}

Install in Cline

  1. 开放 克莱恩(Cline)
  2. 点击汉堡菜单图标(☰)以进入 MCP服务器 部分;章节
  3. 选择 远程服务器 制表符(Tab)
  4. 点击 编辑配置 按钮
  5. 将 github-fetcher 添加到 mcpServers:
{
  "mcpServers": {
    "github-fetcher": {
      "command": "npx",
      "args": ["-y", "github-fetcher-mcp", "--repoIdentifier", "facebook/react/main"]
    }
  }
}

Install in Claude Desktop

打开Claude桌面版开发者设置并编辑您的 claude_desktop_config.json 文件:

{
  "mcpServers": {
    "github-fetcher": {
      "command": "npx",
      "args": ["-y", "github-fetcher-mcp", "--repoIdentifier", "facebook/react/main"]
    }
  }
}

Install in Zed

将这个添加到你的Zed中 settings.json:

{
  "context_servers": {
    "github-fetcher": {
      "source": "custom",
      "command": "npx",
      "args": ["-y", "github-fetcher-mcp", "--repoIdentifier", "facebook/react/main"]
    }
  }
}

Install in Roo Code

将此添加到您的Roo Code MCP配置文件中:

{
  "mcpServers": {
    "github-fetcher": {
      "command": "npx",
      "args": ["-y", "github-fetcher-mcp", "--repoIdentifier", "facebook/react/main"]
    }
  }
}

Using with Bun

{
  "mcpServers": {
    "github-fetcher": {
      "command": "bunx",
      "args": ["-y", "github-fetcher-mcp", "--repoIdentifier", "facebook/react/main"]
    }
  }
}

Using with Docker

构建Docker镜像:

创建一个 Dockerfile:

FROM node:18-alpine

WORKDIR /app

# Install the package globally
RUN npm install -g github-fetcher-mcp

# Expose the server port
EXPOSE 3000

# Default command to run the server
CMD ["github-fetcher-mcp"]

构建镜像:

docker build -t github-fetcher-mcp .

配置您的MCP客户端:

{
  "mcpServers": {
    "github-fetcher": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "-p", "3000:3000", "github-fetcher-mcp", "--repoIdentifier", "facebook/react/main"]
    }
  }
}

使用方法

带有存储库标识符(CLI 参数)

当你提供一个 --repoIdentifier 参数,所有工具将默认使用该存储库:

github-fetcher-mcp --repoIdentifier facebook/react/main

可用工具:

  • fetch-file仅需 filePath
  • fetch-subdir-tree只需 dirPath
  • fetch-sub-tree仅需 dirPath (+ 可选: showSize, maxDepth, showStats, fileExtFilter)

没有仓库标识符

当未提供存储库标识符时,您可以为每个请求指定存储库:

github-fetcher-mcp

可用工具:

  • fetch-file需要 ownerName, repoName, branchName (可选,默认值:'main'),以及 filePath
  • fetch-subdir-tree需要 ownerName, repoName, branchName (可选,默认值:'main'),以及 dirPath
  • fetch-sub-tree需要 ownerName, repoName, branchName (可选,默认:'main'), dirPath (+ 可选: showSize, maxDepth, showStats, fileExtFilter)

可用工具

GitHub Fetcher MCP 提供了以下可由大型语言模型(LLMs)使用的工具:

  • 获取文件从GitHub仓库中获取文件的原始内容

- 所需参数会根据是否(满足某种条件/存在某种情况)而有所不同 --repoIdentifier 被提供 - 返回完整的文件内容作为文本

  • 获取子目录树以Unix树状格式获取目录树结构

- 所需的参数根据是否(满足某种条件或采用某种方式)而有所不同 --repoIdentifier 被提供 - 返回格式化的目录树,显示文件和子目录

  • 获取子树 ⭐ 新增:增强版,包含高级选项

- 所需参数根据(情况)是否……而有所不同 --repoIdentifier 被提供 - 可选参数: - showSize (布尔值):显示文件和目录的大小 - maxDepth (数字):限制树的深度(例如,1 表示仅限直接子节点) - showStats (布尔值): 显示统计摘要(默认值:true) - fileExtFilter (string\[\]): 通过扩展名过滤文件(例如,\[“.ts”, “.js”\]) - 返回增强的目录树,可选显示文件大小和统计信息

使用示例

示例1:获取特定文件

在 Cursor/Claude 代码中:

Fetch the package.json file from the facebook/react repository on the main branch

在任何配置了repoIdentifier的MCP客户端中:

Show me the contents of src/index.ts

示例2:浏览目录结构

在 Cursor/Claude 代码中:

Show me the directory structure of the src folder in microsoft/vscode on the main branch

在任何配置了repoIdentifier的MCP客户端中:

What files are in the components directory?

示例3:分析代码结构

在 Cursor/Claude 代码中:

I want to understand the structure of the Next.js repository.
Show me the directory tree of the packages folder from vercel/next.js on the canary branch.
Then fetch the package.json file to see the dependencies.

工具参考

获取文件

从GitHub仓库中获取文件的原始内容。

使用repoIdentifier:

{
  "filePath": "src/index.ts"
}

没有repoIdentifier:

{
  "ownerName": "facebook",
  "repoName": "react",
  "branchName": "main",
  "filePath": "src/index.ts"
}

获取子目录树

以Unix树状格式获取目录树结构。

使用repoIdentifier:

{
  "dirPath": "src"
}

未提供repoIdentifier:

{
  "ownerName": "microsoft",
  "repoName": "vscode",
  "branchName": "main",
  "dirPath": "src"
}

获取子树 ⭐ 新功能

增强的目录树,包含文件大小、深度限制和过滤选项。

使用repoIdentifier - 基本用法:

{
  "dirPath": "src"
}

使用 repoIdentifier - 显示文件大小:

{
  "dirPath": "src",
  "showSize": true
}

使用repoIdentifier - 限制深度:

{
  "dirPath": "src",
  "maxDepth": 2
}

使用repoIdentifier - 按文件扩展名过滤:

{
  "dirPath": "src",
  "fileExtFilter": [".ts", ".tsx"]
}

使用repoIdentifier - 所有选项:

{
  "dirPath": "src",
  "showSize": true,
  "maxDepth": 3,
  "showStats": true,
  "fileExtFilter": [".ts", ".js"]
}

示例输出(包含 showSize 和 showStats):

src/
├── components/ (2 files, 15.3KB)
│   ├── Button.tsx (8.2KB)
│   └── Input.tsx (7.1KB)
└── utils/ (3 files, 5.8KB)
    ├── helpers.ts (2.1KB)
    ├── format.ts (1.9KB)
    └── validate.ts (1.8KB)

📊 Summary: 2 directories, 5 files, 21.1KB total

没有repoIdentifier:

{
  "ownerName": "microsoft",
  "repoName": "vscode",
  "branchName": "main",
  "dirPath": "src",
  "showSize": true,
  "maxDepth": 2
}

Docker 使用方法

构建Docker镜像

docker build -t github-fetcher-mcp .

使用 Docker 运行

带有repoIdentifier:

docker run -d -p 3000:3000 \
  --name github-fetcher \
  github-fetcher-mcp \
  node dist/server.js --repoIdentifier facebook/react/main

没有repoIdentifier:

docker run -d -p 3000:3000 \
  --name github-fetcher \
  github-fetcher-mcp

Docker Compose 示例

创建一个 docker-compose.yml:

version: '3.8'

services:
  github-fetcher-mcp:
    build: .
    ports:
      - "3000:3000"
    environment:
      - PORT=3000
      - NODE_ENV=production
    command: ["node", "dist/server.js", "--repoIdentifier", "facebook/react/main"]
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "node", "-e", "require('http').get('http://localhost:3000/mcp', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"]
      interval: 30s
      timeout: 3s
      retries: 3
      start_period: 5s

使用 Docker Compose 运行:

docker-compose up -d

在MCP客户端中使用Docker镜像

配置您的MCP客户端以使用Docker容器:

{
  "mcpServers": {
    "github-fetcher": {
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "github-fetcher-mcp",
        "node",
        "dist/server.js",
        "--repoIdentifier",
        "facebook/react/main"
      ]
    }
  }
}

发展

# Install dependencies
npm install

# Run in development mode
npm run dev

# Run tests
npm test

# Build
npm run build

# Type check
npm run typecheck

# Lint
npm run lint

建筑学

该项目采用模块化架构:

  • 配置/CLI 参数解析
  • 服务/GitHub API 集成和树形格式化
  • 工具/MCP工具的实现
  • 类型/TypeScript 类型定义
  • 实用工具/实用函数

测试

该项目具有全面的测试覆盖率:

  • 对所有服务、工具和实用程序进行单元测试
  • 工具创建的集成测试
  • 总共79项测试,全部通过
# Run all tests
npm test

# Run tests in watch mode
npm run test:watch

# Generate coverage report
npm run test:coverage

许可证

麻省理工学院(MIT)

贡献

欢迎贡献!请随时提交拉取请求。

作者

“choesumin”可以翻译为“乔素敏”(根据音译,实际翻译可能因人名具体发音和语境而有所调整)。不过,需要注意的是,如果“choesumin”是某个特定领域或文化背景下的专有名词或特定术语,其翻译可能需要根据具体情况进行调整。在没有更多上下文的情况下,上述翻译是基于音译的通用做法

工具与能力

工具数量

3

资源数量

0

提示词数量

0

能力标签

GitHub工具TypeScript本地部署代码分析目录结构MCP协议开发辅助

支持客户端

Claude DesktopClaudeCursorWindsurfClineVS Code

数量来自来源目录的标注,具体工具清单以官方文档为准。

典型使用场景

让助手直接读代码

把仓库、提交记录和 issue 交给模型检索,补全和重构时不用来回复制文件。

在对话里跑命令

触发构建、测试和脚本,执行结果直接回到上下文,省去切终端。

接进开发流程

把 PR、CI 状态和代码审查接进助手,减少在几个工具之间跳。

选择建议

值得选的地方

  • 只提供 3 个工具,职责集中,接入后不容易误操作。
  • 有现成的安装命令,不用自己找入口,照着跑就能起服务。
  • 已经适配 Claude Desktop、Claude、Cursor,换客户端不用重新研究配置。

先想清楚的地方

  • stdio 方式要求本地装好 Node.js,换机器要重新装一遍。
  • 第三方目录整理,版本更新和行为细节以官方仓库为准。

更适合

  • 需要在开发工具场景里让模型直接调用外部能力的人。
  • 已经在用 Claude Desktop 的用户,接入路径最短。
  • 想先快速试一下、能接受在本地跑服务的人。

不太适合

  • 完全不想在本地装环境的人。
  • 需要厂商级 SLA 和技术支持的生产环境。

同类对比

5 个同类
MCP Server工具数传输方式安装命令收录来源最后核验
GitHub Fetcher MCP

MCP World · 本页

3stdio有1 个2026-05-17
Git 838e2ec1

MCP World

12stdio有2 个2026-05-17
Markitdown MCP 2c653a5f

MCP World

1stdio有1 个2026-05-17
Context7 831acf40

MCP World

0stdio有1 个2026-05-17
Context7 MCP C671e75a

MCP World

0stdio有1 个2026-05-17

按同分类和工具数量挑出最接近的几条,字段以各自详情页为准。

常见问题

5 条

GitHub Fetcher MCP 怎么安装?

公开资料给出的安装命令是 npx -y @smithery/cli@latest install github-fetcher-mcp --client <CLIENT_NAME>,运行环境为 Node.js。装完后按客户端要求写进 MCP 配置,重启客户端生效。

GitHub Fetcher MCP 怎么在 Claude Desktop、Cursor 里配置?

它是stdio 本地进程,客户端配置里要写启动命令和参数,运行环境是 Node.js;保存后完全退出客户端再打开,配置才会生效。

GitHub Fetcher MCP 收费吗?

本站只整理公开资料,不代收费用,也没有标注具体价格。是否收费取决于服务本身和背后的接口额度,正式使用前按官方说明确认。

GitHub Fetcher MCP 需要 API Key 吗?

公开资料标注为无需认证,装好就能连;如果实际调用时报鉴权错误,按官方文档补上凭据。

GitHub Fetcher MCP 支持哪些客户端?

公开资料标注支持 Claude Desktop、Claude、Cursor、Windsurf、Cline、VS Code;其他客户端只要能配置 MCP Server,也能用同样的命令或地址接入。

来源信息

继续浏览同类 MCP