bun-mcp-server 3.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.md ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Zhou Rui
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 ADDED
@@ -0,0 +1,116 @@
1
+ # <img src="https://bun.com/logo.svg" height="20"> Bun Documentation MCP
2
+
3
+ A Model Context Protocol (MCP) server that provides intelligent access to [Bun](https://bun.com) documentation. Enables AI assistants to search, read, and query Bun docs with full-text search capabilities.
4
+
5
+ ## ✨ Features
6
+
7
+ - **📚 Full-text search**: SQLite FTS5 with BM25 ranking for fast, relevant search results
8
+ - **🔍 Regex search**: JavaScript regex support for precise pattern matching
9
+ - **📖 Document reading**: Access complete markdown documentation by slug
10
+ - **📑 Document listing**: Browse available docs by category
11
+ - **🔄 Version-matched**: Automatically downloads docs matching your Bun version from GitHub
12
+ - **⚡ Fast local caching**: Docs cached in `~/.cache/bun-mcp-server/` with SQLite search index
13
+ - **🤖 AI-optimized**: Structured for AI assistants with relevance scoring and context snippets
14
+
15
+ ## 🛠️ Available Tools
16
+
17
+ ### `search_bun_docs`
18
+
19
+ Full-text search using SQLite FTS5 with Porter stemming ("running" matches "run", "runs", etc.)
20
+
21
+ - **Parameters**: `query` (string), optional `path` filter, optional `limit`
22
+ - **Returns**: Ranked results with title, score, and highlighted snippet
23
+
24
+ ### `grep_bun_docs`
25
+
26
+ Regex pattern matching for exact searches
27
+
28
+ - **Parameters**: `pattern` (regex), optional `path` filter, optional `flags`, optional `limit`
29
+ - **Returns**: Matches with context snippets
30
+
31
+ ### `read_bun_doc`
32
+
33
+ Read complete markdown documentation
34
+
35
+ - **Parameters**: `path` (slug like `runtime/bun-apis` or `guides/http`)
36
+ - **Returns**: Full markdown content
37
+
38
+ ### `list_bun_docs`
39
+
40
+ Browse available documentation
41
+
42
+ - **Parameters**: optional `category` filter (e.g., `api/`, `guides/`), optional `limit`
43
+ - **Returns**: List of documents with URIs and descriptions
44
+
45
+ ## 🚀 Installation
46
+
47
+ ### Via Claude Code (recommended)
48
+
49
+ ```bash
50
+ claude mcp add bun-docs bunx bun-mcp-server
51
+ ```
52
+
53
+ ### Via npx/bunx
54
+
55
+ ```bash
56
+ bunx bun-mcp-server
57
+ ```
58
+
59
+ ### Manual MCP Configuration
60
+
61
+ ```json
62
+ {
63
+ "mcpServers": {
64
+ "bun-docs": {
65
+ "type": "stdio",
66
+ "command": "bunx",
67
+ "args": ["bun-mcp-server"],
68
+ "env": {}
69
+ }
70
+ }
71
+ }
72
+ ```
73
+
74
+ ## 🔧 Development
75
+
76
+ ### Setup
77
+
78
+ ```bash
79
+ bun install
80
+ ```
81
+
82
+ ### Build
83
+
84
+ ```bash
85
+ bun run build
86
+ ```
87
+
88
+ ### Test
89
+
90
+ ```bash
91
+ bun run test # Run all tests
92
+ bun run test:e2e # Run E2E tests only
93
+ ```
94
+
95
+ ### Lint & Type Check
96
+
97
+ ```bash
98
+ bun run lint
99
+ bun run typecheck
100
+ ```
101
+
102
+ ## 📁 How It Works
103
+
104
+ 1. **First run**: Downloads Bun docs from GitHub (matching your Bun version) using sparse checkout
105
+ 2. **Indexing**: Builds SQLite FTS5 search index with BM25 ranking
106
+ 3. **Caching**: Stores docs and search index in `~/.cache/bun-doc-mcp/{version}/`
107
+ 4. **Subsequent runs**: Uses cached docs (re-downloads if corrupted)
108
+
109
+ ## 📝 Usage Examples
110
+
111
+ Once installed, ask your AI assistant:
112
+
113
+ - "Search for WebSocket server examples" → uses `search_bun_docs`
114
+ - "Show me the Bun.serve() API documentation" → uses `read_bun_doc`
115
+ - "Find all examples using SQLite" → uses `grep_bun_docs`
116
+ - "List all available guides" → uses `list_bun_docs`