codewiki-mcp
Connects to the GitHub Search API for natural-language repository resolution, allowing the server to identify repositories and resolve owners/names from descriptive keywords.
Integrates with codewiki.google to search for repositories, fetch AI-generated wiki documentation, and answer questions about open-source projects using the Google RPC API.
π codewiki-mcp
MCP server for codewiki.google β search, fetch docs, and ask questions about any open-source repo
π·πΊ Π ΡΡΡΠΊΠΈΠΉ | π¬π§ English
MCP server that connects any AI assistant to codewiki.google β AI-generated wiki documentation for open-source repositories.
π 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.
Related MCP server: mediawiki-mcp-server
β¨ Features
Feature | Description |
π Search Repos | Find repositories indexed by codewiki.google |
π Fetch Wiki Docs | Get full markdown or structured pages for any repo |
π¬ Ask Questions | Natural-language Q&A with conversation history |
π§ NLP Repo Resolution | Type naturally β wink-nlp extracts keywords and resolves to |
π‘ Multiple Transports | stdio (default), Streamable HTTP, SSE |
π Retry with Backoff | Automatic retries with exponential backoff on 5xx errors |
π³ Docker Support | Multi-stage Alpine build |
π Response Metadata | Byte count and elapsed time on every response |
π Quick Start
Using npx (no install)
npx -y codewiki-mcp@latestFrom source
git clone https://github.com/izzzzzi/codewiki-mcp.git
cd codewiki-mcp
npm install
npm run buildTransports
# stdio (default)
node dist/cli.js
# Streamable HTTP
node dist/cli.js --http --port 3000
# SSE
node dist/cli.js --sse --port 3001π³ Docker
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
Add to .cursor/mcp.json:
{
"mcpServers": {
"codewiki-mcp": {
"command": "npx",
"args": ["-y", "codewiki-mcp@latest"]
}
}
}Add to claude_desktop_config.json:
{
"mcpServers": {
"codewiki-mcp": {
"command": "npx",
"args": ["-y", "codewiki-mcp@latest"]
}
}
}claude mcp add codewiki-mcp -- npx -y codewiki-mcp@latestAdd to your Windsurf MCP config:
{
"mcpServers": {
"codewiki-mcp": {
"command": "npx",
"args": ["-y", "codewiki-mcp@latest"]
}
}
}Add to .vscode/mcp.json:
{
"servers": {
"codewiki-mcp": {
"command": "npx",
"args": ["-y", "codewiki-mcp@latest"]
}
}
}{
"mcpServers": {
"codewiki-mcp": {
"command": "node",
"args": ["/path/to/codewiki-mcp/dist/cli.js"]
}
}
}π‘ Usage
Prompts you can use in any MCP-compatible client:
codewiki fetch how routing works in Next.jscodewiki search state management librariescodewiki ask how does React fiber reconciler work?Fetch complete documentation:
codewiki fetch vercel/next.js
codewiki fetch https://github.com/fastify/fastifyGet structured pages:
codewiki fetch pages tailwindlabs/tailwindcssAsk with natural language:
codewiki ask fastify how to add authentication?π οΈ MCP Tools
π codewiki_search_repos
Search repositories indexed by codewiki.google.
Parameter | Type | Required | Default | Description |
| string | β | β | Search query |
| number | β | 10 | Max results (1β50) |
π codewiki_fetch_repo
Fetch generated wiki content for a repository.
Parameter | Type | Required | Default | Description |
| string | β | β |
|
| string | β |
|
|
π¬ codewiki_ask_repo
Ask a natural-language question about a repository.
Parameter | Type | Required | Default | Description |
| string | β | β | Repository identifier (same formats as fetch) |
| string | β | β | Question about the repo |
| array | β |
| Conversation history |
π Response Format
{
"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
}
}{
"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
}
}{
"answer": "Fastify uses a plugin-based architecture where...",
"meta": {
"totalBytes": 8500,
"totalElapsedMs": 2300
}
}{
"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
βοΈ How It Works
Data Flow
AI Assistant β MCP protocol β codewiki-mcp β HTTPS β codewiki.google
β
AI Assistant β MCP protocol β codewiki-mcp β JSON β Google RPC APIGoogle Batchexecute RPC
codewiki.google uses Google's internal batchexecute RPC format (not REST, not GraphQL). The client:
Builds a POST request with
f.req=...bodySends it to
/_/BoqAngularSdlcAgentsUi/data/batchexecuteReceives a response with XSSI prefix
)]}'\nParses
wrb.frframes and extracts the typed payload
Each tool maps to an RPC ID:
Tool | RPC ID |
π Search |
|
π Fetch |
|
π¬ Ask |
|
π§ NLP Repo Resolution
Users can type natural language instead of owner/repo:
"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
Attempt | Delay |
0 | immediate |
1 | 250ms |
2 | 500ms |
3 | 1000ms |
4xx errors (client errors) are never retried.
π₯οΈ CLI
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:
Variable | Default | Description |
|
| Base URL |
|
| Request timeout (ms) |
|
| Max retries |
|
| Base retry delay (ms) |
| β | GitHub token for NLP repo resolution |
You can also create a .env file in the project root:
CODEWIKI_REQUEST_TIMEOUT=60000
CODEWIKI_MAX_RETRIES=5
GITHUB_TOKEN=ghp_your_tokenπ Project Structure
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
chmod +x ./node_modules/.bin/codewiki-mcp# Check if port is in use
lsof -i :3000For large repositories, increase the timeout:
CODEWIKI_REQUEST_TIMEOUT=60000 node dist/cli.jsIf natural-language input doesn't resolve, use explicit format:
# Instead of "the fastify framework"
fastify/fastify
# or
https://github.com/fastify/fastifySet GITHUB_TOKEN to avoid GitHub API rate limits for unauthenticated requests.
π§βπ» Development
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:
Fork the repository
Create a feature branch (
git checkout -b feat/my-feature)Use Conventional Commits for commit messages
Run
npm run typecheck && npm run testbefore submittingOpen a Pull Request
π License
MIT Β© codewiki-mcp contributors
Available Tools
3 toolscodewiki_ask_repoC
Ask a natural-language question about a repository indexed in codewiki.google
Inputs: repo (required), question (required), history.
codewiki_fetch_repoC
Fetch generated wiki content for a repository from codewiki.google
Inputs: repo (required), mode.
codewiki_search_reposC
Search repositories indexed by codewiki.google
Inputs: query (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogβ¦
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose with no overlap: 'ask_repo' handles natural-language queries, 'fetch_repo' retrieves wiki content, and 'search_repos' finds indexed repositories. The descriptions make it easy to differentiate between querying, fetching, and searching functions.
All tools follow a perfect 'codewiki_verb_noun' pattern with consistent snake_case formatting. The prefix 'codewiki_' is uniformly applied, and verbs ('ask', 'fetch', 'search') are distinct and appropriately paired with nouns ('repo' or 'repos').
With only 3 tools, the set feels thin for a server focused on repository wiki interactions. While the tools cover basic operations, the scope might benefit from additional tools for updates, deletions, or more granular queries to handle common workflows more comprehensively.
The tools provide good coverage for core operations: searching repositories, fetching content, and asking questions. However, there are minor gaps such as lacking update or deletion tools for wiki content, which could limit agent capabilities in full lifecycle management scenarios.
Maintenance
Related MCP Connectors
An MCP server that gives your AI access to the source code and docs of all public github repos
MCP server for opencode documentation, generated by doc2mcp.
Related MCP Servers
- FlicenseBqualityDmaintenanceA MCP server that allows you to search and retrieve content on any wiki site using MediaWiki with LLMs π€. wikipedia.org, fandom.com, wiki.gg and more sites using Mediawiki are supported!227-
- AlicenseAqualityAmaintenanceMCP server for MediaWiki wikis. Search, read, edit, and manage wiki content from AI assistants. Includes formatting, link checking, revision history, and markdown conversion.4325MIT
- AlicenseNot gradedqualityDmaintenanceMCP server for Wiki.js integration, enabling AI assistants to create, read, update, delete, search, and move wiki pages via natural language.1MIT
- AlicenseNot gradedqualityDmaintenanceMCP server that provides tools to add to, search, and manage a wiki knowledge base, enabling AI chat tools to contribute and retrieve information from the wiki via natural language prompts.MIT