Skip to content

[Agents 0.20.1 + MCP SDK v2] Add Developer Stack MCP server (apps/stack-mcp) - #423

Merged
mattzcarey merged 7 commits into
cloudflare:mainfrom
aninibread:anni/stack-mcp
Jul 30, 2026
Merged

[Agents 0.20.1 + MCP SDK v2] Add Developer Stack MCP server (apps/stack-mcp)#423
mattzcarey merged 7 commits into
cloudflare:mainfrom
aninibread:anni/stack-mcp

Conversation

@aninibread

@aninibread aninibread commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Add Developer Stack MCP server (apps/stack-mcp)

A curated MCP server that searches the entire recommended Cloudflare developer stack as a single docs-search tool for coding agents.

Library includes:

  • Cloudflare Developer Docs (developers.cloudflare.com)
  • Cloudflare API (developers.cloudflare.com/api)
  • Cloudflare Blog (blog.cloudflare.com)
  • Cloudflare Community (community.cloudflare.com)
  • Vite (vite.dev)
  • Vitest (vitest.dev)
  • Astro (docs.astro.build)
  • OpenNext (opennext.js.org)
  • Replicate (replicate.com)
  • Hono (hono.dev)

MCP includes:

  • Two tools: list_libraries (discover the covered libraries and their slugs) and search_docs (semantic search across the stack, with optional single-library scoping).
  • Backed by the dev-stack AI Search namespace via the ai_search_namespaces binding; multi-instance search across the curated catalog, with reranking always on.
  • Stateless per-request scoping through the ?libs= URL param.
  • Streamable HTTP (/mcp) and legacy SSE (/sse).
  • Routes: stack.mcp.cloudflare.com (production), stack-staging.mcp.cloudflare.com (staging).

Returns { libraries: [...] } with permissive CORS so browser UIs (e.g.
the Workers AI Playground) can fetch the catalog cross-origin.
Rebased onto production, which moved the framework to the stateless SDK v2
model (cloudflare#420). Bring stack-mcp in line with the migrated sibling apps:

- Bootstrap via createPublicMcpApp instead of a hand-written McpAgent DO;
  the server is now stateless (no Durable Object).
- Register tools through the per-request McpRegistrationContext; read
  ?libs= from context.request so both /mcp and /sse honor scoping.
- Schemas use z.object; drop the direct @modelcontextprotocol/sdk, agents,
  and @repo/mcp-observability deps (now provided via @repo/mcp-common).
- Preserve the /libraries catalog endpoint by wrapping app.worker.
- Add a stateless transport-contract spec; keep reranking always on.
@aninibread aninibread changed the title Add Developer Stack MCP server (apps/stack-mcp) [Agents 0.20.1 + MCP SDK v2] Add Developer Stack MCP server (apps/stack-mcp) Jul 30, 2026
@mattzcarey
mattzcarey merged commit ebcbad1 into cloudflare:main Jul 30, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants