codewiki-mcp 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,9 +16,9 @@ jobs:
16
16
  matrix:
17
17
  node-version: [18, 20, 22]
18
18
  steps:
19
- - uses: actions/checkout@v4
19
+ - uses: actions/checkout@v6
20
20
 
21
- - uses: actions/setup-node@v4
21
+ - uses: actions/setup-node@v6
22
22
  with:
23
23
  node-version: ${{ matrix.node-version }}
24
24
  cache: npm
@@ -33,7 +33,7 @@ jobs:
33
33
  needs: test
34
34
  if: github.event_name == 'push' && github.ref == 'refs/heads/main'
35
35
  steps:
36
- - uses: actions/checkout@v4
36
+ - uses: actions/checkout@v6
37
37
 
38
38
  - name: Build Docker image
39
39
  run: docker build -t codewiki-mcp .
@@ -14,12 +14,12 @@ jobs:
14
14
  release:
15
15
  runs-on: ubuntu-latest
16
16
  steps:
17
- - uses: actions/checkout@v4
17
+ - uses: actions/checkout@v6
18
18
  with:
19
19
  fetch-depth: 0
20
20
  persist-credentials: false
21
21
 
22
- - uses: actions/setup-node@v4
22
+ - uses: actions/setup-node@v6
23
23
  with:
24
24
  node-version: 22
25
25
  cache: npm
