Repo Docs MCP

Repo Docs MCP

A generic MCP server that exposes local repository checkouts, allowing users to search and read code and documentation through natural language. It supports multiple instances, enabling seamless interaction with various codebases via configurable tool prefixes and URI schemes.

Category
访问服务器

README

Repo Docs MCP (Bun)

Generic MCP stdio server that exposes a local repository checkout (docs + code) to any MCP host.

Designed for the “one codebase, many instances” workflow:

  • you run the same server binary multiple times,
  • each instance points at a different repo via env,
  • each instance gets its own tool prefix + URI scheme.

What it provides

Tools (names are prefixed)

Given MCP_TOOL_PREFIX=telegraph, tools are:

  • telegraph_read_repo_file — read any text file from the repo checkout
  • telegraph_list_docs — list doc pages as slug -> docs/... (slug is inferred from the docs file path)
  • telegraph_get_doc — read a doc page by slug
  • telegraph_search_docs — search inside the docs directory
  • telegraph_search_code — search inside common code directories
  • telegraph_refresh_index — rebuild the docs index
  • telegraph_git_fetchgit fetch --prune --tags for the repo (optional helper)
  • telegraph_info — print server settings (paths, prefixes, etc.)

Resources (names are prefixed by URI scheme)

Given MCP_URI_SCHEME=telegraph, resources are:

  • telegraph://readme
  • telegraph://contributing
  • telegraph://doc/{slug}

Prompts

  • {prefix}_doc_writer — starter workflow for “write a guide / answer about this repo”.

Install

bun install
bun run build

Run (stdio)

MCP_REPO_ROOT=/ABS/PATH/to/repo \
MCP_TOOL_PREFIX=myrepo \
MCP_URI_SCHEME=myrepo \
bun run start

In stdio mode, logs go to stderr on purpose (stdout is reserved for MCP JSON-RPC).

Environment variables

Required:

  • MCP_REPO_ROOT — absolute path to the local repo checkout

Optional:

  • MCP_TOOL_PREFIX — tool name prefix (default: repo)
  • MCP_URI_SCHEME — resource URI scheme (default: derived from tool prefix)
  • MCP_REPO_LABEL — text label used in the prompt (default: basename of repo root)
  • MCP_DOCS_DIR — docs directory relative to repo root (default: docs)
  • MCP_DOCS_EXTS — comma-separated docs extensions (default: .md,.mdx)
  • MCP_CODE_DIRS — comma-separated dirs to search for code (default: src,config,routes,database,resources,tests)
  • MCP_CODE_EXTS — comma-separated extensions for code search (default: .php,.md,.json,.yml,.yaml,.xml,.ts,.js)

Limits:

  • MCP_MAX_FILE_BYTES (default: 512KB)
  • MCP_DEFAULT_MAX_CHARS (default: 50k chars)

Git helper:

  • MCP_GIT_AUTO_FETCH=1 — run git fetch --prune --tags once at server start (default: off)
  • MCP_GIT_FETCH_TIMEOUT_MS — timeout for the fetch command (default: 30000)

Compatibility:

  • If MCP_REPO_ROOT is not set, the server will fall back to MCP_TELEGRAPH_ROOT (legacy name).

Codex config (two instances; one codebase)

Add this to ~/.codex/config.toml:

[mcp_servers.telegraph_docs]
command = "/ABS/PATH/TO/bun"
cwd = "/ABS/PATH/TO/mcp"
args = ["run", "build/index.js"]

[mcp_servers.telegraph_docs.env]
MCP_REPO_ROOT = "/ABS/PATH/TO/telegraph"
MCP_TOOL_PREFIX = "telegraph"
MCP_URI_SCHEME = "telegraph"
MCP_REPO_LABEL = "defstudio/telegraph"


[mcp_servers.laravel_data_docs]
command = "/ABS/PATH/TO/bun"
cwd = "/ABS/PATH/TO/mcp"
args = ["run", "build/index.js"]

[mcp_servers.laravel_data_docs.env]
MCP_REPO_ROOT = "/ABS/PATH/TO/laravel-data"
MCP_TOOL_PREFIX = "laravel_data"
MCP_URI_SCHEME = "laravel-data"
MCP_REPO_LABEL = "spatie/laravel-data"

Claude Desktop config (two instances)

See claude_desktop_config.example.json.

Notes

  • Docs slugs are inferred from file paths (ordering prefixes like 01., 01-, 01_ are stripped).
  • If a doc file is index.md inside a folder, the slug is the folder name (e.g. guide/index.mdguide).

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选