Skip to main content
Glama

Zread.ai MCP Server

Python Node.js MCP License

连接 Zread.ai 文档平台的 MCP 服务器,让 AI 助手能够阅读 GitHub 仓库文档、搜索代码、与仓库 AI 对话。

💡 提示 AI:这是一个 MCP (Model Context Protocol) 服务器,提供 9 个工具用于代码仓库分析。支持 Python 和 Node.js 两种实现,可通过 npx 或 uvx 一行命令运行。核心功能包括文档查询、仓库搜索、AI 问答。

功能

  • 文档查询 - 获取仓库文档页面、目录结构、搜索关键词

  • 仓库发现 - 推荐仓库、热门榜单、搜索代码库

  • AI 问答 - 向仓库 AI 助手提问(需 Token)

  • 文件获取 - 读取源代码文件内容(需 Token)

Related MCP server: GitBridge

快速启动

uvx zread-mcp
npx zread-mcp

带 Token 运行

# uvx (Python)
uvx --env ZREAD_TOKEN=your-token zread-mcp

# npx (Node.js) - Windows
set ZREAD_TOKEN=your-token && npx zread-mcp

# npx (Node.js) - macOS/Linux
ZREAD_TOKEN=your-token npx zread-mcp

HTTP 模式 (Streamable HTTP)

uvx zread-mcp --transport http --port 3000
npx zread-mcp --transport http --port 3000

更多运行方式

Python 生态

# uvx 从 PyPI 运行(推荐)
uvx zread-mcp

# uvx 从 GitHub 仓库运行
uvx --from git+https://github.com/ejfkdev/zread-mcp.git zread-mcp

# uv 运行远程脚本
uv run https://raw.githubusercontent.com/ejfkdev/zread-mcp/main/zread_mcp_server.py

# pipx 从 GitHub 运行
pipx run --spec git+https://github.com/ejfkdev/zread-mcp.git zread-mcp

# pipx 安装到本地
pipx install git+https://github.com/ejfkdev/zread-mcp.git
zread-mcp --transport http

# 本地运行
python zread_mcp_server.py

Node.js 生态

# pnpm
pnpm dlx ejfkdev/zread-mcp

# bun
bunx ejfkdev/zread-mcp

# 全局安装
npm install -g ejfkdev/zread-mcp
zread-mcp-server --transport http

MCP 客户端配置

npx(Node.js)

{
  "mcpServers": {
    "zread": {
      "command": "npx",
      "args": ["-y", "zread-mcp-server"],
      "env": {
        "ZREAD_TOKEN": "your-token"
      }
    }
  }
}

uvx(Python)

{
  "mcpServers": {
    "zread": {
      "command": "uvx",
      "args": ["--env", "ZREAD_TOKEN=your-token", "zread-mcp"]
    }
  }
}

获取 Token

部分高级功能(AI 问答、文件获取)需要 ZREAD_TOKEN:

  1. 访问 https://zread.ai 并登录

  2. 按 F12 打开控制台

  3. 粘贴运行:

    prompt('复制token', JSON.parse(localStorage.getItem('CGX_AUTH_STORAGE')).state.token)
  4. 复制弹窗中的 Token

命令行参数

--transport {stdio,http,sse}  传输协议 (默认: stdio, http/sse 等价)
--host HOST                   HTTP 模式主机 (默认: 127.0.0.1)
--port PORT                   HTTP 模式端口 (默认: 3000)
--token TOKEN                 ZREAD_TOKEN
--no-token                    强制无 Token 模式
-h, --help                    显示帮助

工具列表

工具

需要 Token

说明

fetch_documentation_page

否

获取文档页面

search_documentation

否

搜索文档

get_documentation_outline

否

获取文档大纲

discover_repositories

否

发现推荐仓库

find_repositories

否

搜索仓库

get_trending_repositories

否

热门仓库榜单

check_repository_status

否

检查仓库状态

ask_repo_ai

是

AI 智能问答

fetch_repository_file

是

获取源代码文件

开发

# 克隆仓库
git clone https://github.com/ejfkdev/zread-mcp.git
cd zread-mcp

# Python 测试
python zread_mcp_server.py --test

# Node.js 测试
node zread-mcp-server.js --test

许可证

MIT License

Available Tools

9 tools
ask_repo_aiA

向仓库 AI 助手提问(AI 调用 AI)。

此工具让当前的 AI 通过 MCP 协议调用另一个专门的仓库 AI 助手来回答问题。 被调用的 AI 助手基于仓库文档内容进行分析,并回答你的问题。

