CodeWiki MCP — AI-generated docs for GitHub repos

编码与调试

by izzzzzi

MCP server for codewiki.google: search repos, fetch wiki docs, ask questions

什么是 CodeWiki MCP — AI-generated docs for GitHub repos

MCP server for codewiki.google: search repos, fetch wiki docs, ask questions

README

<div align="center">

📚 codewiki-mcp

MCP server for codewiki.google — search, fetch docs, and ask questions about any open-source repo

CI Release npm version npm downloads License: MIT TypeScript Node.js

🇷🇺 Русский | 🇬🇧 English

<br />

MCP server that connects any AI assistant to codewiki.google — AI-generated wiki documentation for open-source repositories.

</div>

📖 Overview

codewiki-mcp is a Model Context Protocol server that gives AI assistants access to codewiki.google — a service that generates comprehensive wiki documentation for any GitHub repository. Search repos, fetch full docs, or ask natural-language questions — all through MCP.


✨ Features

FeatureDescription
🔍 Search ReposFind repositories indexed by codewiki.google
📄 Fetch Wiki DocsGet full markdown or structured pages for any repo
💬 Ask QuestionsNatural-language Q&A with conversation history
🧠 NLP Repo ResolutionType naturally — wink-nlp extracts keywords and resolves to owner/repo
📡 Multiple Transportsstdio (default), Streamable HTTP, SSE
🔄 Retry with BackoffAutomatic retries with exponential backoff on 5xx errors
🐳 Docker SupportMulti-stage Alpine build
📊 Response MetadataByte count and elapsed time on every response

🚀 Quick Start

Using npx (no install)

bash
npx -y codewiki-mcp@latest

From source

bash
git clone https://github.com/izzzzzi/codewiki-mcp.git
cd codewiki-mcp
npm install
npm run build

Transports

bash
# stdio (default)
node dist/cli.js

# Streamable HTTP
node dist/cli.js --http --port 3000

# SSE
node dist/cli.js --sse --port 3001

🐳 Docker

bash
docker build -t codewiki-mcp .

# stdio
docker run -it --rm codewiki-mcp

# HTTP
docker run -p 3000:3000 codewiki-mcp --http

# with environment variables
docker run -p 3000:3000 \
  -e CODEWIKI_REQUEST_TIMEOUT=60000 \
  -e CODEWIKI_MAX_RETRIES=5 \
  -e GITHUB_TOKEN=ghp_your_token \
  codewiki-mcp --http

🔧 MCP Client Configuration

<details> <summary><b>Cursor</b></summary>

Add to .cursor/mcp.json:

json
{
  "mcpServers": {
    "codewiki-mcp": {
      "command": "npx",
      "args": ["-y", "codewiki-mcp@latest"]
    }
  }
}
</details> <details> <summary><b>Claude Desktop</b></summary>

Add to claude_desktop_config.json:

json
{
  "mcpServers": {
    "codewiki-mcp": {
      "command": "npx",
      "args": ["-y", "codewiki-mcp@latest"]
    }
  }
}
</details> <details> <summary><b>Claude Code</b></summary>
bash
claude mcp add codewiki-mcp -- npx -y codewiki-mcp@latest
</details> <details> <summary><b>Windsurf</b></summary>

Add to your Windsurf MCP config:

json
{
  "mcpServers": {
    "codewiki-mcp": {
      "command": "npx",
      "args": ["-y", "codewiki-mcp@latest"]
    }
  }
}
</details> <details> <summary><b>VS Code (Copilot)</b></summary>

Add to .vscode/mcp.json:

json
{
  "servers": {
    "codewiki-mcp": {
      "command": "npx",
      "args": ["-y", "codewiki-mcp@latest"]
    }
  }
}
</details> <details> <summary><b>Local development</b></summary>
json
{
  "mcpServers": {
    "codewiki-mcp": {
      "command": "node",
      "args": ["/path/to/codewiki-mcp/dist/cli.js"]
    }
  }
}
</details>

💡 Usage

Prompts you can use in any MCP-compatible client:

code
codewiki fetch how routing works in Next.js
code
codewiki search state management libraries
code
codewiki ask how does React fiber reconciler work?

Fetch complete documentation:

code
codewiki fetch vercel/next.js
codewiki fetch https://github.com/fastify/fastify

Get structured pages:

code
codewiki fetch pages tailwindlabs/tailwindcss

Ask with natural language:

code
codewiki ask fastify how to add authentication?

🛠️ MCP Tools

🔍 codewiki_search_repos

Search repositories indexed by codewiki.google.

ParameterTypeRequiredDefaultDescription
querystringSearch query
limitnumber10Max results (1–50)

📄 codewiki_fetch_repo

