Token导航 LogoToken导航TokenDH.com
ghcontext (Marco Muellner) logo
开发工具stdio官方级别未说明来源级核验

ghcontext (Marco Muellner)

MCP Server

ghcontext

An MCP server providing real-time GitHub data to LLMs, enhancing their software development capabilities.

工具数

5

提示词数

0

GitHub Stars

0

资源数

0
GitHub代码分析TypeScriptClaudeAPI文档Claude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

MarcoMuellner

提供方

MarcoMuellner

最后核验

2026/5/18 02:51

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx ghcontext --GITHUB_TOKEN your_github_token

详细介绍

ghcontext:使用实时GitHub Context为LLMs充电

License TypeScript

MCP

*“但我的GitHub仓库昨天发生了变化……”-再也不用担心人工智能助手中的过时信息了。*

ghcontext(GitHub Context Provider)弥合了GitHub和大型语言模型之间的差距,通过标准化的模型上下文协议(MCP)让AI助手实时访问存储库信息。

🔥 为什么是ghcontext?

  • 准确、实时的信息: LLM通常对存储库有过时的知识。ghcontext提供了最新的API文档、README内容和代码库结构-也用于 私人回购
  • 更深入的理解: 帮助LLM掌握项目的体系结构、设计原则和API使用模式。
  • 无缝集成: 与任何启用MCP的型号兼容,包括Claude、GPT等。
  • 高效: 智能缓存减少了API调用,同时保持信息新鲜。

✨ 主要特点

  • API文件提取: 从自述文件和专用文档文件中自动识别并提取API文档
  • 存储库结构分析: 提供代码库组织的地图
  • README内容检索: 直接从GitHub获取最新文档
  • 文件内容搜索: 查找并提取特定文件或代码片段
  • 存储库搜索: 发现符合特定条件的存储库

🚀 快速开始

关于代币的说明

ghcontext需要GitHub令牌进行身份验证。你有责任安全地管理你的令牌,你应该只给它你的用例真正需要的范围。 例如,如果您只需要读取公共存储库,则可以使用 public_repo 范围。ghcontext不需要对存储库进行写访问。

安装

方法1:使用npx无需安装即可运行

# Run directly without installation (GitHub token is REQUIRED)
npx ghcontext --GITHUB_TOKEN your_github_token

# OR using pnpm
pnpm dlx ghcontext --GITHUB_TOKEN your_github_token

这是将其提供给claude代理的首选方式,因为它不需要任何安装,您可以直接从命令行运行它。

方法2:从npm进行全局安装

# Install globally using npm
npm install -g ghcontext

# OR using pnpm
pnpm add -g ghcontext

# Run ghcontext with your GitHub token (REQUIRED)
ghcontext --GITHUB_TOKEN your_github_token

方法3:手动安装(开发)

# Clone the repository
git clone https://github.com/yourusername/ghcontext.git
cd ghcontext

# Install dependencies
pnpm install

# Start the server with GitHub token (REQUIRED)
pnpm start --GITHUB_TOKEN your_github_token

与LLM一起使用

将兼容MCP的LLM连接到ghcontext服务器端点:

http://localhost:3000/api/mcp

您的法学硕士现在可以使用以下工具:

  • get-repository-info:获取有关存储库的详细信息
  • get-repository-readme:检索当前README内容
  • get-repository-api-docs:摘录API文档
  • search-repository-files:在存储库中查找文件
  • get-file-content:检索特定文件内容

🔍 示例场景

询问启用MCP的AI助手:

“axios库中处理请求拦截器的可用方法是什么?”

您的助手可以:

  1. 使用 get-repository-api-docs 获取最新的axios API文档
  2. 分析拦截器方法的当前文档
  3. 为您提供准确、最新的信息

🧰 建筑

ghcontext遵循模块化设计:

┌─────────────────┐       ┌──────────────┐       ┌────────────────┐
│   MCP Server    │◄─────►│  GitHub API  │◄─────►│  GitHub.com    │
│  (TypeScript)   │       │    Client    │       │                │
└────────┬────────┘       └──────────────┘       └────────────────┘
         │
         │
┌────────▼────────┐       ┌──────────────┐
│ Context         │       │   Caching    │
│ Processors      │◄─────►│   System     │
└─────────────────┘       └──────────────┘
  • MCP服务器: 处理模型上下文协议通信
  • GitHub API客户端: 管理GitHub REST和GraphQL API交互
  • 上下文处理器: 提取并整理相关信息
  • 缓存系统: 提高性能并减少API负载

🧠 为什么重要

传统的人工智能助手面临以下挑战:

  • 存储库知识过时
  • 对项目结构的理解不完整
  • 无法查看最近的更改和更新

ghcontext通过让LLM直接访问GitHub的最新信息来解决这些问题,使您的AI助手更准确、更有帮助,并且与您不断发展的代码库更加同步。

🛠️ 发展

# Build the project
pnpm run build

# Run tests
pnpm test

# Lint your code
pnpm run lint

# Format your code
pnpm run format

📦 发布到npm

如果您是此软件包的维护者,需要发布新版本:

  1. 更新package.json中的版本:
   # For patch releases (bug fixes)
   npm version patch

   # For minor releases (new features, no breaking changes)
   npm version minor

   # For major releases (breaking changes)
   npm version major
  1. 发布到npm:
   # The prepublishOnly script will run linting, tests, and build automatically
   npm publish
  1. 将标签推送到GitHub:
   git push --follow-tags

📝 许可证

该项目已获得麻省理工学院的许可-请参阅 许可证 文件以获取详细信息。

______________________________________________________________________

ghcontext: Because your AI assistant should understand your code as well as you do.

目录标签

目录标签

GitHub代码分析TypeScriptClaudeAPI文档developer-toolsghcontextllm-integrationGitHub集成本地部署实时数据LLM增强

支持客户端

Claude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

ghcontext

工具数量(toolCount,工具数)

5

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

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

来源信息

继续浏览同类 MCP