package/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [1.0.1](https://github.com/izzzzzi/codewiki-mcp/compare/v1.0.0...v1.0.1) (2026-02-16)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * **docs:** correct GitHub owner in badge URLs and clone links ([dbcaa48](https://github.com/izzzzzi/codewiki-mcp/commit/dbcaa48a8b3ebc99274fa8919ff1ee10ef89d4ac))
7
+
1
8
  # 1.0.0 (2026-02-16)
2
9
 
3
10
 
package/README.md CHANGED
@@ -1,53 +1,49 @@
1
- # codewiki-mcp
1
+ <div align="center">
2
2
 
3
- MCP server for [codewiki.google](https://codewiki.google) — search, fetch wiki docs, and ask questions about any open-source repository.
3
+ # 📚 codewiki-mcp
4
4
 
5
- [Русская версия](README.ru.md)
5
+ **MCP server for codewiki.google — search, fetch docs, and ask questions about any open-source repo**
6
6
 
7
- ## Features
7
+ [![CI](https://github.com/izzzzzi/codewiki-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/izzzzzi/codewiki-mcp/actions/workflows/ci.yml)
8
+ [![Release](https://github.com/izzzzzi/codewiki-mcp/actions/workflows/release.yml/badge.svg)](https://github.com/izzzzzi/codewiki-mcp/actions/workflows/release.yml)
9
+ [![npm version](https://img.shields.io/npm/v/codewiki-mcp.svg?style=flat&colorA=18181B&colorB=28CF8D)](https://www.npmjs.com/package/codewiki-mcp)
10
+ [![npm downloads](https://img.shields.io/npm/dm/codewiki-mcp.svg?style=flat&colorA=18181B&colorB=28CF8D)](https://www.npmjs.com/package/codewiki-mcp)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat&colorA=18181B&colorB=28CF8D)](LICENSE)
12
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue?style=flat&colorA=18181B&colorB=3178C6)](https://www.typescriptlang.org/)
13
+ [![Node.js](https://img.shields.io/badge/Node.js-ESM-green?style=flat&colorA=18181B&colorB=339933)](https://nodejs.org/)
8
14
 
9
- - **3 MCP tools**: search repos, fetch wiki content, ask questions with conversation history
10
- - **Multiple transports**: stdio (default), Streamable HTTP, SSE
11
- - **NLP repo resolution**: natural-language input → GitHub search → `owner/repo` (via wink-nlp)
12
- - **Retry with exponential backoff**: configurable retries for resilient API calls
13
- - **Structured errors**: typed error codes (`VALIDATION`, `RPC_FAIL`, `TIMEOUT`, `NLP_RESOLVE_FAIL`)
14
- - **Response metadata**: byte count and elapsed time on every response
15
- - **Docker support**: multi-stage Alpine build
16
- - **Claude Code skill**: prompt templates, workflow chains, error handling guide
15
+ [🇷🇺 Русский](README.ru.md) | **🇬🇧 English**
17
16
 
18
- ## Usage
17
+ <br />
19
18
 
20
- Prompts you can use in any MCP-compatible client:
19
+ *MCP server that connects any AI assistant to [codewiki.google](https://codewiki.google) — AI-generated wiki documentation for open-source repositories.*
21
20
 
22
- ```
23
- codewiki fetch how routing works in Next.js
24
- ```
21
+ </div>
25
22
 
26
- ```
27
- codewiki search state management libraries
28
- ```
23
+ ---
29
24
 
30
- ```
31
- codewiki ask how does React fiber reconciler work?
32
- ```
25
+ ## 📖 Overview
33
26
 
34
- Fetch complete documentation:
35
- ```
36
- codewiki fetch vercel/next.js
37
- codewiki fetch https://github.com/fastify/fastify
38
- ```
27
+ **codewiki-mcp** is a [Model Context Protocol](https://modelcontextprotocol.io/) 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.
39
28
 
40
- Get structured pages:
41
- ```
42
- codewiki fetch pages tailwindlabs/tailwindcss
43
- ```
29
+ ---
44
30
 
45
- Ask with natural language:
46
- ```
47
- codewiki ask fastify how to add authentication?
48
- ```
31
+ ## Features
32
+
33
+ | Feature | Description |
34
+ |---------|-------------|
35
+ | 🔍 **Search Repos** | Find repositories indexed by codewiki.google |
36
+ | 📄 **Fetch Wiki Docs** | Get full markdown or structured pages for any repo |
37
+ | 💬 **Ask Questions** | Natural-language Q&A with conversation history |
38
+ | 🧠 **NLP Repo Resolution** | Type naturally — wink-nlp extracts keywords and resolves to `owner/repo` |
39
+ | 📡 **Multiple Transports** | stdio (default), Streamable HTTP, SSE |
40
+ | 🔄 **Retry with Backoff** | Automatic retries with exponential backoff on 5xx errors |
41
+ | 🐳 **Docker Support** | Multi-stage Alpine build |
42
+ | 📊 **Response Metadata** | Byte count and elapsed time on every response |
49
43
 
50
- ## Quick Start
44
+ ---
45
+
46
+ ## 🚀 Quick Start
51
47
 
52
48
  ### Using npx (no install)
53
49
 
@@ -58,31 +54,26 @@ npx -y codewiki-mcp@latest
58
54
  ### From source
59
55
 
60
56
  ```bash
61
- git clone https://github.com/nicholasxwang/codewiki-mcp.git
57
+ git clone https://github.com/izzzzzi/codewiki-mcp.git
62
58
  cd codewiki-mcp
63
59
  npm install
64
60
  npm run build
65
61
  ```
66
62
 
67
- ### stdio (default)
63
+ ### Transports
68
64
 
69
65
  ```bash
66
+ # stdio (default)
70
67
  node dist/cli.js
71
- ```
72
68
 
73
- ### HTTP
74
-
75
- ```bash
69
+ # Streamable HTTP
76
70
  node dist/cli.js --http --port 3000
77
- ```
78
71
 
79
- ### SSE
80
-
81
- ```bash
72
+ # SSE
82
73
  node dist/cli.js --sse --port 3001
83
74
  ```
84
75
 
85
- ### Docker
76
+ ### 🐳 Docker
86
77
 
87
78
  ```bash
88
79
  docker build -t codewiki-mcp .
@@ -101,11 +92,14 @@ docker run -p 3000:3000 \
101
92
  codewiki-mcp --http
102
93
  ```
103
94
 
104
- ## MCP Client Configuration
95
+ ---
105
96
 
106
- ### Cursor
97
+ ## 🔧 MCP Client Configuration
107
98
 
108
- Add to `.cursor/mcp.json` (or use the included one):
99
+ <details>
100
+ <summary><b>Cursor</b></summary>
101
+
102
+ Add to `.cursor/mcp.json`:
109
103
 
110
104
  ```json
111
105
  {
@@ -118,7 +112,10 @@ Add to `.cursor/mcp.json` (or use the included one):
118
112
  }
119
113
  ```
120
114
 
121
- ### Claude Desktop
115
+ </details>
116
+
117
+ <details>
118
+ <summary><b>Claude Desktop</b></summary>
122
119
 
123
120
  Add to `claude_desktop_config.json`:
124
121
 
@@ -133,13 +130,19 @@ Add to `claude_desktop_config.json`:
133
130
  }
134
131
  ```
135
132
 
136
- ### Claude Code
133
+ </details>
134
+
135
+ <details>
136
+ <summary><b>Claude Code</b></summary>
137
137
 
138
138
  ```bash
139
139
  claude mcp add codewiki-mcp -- npx -y codewiki-mcp@latest
140
140
  ```
141
141
 
142
- ### Windsurf
142
+ </details>
143
+
144
+ <details>
145
+ <summary><b>Windsurf</b></summary>
143
146
 
144
147
  Add to your Windsurf MCP config:
145
148
 
@@ -154,7 +157,10 @@ Add to your Windsurf MCP config:
154
157
  }
155
158
  ```
156
159
 
157
- ### VS Code (Copilot)
160
+ </details>
161
+
162
+ <details>
163
+ <summary><b>VS Code (Copilot)</b></summary>
158
164
 
159
165
  Add to `.vscode/mcp.json`:
160
166
 
@@ -169,7 +175,10 @@ Add to `.vscode/mcp.json`:
169
175
  }
170
176
  ```
171
177
 
172
- ### Local development config
178
+ </details>
179
+
180
+ <details>
181
+ <summary><b>Local development</b></summary>
173
182
 
174
183
  ```json
175
184
  {
@@ -182,39 +191,83 @@ Add to `.vscode/mcp.json`:
182
191
  }
183
192
  ```
184
193
 
185
- ## MCP Tools
194
+ </details>
195
+
196
+ ---
197
+
198
+ ## 💡 Usage
199
+
200
+ Prompts you can use in any MCP-compatible client:
201
+
202
+ ```
203
+ codewiki fetch how routing works in Next.js
204
+ ```
205
+
206
+ ```
207
+ codewiki search state management libraries
208
+ ```
209
+
210
+ ```
211
+ codewiki ask how does React fiber reconciler work?
212
+ ```
213
+
214
+ Fetch complete documentation:
215
+
216
+ ```
217
+ codewiki fetch vercel/next.js
218
+ codewiki fetch https://github.com/fastify/fastify
219
+ ```
220
+
221
+ Get structured pages:
222
+
223
+ ```
224
+ codewiki fetch pages tailwindlabs/tailwindcss
225
+ ```
226
+
227
+ Ask with natural language:
228
+
229
+ ```
230
+ codewiki ask fastify how to add authentication?
231
+ ```
232
+
233
+ ---
186
234
 
187
- ### codewiki_search_repos
235
+ ## 🛠️ MCP Tools
236
+
237
+ ### 🔍 codewiki_search_repos
188
238
 
189
239
  Search repositories indexed by codewiki.google.
190
240
 
191
241
  | Parameter | Type | Required | Default | Description |
192
- |-----------|------|----------|---------|-------------|
193
- | `query` | string | yes | — | Search query |
194
- | `limit` | number | no | 10 | Max results (1–50) |
242
+ |-----------|------|:--------:|---------|-------------|
243
+ | `query` | string | | — | Search query |
244
+ | `limit` | number | | 10 | Max results (1–50) |
195
245
 
196
- ### codewiki_fetch_repo
246
+ ### 📄 codewiki_fetch_repo
197
247
 
198
248
  Fetch generated wiki content for a repository.
199
249
 
200
250
  | Parameter | Type | Required | Default | Description |
201
- |-----------|------|----------|---------|-------------|
202
- | `repo` | string | yes | — | `owner/repo`, GitHub URL, or natural-language query |
203
- | `mode` | string | no | `"aggregate"` | `"aggregate"` — full markdown; `"pages"` — structured JSON |
251
+ |-----------|------|:--------:|---------|-------------|
252
+ | `repo` | string | | — | `owner/repo`, GitHub URL, or natural-language query |
253
+ | `mode` | string | | `"aggregate"` | `"aggregate"` — full markdown; `"pages"` — structured JSON |
204
254
 
205
- ### codewiki_ask_repo
255
+ ### 💬 codewiki_ask_repo
206
256
 
207
257
  Ask a natural-language question about a repository.
208
258
 
209
259
  | Parameter | Type | Required | Default | Description |
210
- |-----------|------|----------|---------|-------------|
211
- | `repo` | string | yes | — | Repository identifier (same formats as fetch) |
212
- | `question` | string | yes | — | Question about the repo |
213
- | `history` | array | no | `[]` | Conversation history `[{role, content}]` (max 20) |
260
+ |-----------|------|:--------:|---------|-------------|
261
+ | `repo` | string | | — | Repository identifier (same formats as fetch) |
262
+ | `question` | string | | — | Question about the repo |
263
+ | `history` | array | | `[]` | Conversation history `[{role, content}]` (max 20) |
264
+
265
+ ---
214
266
 
215
- ## Response Format
267
+ ## 📊 Response Format
216
268
 
217
- ### Success — Search
269
+ <details>
270
+ <summary><b>✅ Success — Search</b></summary>
218
271
 
219
272
  ```json
220
273
  {
@@ -236,7 +289,10 @@ Ask a natural-language question about a repository.
236
289
  }
237
290
  ```
238
291
 
239
- ### Success — Fetch (pages mode)
292
+ </details>
293
+
294
+ <details>
295
+ <summary><b>✅ Success — Fetch (pages mode)</b></summary>
240
296
 
241
297
  ```json
242
298
  {
@@ -259,7 +315,10 @@ Ask a natural-language question about a repository.
259
315
  }
260
316
  ```
261
317
 
262
- ### Success — Ask
318
+ </details>
319
+
320
+ <details>
321
+ <summary><b>✅ Success — Ask</b></summary>
263
322
 
264
323
  ```json
265
324
  {
@@ -271,7 +330,10 @@ Ask a natural-language question about a repository.
271
330
  }
272
331
  ```
273
332
 
274
- ### Error Response
333
+ </details>
334
+
335
+ <details>
336
+ <summary><b>❌ Error Response</b></summary>
275
337
 
276
338
  ```json
277
339
  {
@@ -284,47 +346,20 @@ Ask a natural-language question about a repository.
284
346
  }
285
347
  ```
286
348
 
287
- ### Direct API Calls (HTTP transport)
349
+ Error codes: `VALIDATION`, `RPC_FAIL`, `TIMEOUT`, `NLP_RESOLVE_FAIL`
288
350
 
289
- ```bash
290
- # Start server
291
- node dist/cli.js --http --port 3000
351
+ </details>
292
352
 
293
- # Search
294
- curl -X POST http://localhost:3000/mcp \
295
- -H "Content-Type: application/json" \
296
- -d '{
297
- "jsonrpc": "2.0",
298
- "id": 1,
299
- "method": "tools/call",
300
- "params": {
301
- "name": "codewiki_search_repos",
302
- "arguments": { "query": "fastify", "limit": 5 }
303
- }
304
- }'
305
-
306
- # Fetch wiki
307
- curl -X POST http://localhost:3000/mcp \
308
- -H "Content-Type: application/json" \
309
- -d '{
310
- "jsonrpc": "2.0",
311
- "id": 2,
312
- "method": "tools/call",
313
- "params": {
314
- "name": "codewiki_fetch_repo",
315
- "arguments": { "repo": "fastify/fastify", "mode": "pages" }
316
- }
317
- }'
318
- ```
353
+ ---
319
354
 
320
- ## How It Works
355
+ ## ⚙️ How It Works
321
356
 
322
357
  ### Data Flow
323
358
 
324
359
  ```
325
- Claude Code → MCP protocol → codewiki-mcp → HTTPS → codewiki.google
326
-
327
- Claude Code ← MCP protocol ← codewiki-mcp ← JSON ← Google RPC API
360
+ AI Assistant → MCP protocol → codewiki-mcp → HTTPS → codewiki.google
361
+
362
+ AI Assistant ← MCP protocol ← codewiki-mcp ← JSON ← Google RPC API
328
363
  ```
329
364
 
330
365
  ### Google Batchexecute RPC
@@ -337,11 +372,14 @@ codewiki.google uses Google's internal **batchexecute** RPC format (not REST, no
337
372
  4. Parses `wrb.fr` frames and extracts the typed payload
338
373
 
339
374
  Each tool maps to an RPC ID:
340
- - `vyWDAf` — search
341
- - `VSX6ub` — fetch wiki
342
- - `EgIxfe` — ask question
343
375
 
344
- ### NLP Repo Resolution
376
+ | Tool | RPC ID |
377
+ |------|:------:|
378
+ | 🔍 Search | `vyWDAf` |
379
+ | 📄 Fetch | `VSX6ub` |
380
+ | 💬 Ask | `EgIxfe` |
381
+
382
+ ### 🧠 NLP Repo Resolution
345
383
 
346
384
  Users can type natural language instead of `owner/repo`:
347
385
 
@@ -353,20 +391,20 @@ Users can type natural language instead of `owner/repo`:
353
391
  → normalizeRepoInput("fastify/fastify") → URL for codewiki
354
392
  ```
355
393
 
356
- ### Retry with Exponential Backoff
394
+ ### 🔄 Retry with Exponential Backoff
357
395
 
358
- On 5xx errors or timeouts, the client retries automatically:
396
+ | Attempt | Delay |
397
+ |:-------:|------:|
398
+ | 0 | immediate |
399
+ | 1 | 250ms |
400
+ | 2 | 500ms |
401
+ | 3 | 1000ms |
359
402
 
360
- ```
361
- Attempt 0: immediate
362
- Attempt 1: after 250ms
363
- Attempt 2: after 500ms
364
- Attempt 3: after 1000ms
365
- ```
403
+ > 4xx errors (client errors) are never retried.
366
404
 
367
- 4xx errors (client errors) are never retried.
405
+ ---
368
406
 
369
- ## CLI
407
+ ## 🖥️ CLI
370
408
 
371
409
  ```
372
410
  codewiki-mcp [options]
@@ -379,7 +417,9 @@ Options:
379
417
  --help, -h Show help
380
418
  ```
381
419
 
382
- ## Configuration
420
+ ---
421
+
422
+ ## ⚡ Configuration
383
423
 
384
424
  Environment variables:
385
425
 
@@ -399,19 +439,9 @@ CODEWIKI_MAX_RETRIES=5
399
439
  GITHUB_TOKEN=ghp_your_token
400
440
  ```
401
441
 
402
- ## Development
442
+ ---
403
443
 
404
- ```bash
405
- npm run dev # stdio with tsx
406
- npm run dev:http # HTTP with tsx
407
- npm run dev:sse # SSE with tsx
408
- npm run typecheck # type check
409
- npm run test # run tests
410
- npm run test:watch # tests in watch mode
411
- npm run build # compile to dist/
412
- ```
413
-
414
- ## Project Structure
444
+ ## 📁 Project Structure
415
445
 
416
446
  ```
417
447
  src/
@@ -433,22 +463,31 @@ src/
433
463
  └── askRepo.ts # codewiki_ask_repo
434
464
  ```
435
465
 
436
- ## Troubleshooting
466
+ ---
437
467
 
438
- ### Permission Denied
468
+ ## Troubleshooting
469
+
470
+ <details>
471
+ <summary><b>Permission Denied</b></summary>
439
472
 
440
473
  ```bash
441
474
  chmod +x ./node_modules/.bin/codewiki-mcp
442
475
  ```
443
476
 
444
- ### Connection Refused (HTTP/SSE)
477
+ </details>
478
+
479
+ <details>
480
+ <summary><b>Connection Refused (HTTP/SSE)</b></summary>
445
481
 
446
482
  ```bash
447
483
  # Check if port is in use
448
484
  lsof -i :3000
449
485
  ```
450
486
 
451
- ### Timeout Errors
487
+ </details>
488
+
489
+ <details>
490
+ <summary><b>Timeout Errors</b></summary>
452
491
 
453
492
  For large repositories, increase the timeout:
454
493
 
@@ -456,7 +495,10 @@ For large repositories, increase the timeout:
456
495
  CODEWIKI_REQUEST_TIMEOUT=60000 node dist/cli.js
457
496
  ```
458
497
 
459
- ### NLP Resolution Fails
498
+ </details>
499
+
500
+ <details>
501
+ <summary><b>NLP Resolution Fails</b></summary>
460
502
 
461
503
  If natural-language input doesn't resolve, use explicit format:
462
504
 
@@ -469,7 +511,25 @@ https://github.com/fastify/fastify
469
511
 
470
512
  Set `GITHUB_TOKEN` to avoid GitHub API rate limits for unauthenticated requests.
471
513
 
472
- ## Contributing
514
+ </details>
515
+
516
+ ---
517
+
518
+ ## 🧑‍💻 Development
519
+
520
+ ```bash
521
+ npm run dev # stdio with tsx
522
+ npm run dev:http # HTTP with tsx
523
+ npm run dev:sse # SSE with tsx
524
+ npm run typecheck # type check
525
+ npm run test # run tests
526
+ npm run test:watch # tests in watch mode
527
+ npm run build # compile to dist/
528
+ ```
529
+
530
+ ---
531
+
532
+ ## 🤝 Contributing
473
533
 
474
534
  Contributions are welcome! Please:
475
535
 
@@ -479,6 +539,8 @@ Contributions are welcome! Please:
479
539
  4. Run `npm run typecheck && npm run test` before submitting
480
540
  5. Open a Pull Request
481
541
 
482
- ## License
542
+ ---
543
+
544
+ ## 📄 License
483
545
 
484
- MIT
546
+ [MIT](LICENSE) © codewiki-mcp contributors
package/README.ru.md CHANGED
@@ -1,53 +1,49 @@
1
- # codewiki-mcp
1
+ <div align="center">
2
2
 
3
- MCP-сервер для [codewiki.google](https://codewiki.google) — поиск, получение wiki-документации и вопросы по любому open-source репозиторию.
3
+ # 📚 codewiki-mcp
4
4
 
5
- [English version](README.md)
5
+ **MCP-сервер для codewiki.google — поиск, документация и вопросы по любому open-source репозиторию**
6
6
 
7
- ## Возможности
7
+ [![CI](https://github.com/izzzzzi/codewiki-mcp/actions/workflows/ci.yml/badge.svg)](https://github.com/izzzzzi/codewiki-mcp/actions/workflows/ci.yml)
8
+ [![Release](https://github.com/izzzzzi/codewiki-mcp/actions/workflows/release.yml/badge.svg)](https://github.com/izzzzzi/codewiki-mcp/actions/workflows/release.yml)
9
+ [![npm version](https://img.shields.io/npm/v/codewiki-mcp.svg?style=flat&colorA=18181B&colorB=28CF8D)](https://www.npmjs.com/package/codewiki-mcp)
10
+ [![npm downloads](https://img.shields.io/npm/dm/codewiki-mcp.svg?style=flat&colorA=18181B&colorB=28CF8D)](https://www.npmjs.com/package/codewiki-mcp)
11
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg?style=flat&colorA=18181B&colorB=28CF8D)](LICENSE)
12
+ [![TypeScript](https://img.shields.io/badge/TypeScript-5.x-blue?style=flat&colorA=18181B&colorB=3178C6)](https://www.typescriptlang.org/)
13
+ [![Node.js](https://img.shields.io/badge/Node.js-ESM-green?style=flat&colorA=18181B&colorB=339933)](https://nodejs.org/)
8
14
 
9
- - **3 MCP-инструмента**: поиск репозиториев, получение wiki-контента, вопросы с историей диалога
10
- - **Множественные транспорты**: stdio (по умолчанию), Streamable HTTP, SSE
11
- - **NLP-резолвинг репозиториев**: естественный язык → поиск по GitHub → `owner/repo` (через wink-nlp)
12
- - **Retry с exponential backoff**: настраиваемые повторные запросы
13
- - **Структурированные ошибки**: типизированные коды (`VALIDATION`, `RPC_FAIL`, `TIMEOUT`, `NLP_RESOLVE_FAIL`)
14
- - **Метаданные ответов**: размер в байтах и время выполнения в каждом ответе
15
- - **Docker**: multi-stage Alpine-сборка
16
- - **Claude Code skill**: промпт-шаблоны, воркфлоу-цепочки, гайд по обработке ошибок
15
+ **🇷🇺 Русский** | [🇬🇧 English](README.md)
17
16
 
18
- ## Использование
17
+ <br />
19
18
 
20
- Промпты, которые можно использовать в любом MCP-совместимом клиенте:
19
+ *MCP-сервер, подключающий любого AI-ассистента к [codewiki.google](https://codewiki.google) сервису генерации wiki-документации для open-source репозиториев.*
21
20
 
22
- ```
23
- codewiki fetch как устроен роутинг в Next.js
24
- ```
21
+ </div>
25
22
 
26
- ```
27
- codewiki search библиотеки для управления состоянием
28
- ```
23
+ ---
29
24
 
30
- ```
31
- codewiki ask как работает fiber reconciler в React?
32
- ```
25
+ ## 📖 Обзор
33
26
 
34
- Получить полную документацию:
35
- ```
36
- codewiki fetch vercel/next.js
37
- codewiki fetch https://github.com/fastify/fastify
38
- ```
27
+ **codewiki-mcp** — это [Model Context Protocol](https://modelcontextprotocol.io/) сервер, который даёт AI-ассистентам доступ к **codewiki.google** — сервису, генерирующему подробную wiki-документацию для любого GitHub-репозитория. Ищите репозитории, получайте полную документацию или задавайте вопросы на естественном языке — всё через MCP.
39
28
 
40
- Получить структурированные страницы:
41
- ```
42
- codewiki fetch pages tailwindlabs/tailwindcss
43
- ```
29
+ ---
44
30
 
45
- Задать вопрос:
46
- ```
47
- codewiki ask fastify как добавить аутентификацию?
48
- ```
31
+ ## ✨ Возможности
49
32
 
50
- ## Быстрый старт
33
+ | Фича | Описание |
34
+ |------|----------|
35
+ | 🔍 **Поиск репозиториев** | Поиск по индексу codewiki.google |
36
+ | 📄 **Получение wiki-документации** | Полный markdown или структурированные страницы |
37
+ | 💬 **Вопросы по репозиторию** | Q&A на естественном языке с историей диалога |
38
+ | 🧠 **NLP-резолвинг** | Пишите на естественном языке — wink-nlp извлечёт ключевые слова и найдёт `owner/repo` |
39
+ | 📡 **Множественные транспорты** | stdio (по умолчанию), Streamable HTTP, SSE |
40
+ | 🔄 **Retry с backoff** | Автоматические повторы с exponential backoff при 5xx ошибках |
41
+ | 🐳 **Docker** | Multi-stage Alpine-сборка |
42
+ | 📊 **Метаданные ответов** | Размер в байтах и время выполнения в каждом ответе |
43
+
44
+ ---
45
+
46
+ ## 🚀 Быстрый старт
51
47
 
52
48
  ### Через npx (без установки)
53
49
 
@@ -58,31 +54,26 @@ npx -y codewiki-mcp@latest
58
54
  ### Из исходников
59
55
 
60
56
  ```bash
61
- git clone https://github.com/nicholasxwang/codewiki-mcp.git
57
+ git clone https://github.com/izzzzzi/codewiki-mcp.git
62
58
  cd codewiki-mcp
63
59
  npm install
64
60
  npm run build
65
61
  ```
66
62
 
67
- ### stdio (по умолчанию)
63
+ ### Транспорты
68
64
 
69
65
  ```bash
66
+ # stdio (по умолчанию)
70
67
  node dist/cli.js
71
- ```
72
-
73
- ### HTTP
74
68
 
75
- ```bash
69
+ # Streamable HTTP
76
70
  node dist/cli.js --http --port 3000
77
- ```
78
-
79
- ### SSE
80
71
 
81
- ```bash
72
+ # SSE
82
73
  node dist/cli.js --sse --port 3001
83
74
  ```
84
75
 
85
- ### Docker
76
+ ### 🐳 Docker
86
77
 
87
78
  ```bash
88
79
  docker build -t codewiki-mcp .
@@ -101,11 +92,14 @@ docker run -p 3000:3000 \
101
92
  codewiki-mcp --http
102
93
  ```
103
94
 
104
- ## Настройка MCP-клиентов
95
+ ---
96
+
97
+ ## 🔧 Настройка MCP-клиентов
105
98
 
106
- ### Cursor
99
+ <details>
100
+ <summary><b>Cursor</b></summary>
107
101
 
108
- Добавьте в `.cursor/mcp.json` (или используйте встроенный):
102
+ Добавьте в `.cursor/mcp.json`:
109
103
 
110
104
  ```json
111
105
  {
@@ -118,7 +112,10 @@ docker run -p 3000:3000 \
118
112
  }
119
113
  ```
120
114
 
121
- ### Claude Desktop
115
+ </details>
116
+
117
+ <details>
118
+ <summary><b>Claude Desktop</b></summary>
122
119
 
123
120
  Добавьте в `claude_desktop_config.json`:
124
121
 
@@ -133,13 +130,19 @@ docker run -p 3000:3000 \
133
130
  }
134
131
  ```
135
132
 
136
- ### Claude Code
133
+ </details>
134
+
135
+ <details>
136
+ <summary><b>Claude Code</b></summary>
137
137
 
138
138
  ```bash
139
139
  claude mcp add codewiki-mcp -- npx -y codewiki-mcp@latest
140
140
  ```
141
141
 
142
- ### Windsurf
142
+ </details>
143
+
144
+ <details>
145
+ <summary><b>Windsurf</b></summary>
143
146
 
144
147
  Добавьте в конфигурацию Windsurf MCP:
145
148
 
@@ -154,7 +157,10 @@ claude mcp add codewiki-mcp -- npx -y codewiki-mcp@latest
154
157
  }
155
158
  ```
156
159
 
157
- ### VS Code (Copilot)
160
+ </details>
161
+
162
+ <details>
163
+ <summary><b>VS Code (Copilot)</b></summary>
158
164
 
159
165
  Добавьте в `.vscode/mcp.json`:
160
166
 
@@ -169,7 +175,10 @@ claude mcp add codewiki-mcp -- npx -y codewiki-mcp@latest
169
175
  }
170
176
  ```
171
177
 
172
- ### Локальная разработка
178
+ </details>
179
+
180
+ <details>
181
+ <summary><b>Локальная разработка</b></summary>
173
182
 
174
183
  ```json
175
184
  {
@@ -182,39 +191,83 @@ claude mcp add codewiki-mcp -- npx -y codewiki-mcp@latest
182
191
  }
183
192
  ```
184
193
 
185
- ## MCP-инструменты
194
+ </details>
195
+
196
+ ---
197
+
198
+ ## 💡 Использование
199
+
200
+ Промпты для любого MCP-совместимого клиента:
201
+
202
+ ```
203
+ codewiki fetch как устроен роутинг в Next.js
204
+ ```
205
+
206
+ ```
207
+ codewiki search библиотеки для управления состоянием
208
+ ```
209
+
210
+ ```
211
+ codewiki ask как работает fiber reconciler в React?
212
+ ```
213
+
214
+ Получить полную документацию:
215
+
216
+ ```
217
+ codewiki fetch vercel/next.js
218
+ codewiki fetch https://github.com/fastify/fastify
219
+ ```
220
+
221
+ Получить структурированные страницы:
222
+
223
+ ```
224
+ codewiki fetch pages tailwindlabs/tailwindcss
225
+ ```
226
+
227
+ Задать вопрос:
228
+
229
+ ```
230
+ codewiki ask fastify как добавить аутентификацию?
231
+ ```
232
+
233
+ ---
234
+
235
+ ## 🛠️ MCP-инструменты
186
236
 
187
- ### codewiki_search_repos
237
+ ### 🔍 codewiki_search_repos
188
238
 
189
239
  Поиск репозиториев, проиндексированных codewiki.google.
190
240
 
191
241
  | Параметр | Тип | Обязательный | По умолчанию | Описание |
192
- |----------|-----|--------------|--------------|----------|
193
- | `query` | string | да | — | Поисковый запрос |
194
- | `limit` | number | нет | 10 | Макс. результатов (1–50) |
242
+ |----------|-----|:------------:|--------------|----------|
243
+ | `query` | string | | — | Поисковый запрос |
244
+ | `limit` | number | | 10 | Макс. результатов (1–50) |
195
245
 
196
- ### codewiki_fetch_repo
246
+ ### 📄 codewiki_fetch_repo
197
247
 
198
248
  Получение сгенерированного wiki-контента для репозитория.
199
249
 
200
250
  | Параметр | Тип | Обязательный | По умолчанию | Описание |
201
- |----------|-----|--------------|--------------|----------|
202
- | `repo` | string | да | — | `owner/repo`, URL на GitHub или запрос на естественном языке |
203
- | `mode` | string | нет | `"aggregate"` | `"aggregate"` — полный markdown; `"pages"` — структурированный JSON |
251
+ |----------|-----|:------------:|--------------|----------|
252
+ | `repo` | string | | — | `owner/repo`, URL на GitHub или запрос на естественном языке |
253
+ | `mode` | string | | `"aggregate"` | `"aggregate"` — полный markdown; `"pages"` — структурированный JSON |
204
254
 
205
- ### codewiki_ask_repo
255
+ ### 💬 codewiki_ask_repo
206
256
 
207
257
  Вопрос на естественном языке о репозитории.
208
258
 
209
259
  | Параметр | Тип | Обязательный | По умолчанию | Описание |
210
- |----------|-----|--------------|--------------|----------|
211
- | `repo` | string | да | — | Идентификатор репозитория (те же форматы, что и fetch) |
212
- | `question` | string | да | — | Вопрос о репозитории |
213
- | `history` | array | нет | `[]` | История диалога `[{role, content}]` (макс. 20) |
260
+ |----------|-----|:------------:|--------------|----------|
261
+ | `repo` | string | | — | Идентификатор репозитория (те же форматы, что и fetch) |
262
+ | `question` | string | | — | Вопрос о репозитории |
263
+ | `history` | array | | `[]` | История диалога `[{role, content}]` (макс. 20) |
214
264
 
215
- ## Формат ответов
265
+ ---
216
266
 
217
- ### Успех Поиск
267
+ ## 📊 Формат ответов
268
+
269
+ <details>
270
+ <summary><b>✅ Успех — Поиск</b></summary>
218
271
 
219
272
  ```json
220
273
  {
@@ -236,7 +289,10 @@ claude mcp add codewiki-mcp -- npx -y codewiki-mcp@latest
236
289
  }
237
290
  ```
238
291
 
239
- ### Успех — Fetch (режим pages)
292
+ </details>
293
+
294
+ <details>
295
+ <summary><b>✅ Успех — Fetch (режим pages)</b></summary>
240
296
 
241
297
  ```json
242
298
  {
@@ -259,7 +315,10 @@ claude mcp add codewiki-mcp -- npx -y codewiki-mcp@latest
259
315
  }
260
316
  ```
261
317
 
262
- ### Успех — Ask
318
+ </details>
319
+
320
+ <details>
321
+ <summary><b>✅ Успех — Ask</b></summary>
263
322
 
264
323
  ```json
265
324
  {
@@ -271,7 +330,10 @@ claude mcp add codewiki-mcp -- npx -y codewiki-mcp@latest
271
330
  }
272
331
  ```
273
332
 
274
- ### Ответ с ошибкой
333
+ </details>
334
+
335
+ <details>
336
+ <summary><b>❌ Ответ с ошибкой</b></summary>
275
337
 
276
338
  ```json
277
339
  {
@@ -284,47 +346,20 @@ claude mcp add codewiki-mcp -- npx -y codewiki-mcp@latest
284
346
  }
285
347
  ```
286
348
 
287
- ### Прямые API-вызовы (HTTP-транспорт)
349
+ Коды ошибок: `VALIDATION`, `RPC_FAIL`, `TIMEOUT`, `NLP_RESOLVE_FAIL`
288
350
 
289
- ```bash
290
- # Запустить сервер
291
- node dist/cli.js --http --port 3000
351
+ </details>
292
352
 
293
- # Поиск
294
- curl -X POST http://localhost:3000/mcp \
295
- -H "Content-Type: application/json" \
296
- -d '{
297
- "jsonrpc": "2.0",
298
- "id": 1,
299
- "method": "tools/call",
300
- "params": {
301
- "name": "codewiki_search_repos",
302
- "arguments": { "query": "fastify", "limit": 5 }
303
- }
304
- }'
305
-
306
- # Получить wiki
307
- curl -X POST http://localhost:3000/mcp \
308
- -H "Content-Type: application/json" \
309
- -d '{
310
- "jsonrpc": "2.0",
311
- "id": 2,
312
- "method": "tools/call",
313
- "params": {
314
- "name": "codewiki_fetch_repo",
315
- "arguments": { "repo": "fastify/fastify", "mode": "pages" }
316
- }
317
- }'
318
- ```
353
+ ---
319
354
 
320
- ## Как это работает
355
+ ## ⚙️ Как это работает
321
356
 
322
357
  ### Поток данных
323
358
 
324
359
  ```
325
- Claude Code → MCP протокол → codewiki-mcp → HTTPS → codewiki.google
326
-
327
- Claude Code ← MCP протокол ← codewiki-mcp ← JSON ← Google RPC API
360
+ AI-ассистент → MCP протокол → codewiki-mcp → HTTPS → codewiki.google
361
+
362
+ AI-ассистент ← MCP протокол ← codewiki-mcp ← JSON ← Google RPC API
328
363
  ```
329
364
 
330
365
  ### Google Batchexecute RPC
@@ -337,11 +372,14 @@ codewiki.google использует внутренний Google-формат AP
337
372
  4. Парсит `wrb.fr`-фреймы и извлекает типизированный payload
338
373
 
339
374
  Каждый инструмент использует свой RPC ID:
340
- - `vyWDAf` — поиск
341
- - `VSX6ub` — получение wiki
342
- - `EgIxfe` — вопрос-ответ
343
375
 
344
- ### NLP-резолвинг репозиториев
376
+ | Инструмент | RPC ID |
377
+ |------------|:------:|
378
+ | 🔍 Поиск | `vyWDAf` |
379
+ | 📄 Fetch | `VSX6ub` |
380
+ | 💬 Вопрос | `EgIxfe` |
381
+
382
+ ### 🧠 NLP-резолвинг репозиториев
345
383
 
346
384
  Пользователь может написать не только `owner/repo`, но и текст на естественном языке:
347
385
 
@@ -353,20 +391,20 @@ codewiki.google использует внутренний Google-формат AP
353
391
  → normalizeRepoInput("fastify/fastify") → URL для codewiki
354
392
  ```
355
393
 
356
- ### Retry с exponential backoff
394
+ ### 🔄 Retry с exponential backoff
357
395
 
358
- При 5xx ошибках или таймаутах клиент автоматически повторяет запрос:
396
+ | Попытка | Задержка |
397
+ |:-------:|---------:|
398
+ | 0 | сразу |
399
+ | 1 | 250мс |
400
+ | 2 | 500мс |
401
+ | 3 | 1000мс |
359
402
 
360
- ```
361
- Попытка 0: сразу
362
- Попытка 1: через 250мс
363
- Попытка 2: через 500мс
364
- Попытка 3: через 1000мс
365
- ```
403
+ > На 4xx ошибки (клиентские) retry не делается — бессмысленно.
366
404
 
367
- На 4xx ошибки (клиентские) retry не делается — бессмысленно.
405
+ ---
368
406
 
369
- ## CLI
407
+ ## 🖥️ CLI
370
408
 
371
409
  ```
372
410
  codewiki-mcp [опции]
@@ -379,7 +417,9 @@ codewiki-mcp [опции]
379
417
  --help, -h Показать справку
380
418
  ```
381
419
 
382
- ## Конфигурация
420
+ ---
421
+
422
+ ## ⚡ Конфигурация
383
423
 
384
424
  Переменные окружения:
385
425
 
@@ -399,19 +439,9 @@ CODEWIKI_MAX_RETRIES=5
399
439
  GITHUB_TOKEN=ghp_your_token
400
440
  ```
401
441
 
402
- ## Разработка
442
+ ---
403
443
 
404
- ```bash
405
- npm run dev # stdio через tsx
406
- npm run dev:http # HTTP через tsx
407
- npm run dev:sse # SSE через tsx
408
- npm run typecheck # проверка типов
409
- npm run test # запуск тестов
410
- npm run test:watch # тесты в watch-режиме
411
- npm run build # сборка в dist/
412
- ```
413
-
414
- ## Структура проекта
444
+ ## 📁 Структура проекта
415
445
 
416
446
  ```
417
447
  src/
@@ -433,22 +463,31 @@ src/
433
463
  └── askRepo.ts # codewiki_ask_repo
434
464
  ```
435
465
 
436
- ## Решение проблем
466
+ ---
437
467
 
438
- ### Permission Denied
468
+ ## Решение проблем
469
+
470
+ <details>
471
+ <summary><b>Permission Denied</b></summary>
439
472
 
440
473
  ```bash
441
474
  chmod +x ./node_modules/.bin/codewiki-mcp
442
475
  ```
443
476
 
444
- ### Connection Refused (HTTP/SSE)
477
+ </details>
478
+
479
+ <details>
480
+ <summary><b>Connection Refused (HTTP/SSE)</b></summary>
445
481
 
446
482
  ```bash
447
483
  # Проверить, занят ли порт
448
484
  lsof -i :3000
449
485
  ```
450
486
 
451
- ### Ошибки таймаута
487
+ </details>
488
+
489
+ <details>
490
+ <summary><b>Ошибки таймаута</b></summary>
452
491
 
453
492
  Для больших репозиториев увеличьте таймаут:
454
493
 
@@ -456,7 +495,10 @@ lsof -i :3000
456
495
  CODEWIKI_REQUEST_TIMEOUT=60000 node dist/cli.js
457
496
  ```
458
497
 
459
- ### NLP-резолвинг не работает
498
+ </details>
499
+
500
+ <details>
501
+ <summary><b>NLP-резолвинг не работает</b></summary>
460
502
 
461
503
  Если естественный язык не резолвится, используйте явный формат:
462
504
 
@@ -469,7 +511,25 @@ https://github.com/fastify/fastify
469
511
 
470
512
  Установите `GITHUB_TOKEN`, чтобы избежать лимитов GitHub API для неаутентифицированных запросов.
471
513
 
472
- ## Участие в разработке
514
+ </details>
515
+
516
+ ---
517
+
518
+ ## 🧑‍💻 Разработка
519
+
520
+ ```bash
521
+ npm run dev # stdio через tsx
522
+ npm run dev:http # HTTP через tsx
523
+ npm run dev:sse # SSE через tsx
524
+ npm run typecheck # проверка типов
525
+ npm run test # запуск тестов
526
+ npm run test:watch # тесты в watch-режиме
527
+ npm run build # сборка в dist/
528
+ ```
529
+
530
+ ---
531
+
532
+ ## 🤝 Участие в разработке
473
533
 
474
534
  Мы приветствуем вклад! Пожалуйста:
475
535
 
@@ -479,6 +539,8 @@ https://github.com/fastify/fastify
479
539
  4. Запустите `npm run typecheck && npm run test` перед отправкой
480
540
  5. Откройте Pull Request
481
541
 
482
- ## Лицензия
542
+ ---
543
+
544
+ ## 📄 Лицензия
483
545
 
484
- MIT
546
+ [MIT](LICENSE) © codewiki-mcp contributors
package/dist/schemas.d.ts CHANGED
@@ -3,48 +3,22 @@ export type { ErrorEnvelope } from './lib/errors.js';
3
3
  export declare const SearchReposInput: z.ZodObject<{
4
4
  query: z.ZodString;
5
5
  limit: z.ZodDefault<z.ZodNumber>;
6
- }, "strip", z.ZodTypeAny, {
7
- query: string;
8
- limit: number;
9
- }, {
10
- query: string;
11
- limit?: number | undefined;
12
- }>;
6
+ }, z.core.$strip>;
13
7
  export declare const FetchRepoInput: z.ZodObject<{
14
8
  repo: z.ZodString;
15
- mode: z.ZodDefault<z.ZodEnum<["aggregate", "pages"]>>;
16
- }, "strip", z.ZodTypeAny, {
17
- repo: string;
18
- mode: "aggregate" | "pages";
19
- }, {
20
- repo: string;
21
- mode?: "aggregate" | "pages" | undefined;
22
- }>;
9
+ mode: z.ZodDefault<z.ZodEnum<{
10
+ aggregate: "aggregate";
11
+ pages: "pages";
12
+ }>>;
13
+ }, z.core.$strip>;
23
14
  export declare const AskRepoInput: z.ZodObject<{
24
15
  repo: z.ZodString;
25
16
  question: z.ZodString;
26
17
  history: z.ZodOptional<z.ZodArray<z.ZodObject<{
27
- role: z.ZodEnum<["user", "assistant"]>;
18
+ role: z.ZodEnum<{
19
+ user: "user";
20
+ assistant: "assistant";
21
+ }>;
28
22
  content: z.ZodString;
29
- }, "strip", z.ZodTypeAny, {
30
- role: "user" | "assistant";
31
- content: string;
32
- }, {
33
- role: "user" | "assistant";
34
- content: string;
35
- }>, "many">>;
36
- }, "strip", z.ZodTypeAny, {
37
- repo: string;
38
- question: string;
39
- history?: {
40
- role: "user" | "assistant";
41
- content: string;
42
- }[] | undefined;
43
- }, {
44
- repo: string;
45
- question: string;
46
- history?: {
47
- role: "user" | "assistant";
48
- content: string;
49
- }[] | undefined;
50
- }>;
23
+ }, z.core.$strip>>>;
24
+ }, z.core.$strip>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codewiki-mcp",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "MCP server for codewiki.google",
5
5
  "type": "module",
6
6
  "bin": {
@@ -22,16 +22,16 @@
22
22
  "@modelcontextprotocol/sdk": "^1.19.0",
23
23
  "wink-eng-lite-web-model": "^1.8.1",
24
24
  "wink-nlp": "^2.4.0",
25
- "zod": "^3.24.2"
25
+ "zod": "^4.3.6"
26
26
  },
27
27
  "devDependencies": {
28
28
  "@semantic-release/changelog": "^6.0.3",
29
29
  "@semantic-release/git": "^10.0.1",
30
30
  "@semantic-release/github": "^12.0.6",
31
- "@types/node": "^22.13.9",
31
+ "@types/node": "^25.2.3",
32
32
  "semantic-release": "^25.0.3",
33
33
  "tsx": "^4.19.3",
34
34
  "typescript": "^5.8.2",
35
- "vitest": "^3.2.4"
35
+ "vitest": "^4.0.18"
36
36
  }
37
37
  }