
终结代码幻觉!GitMCP 是一个免费的开源远程 MCP 服务器,适用于任何 GitHub 项目
概览
什么是GitMCP • 功能 • 入门指南 • 工作原理 • 徽章 • 示例 • 常见问题解答 • 隐私 • 贡献 • 许可 GitMCP 是一个免费的开源远程模型上下文协议(MCP)服务器,能够将 GitHub 项目(仓库或 GitHub 页面)转变为文档中心。它使像 Cursor 这样的 AI 工具能够访问最新的文档和代码,即使 LLM 从未接触过,从而无缝消除代码幻觉。 * 当你主要操作少数几个库时,可以使用这些资源。这确保你的 AI 助手始终锁定正确的项目,通过防止访问非预期的仓库,增强安全性和相关性。* 当你需要频繁切换不同仓库时,使用此方法以获得最大灵活性。AI 助手会提示你(或根据上下文决定)每个请求访问哪个仓库。请注意,这依赖于每次正确识别目标仓库。
概述(AI 翻译)
什么是GitMCP • 特色 • 入门指南 • 工作原理 • 徽章 • 示例 • 常见问题 • 隐私 • 贡献 • 许可
🤔 什么是GitMCP?
别再用幻觉来做氛围编码了!
GitMCP 是一个免费、开源的远程模型上下文协议(MCP)服务器,能够将任何 GitHub 项目(仓库或 GitHub 页面)转化为文档中心。它使像 Cursor 这样的 AI 工具能够访问最新的文档和代码,即使 LLM 从未接触过,从而无缝消除代码幻觉。
GitMCP 支持两种版本 -
- 特定仓库(
gitmcp.io/{owner}/{repo}或 [{owner}.gitmcp.io/{repo}): 当你主要操作少数几个库时,请使用这些资源库。这确保你的AI助手始终锁定正确的项目,通过防止访问非预期的仓库,增强安全性和相关性。 - 通用服务器(
gitmcp.io/docs): 当你需要频繁切换不同仓库时,使用此功能以获得最大灵活性。AI助手会提示你(或根据上下文决定)每个请求访问哪个仓库。
本页由 AI 翻译,技术细节请以原文为准。
README
以下为原文 README 节选,完整内容请查看原文。
GitMCP
What is GitMCP • Features • Getting Started • How It Works • Badge • Examples • FAQ • Privacy • Contributing • License
🤔 What is GitMCP?
Stop vibe-hallucinating and start vibe-coding!
GitMCP is a free, open-source, remote Model Context Protocol (MCP) server that transforms any GitHub project (repositories or GitHub pages) into a documentation hub. It enables AI tools like Cursor to access up-to-date documentation and code, even if the LLM has never encountered them, thereby eliminating code hallucinations seamlessly.
GitMCP supports two flavors -
- Specific Repository (
gitmcp.io/{owner}/{repo}or{owner}.gitmcp.io/{repo}): Use these when you primarily work with a select number of libraries. This ensures your AI assistant always targets the correct project, enhancing security and relevance by preventing access to unintended repositories. - Generic Server (
gitmcp.io/docs): Use this for maximum flexibility when you need to switch between different repositories frequently. The AI assistant will prompt you (or decide based on context) which repository to access for each request. Be mindful that this relies on correctly identifying the target repository each time.
With GitMCP:
- AI assistants access the latest documentation and code directly from the source.
- Get accurate API usage and reliable code examples.
- Work effectively even with niche, new, or rapidly changing libraries.
- Significantly reduced hallucinations and improved code correctness.
For example, this side-by-side comparison shows the result for the same one-shot prompt in Cursor when creating a three.js scene -
https://github.com/user-attachments/assets/fbf1b4a7-f9f0-4c0e-831c-4d64faae2c45
✨ Features
安装
npx mcp-remote https://gitmcp.io/{owner}/{repo}配置
{
"mcpServers": {
"gitmcp": {
"url": "https://gitmcp.io/{owner}/{repo}"
}
}
}