Skip to content

Add a public MCP server - #506

Open
albinazs wants to merge 4 commits into
wagtail:mainfrom
albinazs:feature/public-mcp
Open

albinazs wants to merge 4 commits into
wagtail:mainfrom
albinazs:feature/public-mcp

Conversation

@albinazs

Copy link
Copy Markdown
Contributor

Fixes #499. Part of #486.

Adds a public unauthenticated MCP server at /mcp, so AI agents can search and read the guide.

  • Tools: search_docs (full-text search, optional locale, top 5 results by default) and fetch_docs_page (a page as Markdown, from a URL, path or /markdown/ URL). Both are read-only, and only live, public pages are returned.
  • Implementation: the official MCP Python SDK, served from a Django view (apps/mcp_server) that runs one stateless SDK request per Django request. The site keeps running under WSGI and gunicorn. It supports both the 2026-07-28 stateless protocol and earlier clients that use the initialize handshake.
  • Discovery: the endpoint is listed in llms.txt, the agent skill and /.well-known/api-catalog.
  • Logging: one INFO line per request (method, tool, status, protocol version, client).
  • Cloudflare worker: only GET and HEAD requests go through the cache, so POSTs (MCP, feedback) skip cache lookups.

Testing

Against a copy of the production database, locally:

  • MCP Inspector, both the CLI and the browser UI through its proxy.
  • Claude Code as a real agent: correct, cited answers for scheduled publishing and focal points. For two-factor authentication it said the guide doesn't cover it, and it sent a StreamField developer question to docs.wagtail.org.
  • By Claude: Python SDK client in legacy, auto and 2026-07-28 modes: search for 12 typical editor questions, fetch for every URL form, every error case, and 60 concurrent clients.

AI usage

AI-assisted issue investigation, code and PR description

@albinazs
albinazs requested a review from thibaudcolas October 23, 2026 07:22

This branch has not been deployed

No deployments
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.

Docs-focused public guide MCP server

1 participant