Fetch generated wiki content for a repository.

ParameterTypeRequiredDefaultDescription
repostringowner/repo, GitHub URL, or natural-language query
modestring"aggregate""aggregate" — full markdown; "pages" — structured JSON

💬 codewiki_ask_repo

Ask a natural-language question about a repository.

ParameterTypeRequiredDefaultDescription
repostringRepository identifier (same formats as fetch)
questionstringQuestion about the repo
historyarray[]Conversation history [{role, content}] (max 20)

📊 Response Format

<details> <summary><b>✅ Success — Search</b></summary>
json
{
  "query": "fastify",
  "count": 1,
  "items": [
    {
      "fullName": "fastify/fastify",
      "url": "https://github.com/fastify/fastify",
      "description": "Fast and low overhead web framework",
      "avatarUrl": "https://avatars.githubusercontent.com/u/24939....",
      "extraScore": 555
    }
  ],
  "meta": {
    "totalBytes": 12500,
    "totalElapsedMs": 450
  }
}
</details> <details> <summary><b>✅ Success — Fetch (pages mode)</b></summary>
json
{
  "repo": "fastify/fastify",
  "commit": "abc123",
  "canonicalUrl": "https://github.com/fastify/fastify",
  "pages": [
    {
      "title": "Overview",
      "level": 1,
      "anchor": "#overview",
      "markdown": "# Overview\n\nFastify is a web framework...",
      "diagramCount": 1
    }
  ],
  "meta": {
    "totalBytes": 25000,
    "totalElapsedMs": 1200
  }
}
</details> <details> <summary><b>✅ Success — Ask</b></summary>
json
{
  "answer": "Fastify uses a plugin-based architecture where...",
  "meta": {
    "totalBytes": 8500,
    "totalElapsedMs": 2300
  }
}
</details> <details> <summary><b>❌ Error Response</b></summary>
json
{
  "error": {
    "code": "RPC_FAIL",
    "message": "CodeWiki RPC VSX6ub failed with status 404",
    "rpcId": "VSX6ub",
    "statusCode": 404
  }
}

Error codes: VALIDATION, RPC_FAIL, TIMEOUT, NLP_RESOLVE_FAIL

</details>

⚙️ How It Works

Data Flow

code
AI Assistant → MCP protocol → codewiki-mcp → HTTPS → codewiki.google
                                                            ↓
AI Assistant ← MCP protocol ← codewiki-mcp ← JSON  ← Google RPC API

Google Batchexecute RPC

codewiki.google uses Google's internal batchexecute RPC format (not REST, not GraphQL). The client:

  1. Builds a POST request with f.req=... body
  2. Sends it to /_/BoqAngularSdlcAgentsUi/data/batchexecute
  3. Receives a response with XSSI prefix )]}'\n
  4. Parses wrb.fr frames and extracts the typed payload

Each tool maps to an RPC ID:

ToolRPC ID
🔍 SearchvyWDAf
📄 FetchVSX6ub
💬 AskEgIxfe

🧠 NLP Repo Resolution

Users can type natural language instead of owner/repo:

code
"the fastify web framework"
  → wink-nlp extracts keyword "fastify" (POS tag: NOUN/PROPN)
  → GitHub Search API: GET /search/repositories?q=fastify&sort=stars
  → top result: "fastify/fastify"
  → normalizeRepoInput("fastify/fastify") → URL for codewiki

🔄 Retry with Exponential Backoff

AttemptDelay
0immediate
1250ms
2500ms
31000ms

4xx errors (client errors) are never retried.


🖥️ CLI

code
codewiki-mcp [options]

Options:
  --http           Streamable HTTP transport
  --sse            SSE transport
  --port <number>  Port for HTTP/SSE (default: 3000)
  --endpoint <str> URL endpoint (default: /mcp)
  --help, -h       Show help

⚡ Configuration

Environment variables:

VariableDefaultDescription
CODEWIKI_BASE_URLhttps://codewiki.googleBase URL
CODEWIKI_REQUEST_TIMEOUT30000Request timeout (ms)
CODEWIKI_MAX_RETRIES3Max retries
CODEWIKI_RETRY_DELAY250Base retry delay (ms)
GITHUB_TOKENGitHub token for NLP repo resolution

You can also create a .env file in the project root:

code
CODEWIKI_REQUEST_TIMEOUT=60000
CODEWIKI_MAX_RETRIES=5
GITHUB_TOKEN=ghp_your_token

📁 Project Structure

code
src/
├── cli.ts                  # CLI entry point
├── server.ts               # Transport setup (stdio/HTTP/SSE)
├── index.ts                # Library re-exports
├── schemas.ts              # Zod input schemas
├── lib/
│   ├── codewikiClient.ts   # API client with retry + metadata
│   ├── batchexecute.ts     # Google RPC response parser
│   ├── repo.ts             # Repo normalization + NLP resolution
│   ├── extractKeyword.ts   # NLP keyword extraction (wink-nlp)
│   ├── resolveRepo.ts      # GitHub Search API resolver
│   ├── errors.ts           # CodeWikiError + formatMcpError
│   └── config.ts           # Env-based configuration
└── tools/
    ├── searchRepos.ts      # codewiki_search_repos
    ├── fetchRepo.ts        # codewiki_fetch_repo
    └── askRepo.ts          # codewiki_ask_repo

❓ Troubleshooting

<details> <summary><b>Permission Denied</b></summary>
bash
chmod +x ./node_modules/.bin/codewiki-mcp
</details> <details> <summary><b>Connection Refused (HTTP/SSE)</b></summary>
bash
# Check if port is in use
lsof -i :3000
</details> <details> <summary><b>Timeout Errors</b></summary>

For large repositories, increase the timeout:

bash
CODEWIKI_REQUEST_TIMEOUT=60000 node dist/cli.js
</details> <details> <summary><b>NLP Resolution Fails</b></summary>

If natural-language input doesn't resolve, use explicit format:

code
# Instead of "the fastify framework"
fastify/fastify
# or
https://github.com/fastify/fastify

Set GITHUB_TOKEN to avoid GitHub API rate limits for unauthenticated requests.

</details>

🧑‍💻 Development

bash
npm run dev          # stdio with tsx
npm run dev:http     # HTTP with tsx
npm run dev:sse      # SSE with tsx
npm run typecheck    # type check
npm run test         # run tests
npm run test:watch   # tests in watch mode
npm run build        # compile to dist/

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feat/my-feature)
  3. Use Conventional Commits for commit messages
  4. Run npm run typecheck && npm run test before submitting
  5. Open a Pull Request

📄 License

MIT © codewiki-mcp contributors

常见问题

CodeWiki MCP — AI-generated docs for GitHub repos 是什么?

MCP server for codewiki.google: search repos, fetch wiki docs, ask questions

相关 Skills

网页构建器

by anthropics

Universal
热门

面向复杂 claude.ai HTML artifact 开发,快速初始化 React + Tailwind CSS + shadcn/ui 项目并打包为单文件 HTML,适合需要状态管理、路由或多组件交互的页面。

在 claude.ai 里做复杂网页 Artifact 很省心,多组件、状态和路由都能顺手搭起来,React、Tailwind 与 shadcn/ui 组合效率高、成品也更精致。

编码与调试
未扫描114.1k

前端设计

by anthropics

Universal
热门

面向组件、页面、海报和 Web 应用开发,按鲜明视觉方向生成可直接落地的前端代码与高质感 UI,适合做 landing page、Dashboard 或美化现有界面,避开千篇一律的 AI 审美。

想把页面做得既能上线又有设计感,就用前端设计:组件到整站都能产出,难得的是能避开千篇一律的 AI 味。

编码与调试
未扫描114.1k

网页应用测试

by anthropics

Universal
热门

用 Playwright 为本地 Web 应用编写自动化测试,支持启动开发服务器、校验前端交互、排查 UI 异常、抓取截图与浏览器日志,适合调试动态页面和回归验证。

借助 Playwright 一站式验证本地 Web 应用前端功能,调 UI 时还能同步查看日志和截图,定位问题更快。

编码与调试
未扫描114.1k

相关 MCP Server

GitHub

编辑精选

by GitHub

热门

GitHub 是 MCP 官方参考服务器,让 Claude 直接读写你的代码仓库和 Issues。

这个参考服务器解决了开发者想让 AI 安全访问 GitHub 数据的问题,适合需要自动化代码审查或 Issue 管理的团队。但注意它只是参考实现,生产环境得自己加固安全。

编码与调试
83.4k

by Context7

热门

Context7 是实时拉取最新文档和代码示例的智能助手,让你告别过时资料。

它能解决开发者查找文档时信息滞后的问题,特别适合快速上手新库或跟进更新。不过,依赖外部源可能导致偶尔的数据延迟,建议结合官方文档使用。

编码与调试
52.2k

by tldraw

热门

tldraw 是让 AI 助手直接在无限画布上绘图和协作的 MCP 服务器。

这解决了 AI 只能输出文本、无法视觉化协作的痛点——想象让 Claude 帮你画流程图或白板讨论。最适合需要快速原型设计或头脑风暴的开发者。不过,目前它只是个基础连接器,你得自己搭建画布应用才能发挥全部潜力。

编码与调试
46.3k

评论