read-github
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseRead GitHub Docs
读取GitHub文档
Access GitHub repository documentation and code via the gitmcp.io MCP service.
通过gitmcp.io MCP服务访问GitHub仓库的文档与代码。
URL Conversion
URL转换
Convert GitHub URLs to gitmcp.io:
- →
github.com/owner/repogitmcp.io/owner/repo - →
https://github.com/karpathy/llm-councilhttps://gitmcp.io/karpathy/llm-council
将GitHub URL转换为gitmcp.io格式:
- →
github.com/owner/repogitmcp.io/owner/repo - →
https://github.com/karpathy/llm-councilhttps://gitmcp.io/karpathy/llm-council
CLI Usage
CLI使用方法
The script provides CLI access to repository docs.
scripts/gitmcp.pyscripts/gitmcp.pyList Available Tools
列出可用工具
bash
python3 scripts/gitmcp.py list-tools owner/repobash
python3 scripts/gitmcp.py list-tools owner/repoFetch Documentation
获取文档
Retrieves the full documentation file (README, docs, etc.):
bash
python3 scripts/gitmcp.py fetch-docs owner/repo检索完整的文档文件(README、docs等):
bash
python3 scripts/gitmcp.py fetch-docs owner/repoSearch Documentation
搜索文档
Semantic search within repository documentation:
bash
python3 scripts/gitmcp.py search-docs owner/repo "query"在仓库文档内进行语义搜索:
bash
python3 scripts/gitmcp.py search-docs owner/repo "query"Search Code
搜索代码
Search code using GitHub Search API (exact match):
bash
python3 scripts/gitmcp.py search-code owner/repo "function_name"使用GitHub Search API搜索代码(精确匹配):
bash
python3 scripts/gitmcp.py search-code owner/repo "function_name"Fetch Referenced URL
获取引用的URL
Fetch content from URLs mentioned in documentation:
bash
python3 scripts/gitmcp.py fetch-url owner/repo "https://example.com/doc"获取文档中提及的URL内容:
bash
python3 scripts/gitmcp.py fetch-url owner/repo "https://example.com/doc"Direct Tool Call
直接调用工具
Call any MCP tool directly:
bash
python3 scripts/gitmcp.py call owner/repo tool_name '{"arg": "value"}'直接调用任意MCP工具:
bash
python3 scripts/gitmcp.py call owner/repo tool_name '{"arg": "value"}'Tool Names
工具名称
Tool names are dynamically prefixed with the repo name (underscored):
- →
karpathy/llm-councilfetch_llm_council_documentation - →
facebook/reactfetch_react_documentation - →
my-org/my-repofetch_my_repo_documentation
工具名称会自动以仓库名称(下划线形式)作为前缀:
- →
karpathy/llm-councilfetch_llm_council_documentation - →
facebook/reactfetch_react_documentation - →
my-org/my-repofetch_my_repo_documentation
Available MCP Tools
可用的MCP工具
For any repository, these tools are available:
- fetch_{repo}_documentation - Fetch entire documentation. Call first for general questions.
- search_{repo}_documentation - Semantic search within docs. Use for specific queries.
- search_{repo}_code - Search code via GitHub API (exact match). Returns matching files.
- fetch_generic_url_content - Fetch any URL referenced in docs, respecting robots.txt.
对于任意仓库,以下工具均可用:
- fetch_{repo}_documentation - 获取完整文档。首次调用以了解项目概况。
- search_{repo}_documentation - 在文档内进行语义搜索。用于特定查询。
- search_{repo}_code - 通过GitHub API搜索代码(精确匹配)。返回匹配的文件。
- fetch_generic_url_content - 获取文档中引用的任意URL内容,遵守robots.txt规则。
Workflow
工作流程
- When given a GitHub repo, first fetch documentation to understand the project
- Use search-docs for specific questions about usage or features
- Use search-code to find implementations or specific functions
- Use fetch-url to retrieve external references mentioned in docs
- 当获取到GitHub仓库时,先获取文档以了解项目
- 使用search-docs查询关于使用方法或功能的特定问题
- 使用search-code查找实现或特定函数
- 使用fetch-url获取文档中提及的外部引用内容