被调用的 AI 助手拥有的工具:

  • get_repo_structure: 分析并展示代码仓库的目录结构

  • view_file_schema: 查看文件大纲,使用 AST 解析提取文件结构

  • view_file_in_detail: 读取并显示文件的具体内容

  • web_search: 网络搜索,使用简洁的关键词检索相关信息

  • doc_search: 文档搜索,查找指南教程文档中的相关页面

如果需要分析特定文件或目录结构,可以在问题中显式要求 AI 使用上述工具进行回复。

对于仓库代码的复杂需求,应该优先使用此工具,如果有多个问题可并行调用。 适用于理解项目架构、使用方法、代码示例等复杂问题。 支持的 AI 模型: glm-4.7 (默认), claude-sonnet-4.5

返回的 Markdown 回答内容中可能包含两种链接格式:

  1. 仓库文件链接 - 格式: [文件名](文件路径#L开始行号-L结束行号) 例如: [index.ts](index.ts#L1-L28) [package.json](package.json#L1-L77) 这类链接指向仓库内的源代码文件,可提取文件路径和行号范围, 使用 fetch_repository_file(repo_path, file_path, start_line, end_line) 获取具体内容。

  2. 文档导航链接 - 格式: [标题](页面slug) 例如: [概述](1-overview) [快速开始](2-quick-start) 这类链接指向文档的其他页面,使用 fetch_documentation_page(repo_path, 页面slug) 获取该页文档内容。

Inputs: repo_path (required), question (required), ai_model, language.

check_repository_statusA

检查仓库索引状态。

查询指定仓库在 Zread.ai 的索引状态和基本信息。 返回的 status 字段: "success"(已索引), "progress"(索引中)

Inputs: repo_path (required).

discover_repositoriesB

发现推荐的代码仓库。

获取 Zread.ai 推荐的优质代码仓库,可按技术主题筛选。 适用于发现新工具、学习优秀项目。

Inputs: topic.

fetch_documentation_pageA

获取仓库文档的指定页面内容。

根据页面 slug(URL 标识符)获取该页面的完整 Markdown 文档内容。 适用于读取特定章节或页面的详细内容。

返回的 Markdown 页面内容中可能包含两种链接格式:

  1. 仓库文件链接 - 格式: [文件名](文件路径#L开始行号-L结束行号) 例如: [index.ts](index.ts#L1-L28) [package.json](package.json#L1-L77) 这类链接指向仓库内的源代码文件,可提取文件路径和行号范围, 使用 fetch_repository_file(repo_path, file_path, start_line, end_line) 获取具体内容。

  2. 文档导航链接 - 格式: [标题](页面slug) 例如: [概述](1-overview) [快速开始](2-quick-start) 这类链接指向文档的其他页面,使用 fetch_documentation_page(repo_path, 页面slug) 获取该页文档内容。

Inputs: repo_path (required), page_slug (required), language.

fetch_repository_fileA

获取仓库内的源代码文件内容。

读取指定仓库中的文件内容,支持按行号范围截取。 内部自动通过 repo_path 获取 repo_id。 适用于查看源代码、配置文件等。

示例:

  • 获取完整文件: fetch_repository_file("owner/repo", "src/config.ts")

  • 获取前 50 行: fetch_repository_file("owner/repo", "src/config.ts", 1, 51)

  • 从第 100 行到末尾: fetch_repository_file("owner/repo", "src/config.ts", 100)

Inputs: repo_path (required), file_path (required), start_line, end_line.

find_repositoriesC

搜索代码仓库。

根据关键词模糊搜索已索引的代码仓库。 支持仓库名称、描述、主题等字段的模糊匹配。

Inputs: query (required), language.

get_documentation_outlineA

获取仓库文档的完整目录结构。

返回仓库的文档目录树,包含所有页面的标题、slug 和层级关系。 首次调用会自动提交索引请求,如果仓库未被索引会返回等待状态。

Inputs: repo_path (required), language.

search_documentationB

在仓库文档中搜索关键词。

全文搜索仓库文档,返回包含关键词的页面和相关内容片段。 适用于快速定位文档中的特定信息。

Inputs: repo_path (required), keyword (required), language.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 9 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: meta-query, repo status, repo discovery (curated, keyword, trending), file access, doc outline, doc page, doc search. No overlap between tools.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern (e.g., check_repository_status, fetch_repository_file) with uniform snake_case. The one exception (ask_repo_ai) still fits the pattern.

    Tool Count5/5

    9 tools is well-scoped for a repository and documentation exploration MCP server. Each tool has a clear role and none feel extraneous or missing.

    Completeness5/5

    The tool set covers key operations for the domain: repo discovery, status check, file and documentation retrieval, outline, search, and a meta-AI query. Indexing is triggered automatically. No obvious gaps for the server's purpose.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers