read-github

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Read 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/repo
    gitmcp.io/owner/repo
  • https://github.com/karpathy/llm-council
    https://gitmcp.io/karpathy/llm-council
将GitHub URL转换为gitmcp.io格式:
  • github.com/owner/repo
    gitmcp.io/owner/repo
  • https://github.com/karpathy/llm-council
    https://gitmcp.io/karpathy/llm-council

CLI Usage

CLI使用方法

The
scripts/gitmcp.py
script provides CLI access to repository docs.
scripts/gitmcp.py
脚本提供了访问仓库文档的CLI接口。

List Available Tools

列出可用工具

bash
python3 scripts/gitmcp.py list-tools owner/repo
bash
python3 scripts/gitmcp.py list-tools owner/repo

Fetch 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/repo

Search 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-council
    fetch_llm_council_documentation
  • facebook/react
    fetch_react_documentation
  • my-org/my-repo
    fetch_my_repo_documentation
工具名称会自动以仓库名称(下划线形式)作为前缀:
  • karpathy/llm-council
    fetch_llm_council_documentation
  • facebook/react
    fetch_react_documentation
  • my-org/my-repo
    fetch_my_repo_documentation

Available MCP Tools

可用的MCP工具

For any repository, these tools are available:
  1. fetch_{repo}_documentation - Fetch entire documentation. Call first for general questions.
  2. search_{repo}_documentation - Semantic search within docs. Use for specific queries.
  3. search_{repo}_code - Search code via GitHub API (exact match). Returns matching files.
  4. fetch_generic_url_content - Fetch any URL referenced in docs, respecting robots.txt.
对于任意仓库,以下工具均可用:
  1. fetch_{repo}_documentation - 获取完整文档。针对一般性问题请首先调用此工具。
  2. search_{repo}_documentation - 在文档内进行语义搜索。用于特定查询。
  3. search_{repo}_code - 通过GitHub API搜索代码(精确匹配)。返回匹配的文件。
  4. fetch_generic_url_content - 获取文档中引用的任意URL内容,遵循robots.txt规则。

Workflow

工作流程

  1. When given a GitHub repo, first fetch documentation to understand the project
  2. Use search-docs for specific questions about usage or features
  3. Use search-code to find implementations or specific functions
  4. Use fetch-url to retrieve external references mentioned in docs
  1. 当获取到GitHub仓库时,首先获取文档以了解项目情况
  2. 使用search-docs工具查询关于使用方法或功能的特定问题
  3. 使用search-code工具查找实现或特定函数
  4. 使用fetch-url工具获取文档中提及的外部引用内容