You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
npx wrangler dev --config cloudflare-mcp/wrangler.toml
23
32
```
24
33
34
+
This runs the Worker locally and serves the MCP endpoint at `http://127.0.0.1:8787/mcp`.
35
+
36
+
## Local MCP testing
37
+
38
+
There is also a repo-root local test server at `mcp-server.mjs`.
39
+
Use it when you want to test the MCP server behavior without running the Cloudflare Worker.
40
+
41
+
From the repo root:
42
+
43
+
```bash
44
+
npm run build
45
+
node mcp-server.mjs
46
+
```
47
+
48
+
This starts a local MCP server at `http://localhost:3456`.
49
+
It uses `build/mcp/*` artifacts when available and falls back to `build/search-index.json` plus local or runtime HTML fetching when those MCP artifacts are missing or incomplete.
50
+
25
51
## Prerequisites
26
52
27
-
The worker bundles `build/mcp/docs.json` and `build/mcp/search-index.json` generated by the Docusaurus build. Run a full site build before deploying:
53
+
Run a full site build before deploying:
28
54
29
55
```bash
30
56
npm run build
31
57
npm run deploy:mcp
32
58
```
59
+
60
+
The worker uses the generated build artifacts as follows:
61
+
62
+
- It prefers valid `build/mcp/*` artifacts from `docusaurus-plugin-mcp-server`.
63
+
- If those MCP artifacts are missing or incomplete, it falls back to `build/search-index.json` for `docs_search`.
64
+
- In fallback mode, `docs_fetch` retrieves page HTML from `DOCS_BASE_URL` at runtime.
0 commit comments