codewiki-mcp 1.0.0 β†’ 1.1.0

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.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 codewiki-mcp contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
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