docusaurus-mcp 1.0.0__tar.gz
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.
- docusaurus_mcp-1.0.0/LICENSE +21 -0
- docusaurus_mcp-1.0.0/PKG-INFO +261 -0
- docusaurus_mcp-1.0.0/README.md +238 -0
- docusaurus_mcp-1.0.0/pyproject.toml +39 -0
- docusaurus_mcp-1.0.0/setup.cfg +4 -0
- docusaurus_mcp-1.0.0/src/docusaurus_mcp/__init__.py +6 -0
- docusaurus_mcp-1.0.0/src/docusaurus_mcp/__main__.py +16 -0
- docusaurus_mcp-1.0.0/src/docusaurus_mcp/server.py +560 -0
- docusaurus_mcp-1.0.0/src/docusaurus_mcp.egg-info/PKG-INFO +261 -0
- docusaurus_mcp-1.0.0/src/docusaurus_mcp.egg-info/SOURCES.txt +12 -0
- docusaurus_mcp-1.0.0/src/docusaurus_mcp.egg-info/dependency_links.txt +1 -0
- docusaurus_mcp-1.0.0/src/docusaurus_mcp.egg-info/entry_points.txt +2 -0
- docusaurus_mcp-1.0.0/src/docusaurus_mcp.egg-info/requires.txt +4 -0
- docusaurus_mcp-1.0.0/src/docusaurus_mcp.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 mytsx
|
|
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.
|
|
@@ -0,0 +1,261 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: docusaurus-mcp
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Generic MCP server for any Docusaurus documentation site - search, browse, and read docs
|
|
5
|
+
Author: mytsx
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/mytsx/mcp-servers
|
|
8
|
+
Project-URL: Repository, https://github.com/mytsx/mcp-servers
|
|
9
|
+
Project-URL: Issues, https://github.com/mytsx/mcp-servers/issues
|
|
10
|
+
Keywords: mcp,model-context-protocol,docusaurus,documentation,search
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Requires-Python: >=3.10
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
License-File: LICENSE
|
|
18
|
+
Requires-Dist: mcp[cli]>=1.0.0
|
|
19
|
+
Requires-Dist: httpx>=0.27.0
|
|
20
|
+
Requires-Dist: markdownify>=0.14.1
|
|
21
|
+
Requires-Dist: beautifulsoup4>=4.12.0
|
|
22
|
+
Dynamic: license-file
|
|
23
|
+
|
|
24
|
+
# Docusaurus MCP Server
|
|
25
|
+
|
|
26
|
+
[](https://python.org)
|
|
27
|
+
[](https://modelcontextprotocol.io)
|
|
28
|
+
[](LICENSE)
|
|
29
|
+
|
|
30
|
+
Generic MCP server for any [Docusaurus](https://docusaurus.io) documentation site. Point it at a URL and get full-text search, browsing, and content extraction — works with both static HTML and SPA-only builds.
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- **Auto SPA Detection** — Detects SPA-only sites and falls back to webpack chunk parsing
|
|
35
|
+
- **Full-Text Search** — Search across titles, descriptions, and page content
|
|
36
|
+
- **Category Browsing** — Navigate the doc structure by categories
|
|
37
|
+
- **Markdown Extraction** — Returns clean markdown from any doc page
|
|
38
|
+
- **Sitemap Support** — Automatically discovers all pages via sitemap.xml
|
|
39
|
+
|
|
40
|
+
## Quick Start
|
|
41
|
+
|
|
42
|
+
### Claude Code
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
claude mcp add docusaurus \
|
|
46
|
+
-e DOCUSAURUS_URL="https://docs.example.com" \
|
|
47
|
+
-- uvx docusaurus-mcp
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Claude Desktop
|
|
51
|
+
|
|
52
|
+
Add to your config file:
|
|
53
|
+
|
|
54
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
55
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
56
|
+
|
|
57
|
+
```json
|
|
58
|
+
{
|
|
59
|
+
"mcpServers": {
|
|
60
|
+
"docusaurus": {
|
|
61
|
+
"command": "uvx",
|
|
62
|
+
"args": ["docusaurus-mcp"],
|
|
63
|
+
"env": {
|
|
64
|
+
"DOCUSAURUS_URL": "https://docs.example.com"
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Cursor
|
|
72
|
+
|
|
73
|
+
Add to `~/.cursor/mcp.json`:
|
|
74
|
+
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"mcpServers": {
|
|
78
|
+
"docusaurus": {
|
|
79
|
+
"command": "uvx",
|
|
80
|
+
"args": ["docusaurus-mcp"],
|
|
81
|
+
"env": {
|
|
82
|
+
"DOCUSAURUS_URL": "https://docs.example.com"
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
### Windsurf
|
|
90
|
+
|
|
91
|
+
Add to Windsurf MCP config:
|
|
92
|
+
|
|
93
|
+
```json
|
|
94
|
+
{
|
|
95
|
+
"mcpServers": {
|
|
96
|
+
"docusaurus": {
|
|
97
|
+
"command": "uvx",
|
|
98
|
+
"args": ["docusaurus-mcp"],
|
|
99
|
+
"env": {
|
|
100
|
+
"DOCUSAURUS_URL": "https://docs.example.com"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### VS Code
|
|
108
|
+
|
|
109
|
+
Add to your VS Code settings (JSON):
|
|
110
|
+
|
|
111
|
+
```json
|
|
112
|
+
"mcp": {
|
|
113
|
+
"servers": {
|
|
114
|
+
"docusaurus": {
|
|
115
|
+
"type": "stdio",
|
|
116
|
+
"command": "uvx",
|
|
117
|
+
"args": ["docusaurus-mcp"],
|
|
118
|
+
"env": {
|
|
119
|
+
"DOCUSAURUS_URL": "https://docs.example.com"
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
### Gemini CLI
|
|
127
|
+
|
|
128
|
+
Add to `~/.gemini/settings.json`:
|
|
129
|
+
|
|
130
|
+
```json
|
|
131
|
+
{
|
|
132
|
+
"mcpServers": {
|
|
133
|
+
"docusaurus": {
|
|
134
|
+
"command": "uvx",
|
|
135
|
+
"args": ["docusaurus-mcp"],
|
|
136
|
+
"env": {
|
|
137
|
+
"DOCUSAURUS_URL": "https://docs.example.com"
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
### GitHub Copilot
|
|
145
|
+
|
|
146
|
+
Add to `~/.copilot/mcp-config.json`:
|
|
147
|
+
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"mcpServers": {
|
|
151
|
+
"docusaurus": {
|
|
152
|
+
"command": "uvx",
|
|
153
|
+
"args": ["docusaurus-mcp"],
|
|
154
|
+
"env": {
|
|
155
|
+
"DOCUSAURUS_URL": "https://docs.example.com"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
### OpenAI Codex
|
|
163
|
+
|
|
164
|
+
Add to `~/.codex/config.toml`:
|
|
165
|
+
|
|
166
|
+
```toml
|
|
167
|
+
[mcp_servers.docusaurus]
|
|
168
|
+
command = "uvx"
|
|
169
|
+
args = ["docusaurus-mcp"]
|
|
170
|
+
|
|
171
|
+
[mcp_servers.docusaurus.env]
|
|
172
|
+
DOCUSAURUS_URL = "https://docs.example.com"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
### Install from Source
|
|
176
|
+
|
|
177
|
+
```bash
|
|
178
|
+
cd docusaurus-mcp
|
|
179
|
+
pip install -e .
|
|
180
|
+
```
|
|
181
|
+
|
|
182
|
+
## Configuration
|
|
183
|
+
|
|
184
|
+
| Environment Variable | Required | Description |
|
|
185
|
+
|---------------------|----------|-------------|
|
|
186
|
+
| `DOCUSAURUS_URL` | Yes | Docusaurus site base URL (e.g. `https://docs.example.com`) |
|
|
187
|
+
| `DOCUSAURUS_DESCRIPTION` | No | Extra context appended to tool descriptions |
|
|
188
|
+
| `DOCUSAURUS_TIMEOUT` | No | HTTP timeout in seconds (default: `30`) |
|
|
189
|
+
|
|
190
|
+
## Tools
|
|
191
|
+
|
|
192
|
+
<details>
|
|
193
|
+
<summary><code>get_doc_structure</code> — Show full document tree</summary>
|
|
194
|
+
|
|
195
|
+
Returns the complete category and page structure of the documentation site.
|
|
196
|
+
|
|
197
|
+
No parameters required.
|
|
198
|
+
|
|
199
|
+
</details>
|
|
200
|
+
|
|
201
|
+
<details>
|
|
202
|
+
<summary><code>list_docs</code> — List docs by category</summary>
|
|
203
|
+
|
|
204
|
+
Lists all pages in a given category with titles, descriptions, and IDs.
|
|
205
|
+
|
|
206
|
+
| Parameter | Type | Required | Description |
|
|
207
|
+
|-----------|------|----------|-------------|
|
|
208
|
+
| `category` | string | No | Category name. Empty returns all categories. |
|
|
209
|
+
|
|
210
|
+
</details>
|
|
211
|
+
|
|
212
|
+
<details>
|
|
213
|
+
<summary><code>search_docs</code> — Full-text search</summary>
|
|
214
|
+
|
|
215
|
+
Searches across titles, descriptions, and page content. Returns ranked results with snippets.
|
|
216
|
+
|
|
217
|
+
| Parameter | Type | Required | Description |
|
|
218
|
+
|-----------|------|----------|-------------|
|
|
219
|
+
| `query` | string | Yes | Search term or phrase |
|
|
220
|
+
| `limit` | integer | No | Max results (default: `5`) |
|
|
221
|
+
|
|
222
|
+
</details>
|
|
223
|
+
|
|
224
|
+
<details>
|
|
225
|
+
<summary><code>fetch_doc</code> — Read a document</summary>
|
|
226
|
+
|
|
227
|
+
Returns the full content of a document as clean markdown.
|
|
228
|
+
|
|
229
|
+
| Parameter | Type | Required | Description |
|
|
230
|
+
|-----------|------|----------|-------------|
|
|
231
|
+
| `doc_ref` | string | Yes | Document ID, URL, or path |
|
|
232
|
+
|
|
233
|
+
</details>
|
|
234
|
+
|
|
235
|
+
## How It Works
|
|
236
|
+
|
|
237
|
+
1. **Startup**: Fetches the homepage and sitemap.xml
|
|
238
|
+
2. **SPA Detection**: Compares a doc page response with the homepage — if identical, the site is SPA-only
|
|
239
|
+
3. **Static Mode**: Scrapes each page's HTML and extracts article content via BeautifulSoup + markdownify
|
|
240
|
+
4. **SPA Mode**: Parses `runtime.js` to find webpack chunk URLs, fetches each chunk, and extracts doc metadata + content from `JSON.parse()` calls and JSX children
|
|
241
|
+
5. **Indexing**: Builds in-memory indexes by ID, URL, path, and category for fast lookups
|
|
242
|
+
|
|
243
|
+
## Usage Examples
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
# Browse the doc structure
|
|
247
|
+
What categories are in the documentation?
|
|
248
|
+
|
|
249
|
+
# Search for a topic
|
|
250
|
+
Search for "authentication" in the docs
|
|
251
|
+
|
|
252
|
+
# Read a specific page
|
|
253
|
+
Show me the "getting-started" page content
|
|
254
|
+
|
|
255
|
+
# Category browsing
|
|
256
|
+
List all pages in the "guides" category
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
## License
|
|
260
|
+
|
|
261
|
+
MIT
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# Docusaurus MCP Server
|
|
2
|
+
|
|
3
|
+
[](https://python.org)
|
|
4
|
+
[](https://modelcontextprotocol.io)
|
|
5
|
+
[](LICENSE)
|
|
6
|
+
|
|
7
|
+
Generic MCP server for any [Docusaurus](https://docusaurus.io) documentation site. Point it at a URL and get full-text search, browsing, and content extraction — works with both static HTML and SPA-only builds.
|
|
8
|
+
|
|
9
|
+
## Features
|
|
10
|
+
|
|
11
|
+
- **Auto SPA Detection** — Detects SPA-only sites and falls back to webpack chunk parsing
|
|
12
|
+
- **Full-Text Search** — Search across titles, descriptions, and page content
|
|
13
|
+
- **Category Browsing** — Navigate the doc structure by categories
|
|
14
|
+
- **Markdown Extraction** — Returns clean markdown from any doc page
|
|
15
|
+
- **Sitemap Support** — Automatically discovers all pages via sitemap.xml
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
### Claude Code
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
claude mcp add docusaurus \
|
|
23
|
+
-e DOCUSAURUS_URL="https://docs.example.com" \
|
|
24
|
+
-- uvx docusaurus-mcp
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
### Claude Desktop
|
|
28
|
+
|
|
29
|
+
Add to your config file:
|
|
30
|
+
|
|
31
|
+
- **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
32
|
+
- **Windows**: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"docusaurus": {
|
|
38
|
+
"command": "uvx",
|
|
39
|
+
"args": ["docusaurus-mcp"],
|
|
40
|
+
"env": {
|
|
41
|
+
"DOCUSAURUS_URL": "https://docs.example.com"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Cursor
|
|
49
|
+
|
|
50
|
+
Add to `~/.cursor/mcp.json`:
|
|
51
|
+
|
|
52
|
+
```json
|
|
53
|
+
{
|
|
54
|
+
"mcpServers": {
|
|
55
|
+
"docusaurus": {
|
|
56
|
+
"command": "uvx",
|
|
57
|
+
"args": ["docusaurus-mcp"],
|
|
58
|
+
"env": {
|
|
59
|
+
"DOCUSAURUS_URL": "https://docs.example.com"
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Windsurf
|
|
67
|
+
|
|
68
|
+
Add to Windsurf MCP config:
|
|
69
|
+
|
|
70
|
+
```json
|
|
71
|
+
{
|
|
72
|
+
"mcpServers": {
|
|
73
|
+
"docusaurus": {
|
|
74
|
+
"command": "uvx",
|
|
75
|
+
"args": ["docusaurus-mcp"],
|
|
76
|
+
"env": {
|
|
77
|
+
"DOCUSAURUS_URL": "https://docs.example.com"
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### VS Code
|
|
85
|
+
|
|
86
|
+
Add to your VS Code settings (JSON):
|
|
87
|
+
|
|
88
|
+
```json
|
|
89
|
+
"mcp": {
|
|
90
|
+
"servers": {
|
|
91
|
+
"docusaurus": {
|
|
92
|
+
"type": "stdio",
|
|
93
|
+
"command": "uvx",
|
|
94
|
+
"args": ["docusaurus-mcp"],
|
|
95
|
+
"env": {
|
|
96
|
+
"DOCUSAURUS_URL": "https://docs.example.com"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
### Gemini CLI
|
|
104
|
+
|
|
105
|
+
Add to `~/.gemini/settings.json`:
|
|
106
|
+
|
|
107
|
+
```json
|
|
108
|
+
{
|
|
109
|
+
"mcpServers": {
|
|
110
|
+
"docusaurus": {
|
|
111
|
+
"command": "uvx",
|
|
112
|
+
"args": ["docusaurus-mcp"],
|
|
113
|
+
"env": {
|
|
114
|
+
"DOCUSAURUS_URL": "https://docs.example.com"
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### GitHub Copilot
|
|
122
|
+
|
|
123
|
+
Add to `~/.copilot/mcp-config.json`:
|
|
124
|
+
|
|
125
|
+
```json
|
|
126
|
+
{
|
|
127
|
+
"mcpServers": {
|
|
128
|
+
"docusaurus": {
|
|
129
|
+
"command": "uvx",
|
|
130
|
+
"args": ["docusaurus-mcp"],
|
|
131
|
+
"env": {
|
|
132
|
+
"DOCUSAURUS_URL": "https://docs.example.com"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### OpenAI Codex
|
|
140
|
+
|
|
141
|
+
Add to `~/.codex/config.toml`:
|
|
142
|
+
|
|
143
|
+
```toml
|
|
144
|
+
[mcp_servers.docusaurus]
|
|
145
|
+
command = "uvx"
|
|
146
|
+
args = ["docusaurus-mcp"]
|
|
147
|
+
|
|
148
|
+
[mcp_servers.docusaurus.env]
|
|
149
|
+
DOCUSAURUS_URL = "https://docs.example.com"
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### Install from Source
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
cd docusaurus-mcp
|
|
156
|
+
pip install -e .
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
## Configuration
|
|
160
|
+
|
|
161
|
+
| Environment Variable | Required | Description |
|
|
162
|
+
|---------------------|----------|-------------|
|
|
163
|
+
| `DOCUSAURUS_URL` | Yes | Docusaurus site base URL (e.g. `https://docs.example.com`) |
|
|
164
|
+
| `DOCUSAURUS_DESCRIPTION` | No | Extra context appended to tool descriptions |
|
|
165
|
+
| `DOCUSAURUS_TIMEOUT` | No | HTTP timeout in seconds (default: `30`) |
|
|
166
|
+
|
|
167
|
+
## Tools
|
|
168
|
+
|
|
169
|
+
<details>
|
|
170
|
+
<summary><code>get_doc_structure</code> — Show full document tree</summary>
|
|
171
|
+
|
|
172
|
+
Returns the complete category and page structure of the documentation site.
|
|
173
|
+
|
|
174
|
+
No parameters required.
|
|
175
|
+
|
|
176
|
+
</details>
|
|
177
|
+
|
|
178
|
+
<details>
|
|
179
|
+
<summary><code>list_docs</code> — List docs by category</summary>
|
|
180
|
+
|
|
181
|
+
Lists all pages in a given category with titles, descriptions, and IDs.
|
|
182
|
+
|
|
183
|
+
| Parameter | Type | Required | Description |
|
|
184
|
+
|-----------|------|----------|-------------|
|
|
185
|
+
| `category` | string | No | Category name. Empty returns all categories. |
|
|
186
|
+
|
|
187
|
+
</details>
|
|
188
|
+
|
|
189
|
+
<details>
|
|
190
|
+
<summary><code>search_docs</code> — Full-text search</summary>
|
|
191
|
+
|
|
192
|
+
Searches across titles, descriptions, and page content. Returns ranked results with snippets.
|
|
193
|
+
|
|
194
|
+
| Parameter | Type | Required | Description |
|
|
195
|
+
|-----------|------|----------|-------------|
|
|
196
|
+
| `query` | string | Yes | Search term or phrase |
|
|
197
|
+
| `limit` | integer | No | Max results (default: `5`) |
|
|
198
|
+
|
|
199
|
+
</details>
|
|
200
|
+
|
|
201
|
+
<details>
|
|
202
|
+
<summary><code>fetch_doc</code> — Read a document</summary>
|
|
203
|
+
|
|
204
|
+
Returns the full content of a document as clean markdown.
|
|
205
|
+
|
|
206
|
+
| Parameter | Type | Required | Description |
|
|
207
|
+
|-----------|------|----------|-------------|
|
|
208
|
+
| `doc_ref` | string | Yes | Document ID, URL, or path |
|
|
209
|
+
|
|
210
|
+
</details>
|
|
211
|
+
|
|
212
|
+
## How It Works
|
|
213
|
+
|
|
214
|
+
1. **Startup**: Fetches the homepage and sitemap.xml
|
|
215
|
+
2. **SPA Detection**: Compares a doc page response with the homepage — if identical, the site is SPA-only
|
|
216
|
+
3. **Static Mode**: Scrapes each page's HTML and extracts article content via BeautifulSoup + markdownify
|
|
217
|
+
4. **SPA Mode**: Parses `runtime.js` to find webpack chunk URLs, fetches each chunk, and extracts doc metadata + content from `JSON.parse()` calls and JSX children
|
|
218
|
+
5. **Indexing**: Builds in-memory indexes by ID, URL, path, and category for fast lookups
|
|
219
|
+
|
|
220
|
+
## Usage Examples
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
# Browse the doc structure
|
|
224
|
+
What categories are in the documentation?
|
|
225
|
+
|
|
226
|
+
# Search for a topic
|
|
227
|
+
Search for "authentication" in the docs
|
|
228
|
+
|
|
229
|
+
# Read a specific page
|
|
230
|
+
Show me the "getting-started" page content
|
|
231
|
+
|
|
232
|
+
# Category browsing
|
|
233
|
+
List all pages in the "guides" category
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## License
|
|
237
|
+
|
|
238
|
+
MIT
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "docusaurus-mcp"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
description = "Generic MCP server for any Docusaurus documentation site - search, browse, and read docs"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = {text = "MIT"}
|
|
12
|
+
authors = [
|
|
13
|
+
{name = "mytsx"}
|
|
14
|
+
]
|
|
15
|
+
keywords = ["mcp", "model-context-protocol", "docusaurus", "documentation", "search"]
|
|
16
|
+
classifiers = [
|
|
17
|
+
"Development Status :: 4 - Beta",
|
|
18
|
+
"Intended Audience :: Developers",
|
|
19
|
+
"License :: OSI Approved :: MIT License",
|
|
20
|
+
"Programming Language :: Python :: 3",
|
|
21
|
+
]
|
|
22
|
+
dependencies = [
|
|
23
|
+
"mcp[cli]>=1.0.0",
|
|
24
|
+
"httpx>=0.27.0",
|
|
25
|
+
"markdownify>=0.14.1",
|
|
26
|
+
"beautifulsoup4>=4.12.0",
|
|
27
|
+
]
|
|
28
|
+
|
|
29
|
+
[project.urls]
|
|
30
|
+
Homepage = "https://github.com/mytsx/mcp-servers"
|
|
31
|
+
Repository = "https://github.com/mytsx/mcp-servers"
|
|
32
|
+
Issues = "https://github.com/mytsx/mcp-servers/issues"
|
|
33
|
+
|
|
34
|
+
[project.scripts]
|
|
35
|
+
docusaurus-mcp = "docusaurus_mcp.__main__:run"
|
|
36
|
+
|
|
37
|
+
[tool.setuptools]
|
|
38
|
+
packages = ["docusaurus_mcp"]
|
|
39
|
+
package-dir = {"" = "src"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Entry point for Docusaurus MCP Server
|
|
4
|
+
Usage: docusaurus-mcp | python -m docusaurus_mcp
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from .server import mcp
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def run():
|
|
11
|
+
"""Synchronous entry point"""
|
|
12
|
+
mcp.run()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
if __name__ == "__main__":
|
|
16
|
+
run()
|