Stateless MCP server with registry and governance
Build a stateless Streamable HTTP MCP server with live discovery, registry metadata, per-call authorization, action-bound approvals, audit and an evidence pack proven on the real wire.
The capstone and what it builds on
- 1Stateless MCP Server with Registry and GovernanceThe capstone brief
- 2MCP Transports: stdio and Stateless Streamable HTTPPhase 13: Tools and protocols
- 3MCP Authorization: CIMD, Issuer Binding, PKCE, and Step-UpPhase 13: Tools and protocols
- 4Stateless MCP Gateways and Registry AdmissionPhase 13: Tools and protocols
- 5MCP Auth in Production: Issuer-Bound Enrollment and TokensPhase 13: Tools and protocols
- 6MCP Tool Contracts and ContentPhase 13: Tools and protocols
- 7MCP Reliability, Cancellation, and Flow ControlPhase 13: Tools and protocols
- 8MCP Registry Supply Chain: Admission, Drift, and RollbackPhase 13: Tools and protocols
- 9MCP Conformance Engineering: Versioning, Evidence, and OperationsPhase 13: Tools and protocols
What You'll Build
A production-shaped MCP server targeting protocol revision 2026-07-28: no sessions, protocol context in every request, server/discover, deterministic cache-aware tools/list, and policy-gated tools/call. It publishes a server.json, detects drift between the published record and the live process, validates tokens on every call, binds approvals to exact actions, writes redacted audit records, and runs as two interchangeable replicas behind a proxy.
Requirements
- A
server.jsonwith name inside your verified reverse-DNS namespace, version, description and astreamable-httpremote; validated against the pinned official schema (ormcp-publisher), with secrets only as declared inputs. server/discoverreturning supported versions, capabilities and server identity; an unsupported protocol version string returns-32022with{supported, requested}, a missing or non-string version returns-32602.- Stateless envelope: every request carries protocol version, client capabilities and client info in
params._meta; every result includesresultType: "complete"and server identity; no initialize handshake or session ids anywhere. - Tool surface: two read-only tools and one state-changing tool, each with a bounded JSON Schema, honest annotations and deterministic result shape; invalid arguments return a tool error without running the handler.
tools/listreturns byte-stable order withttlMsandcacheScope(private when visibility depends on the caller).- Streamable HTTP: one POST endpoint, mirrored
MCP-Protocol-Version,Mcp-MethodandMcp-Nameheaders checked against the body (mismatch returns-32020before policy or tool code runs), Origin validation and loopback binding for local dev. - Authorization on every call: issuer, audience or resource, expiry and scope checked; a token for the read-only server fails on the state-changing one.
- Policy decision per call plus approval records bound to actor, tool, canonical argument digest, server URL and expiry; changing one argument makes the approval fail before the handler.
- Registry vs runtime drift report: compare the published record (name, version, remote URL) with the live
server/discoverresult and report exact differences. - Audit records with actor, issuer, tool, decision, request id, trace context, latency and outcome; sensitive arguments redacted or digested; sink kept out of model context.
- Two replicas behind a proxy (nginx, Caddy or Envoy) handling at least 100 concurrent requests with no affinity, plus cancellation, timeout, safe read retry and an idempotency key on the mutation.
- Evidence pack covering wire, proxy, admission, retry and rollback, with a digest of the redacted pack stored in the repo.
Constraints
- No LLM is required; the server is the deliverable. If you add an LLM client for demos, Model-agnostic: any OpenAI-compatible endpoint (including the KatalockAi API) or a local model (for example via Ollama, llama.cpp or vLLM) may be used. No named commercial model is required; record which model you used in the README.
- Hardware: a laptop with Docker Compose. Any implementation language is fine.
- Substitution: publishing to the public MCP Registry and a corporate OAuth provider are not required. A private registry adapter (a small API or static index you host) and a local issuer (Keycloak in Docker, or a test issuer with keys you generate) are accepted, as long as tokens are really validated.
- The lesson's local reference models may be studied, but the submission must be your own implementation exercised over real HTTP, with raw headers and bodies captured.
Stretch Goals
- Break a request-scoped SSE response mid-stream and prove retry uses a new request id with no Last-Event-ID replay.
- Replace hidden process memory with an explicit shared handle for a multi-call workflow and route calls to alternating replicas.
- Add an SDK differential check comparing your server's responses with an official SDK client's expectations.
How to Submit
- Public GitHub repo with
server/,server.json,registry/(adapter and drift check),auth/,policy/,deploy/(compose file, proxy config),conformance/(golden and negative cases),evidence/(redacted pack and digest) andREADME.md. - README: architecture, how to run the replicas and the conformance suite, the auth and approval model, drift report example, load and reliability results and limitations.
- Paste the conformance suite output, the drift report, the concurrency test summary and the evidence pack digest.
How It's Reviewed
Professor Katalock reads your repository and the evidence you paste, and scores each criterion out of 100. You pass with a weighted total of 70 or more and no criterion below 40. A copied or padded submission is flagged and fails.
Submit
Push your work to a public GitHub repository with a README that explains how to run it, then paste the evidence below. Up to 3 reviews a day, free.
- Conformance suite output (golden and negative cases) with a few redacted raw request and response captures
- Registry vs runtime drift report from a deliberate mismatch
- Concurrency and reliability test summary across two replicas
- Audit log excerpt showing a denied call and an approved state-changing call
- Digest of the redacted evidence pack and a list of its five evidence classes
Reviews are done by AI against the rubric above. They check the evidence in your repository; they are not a substitute for a human code review, and a review can be wrong. If you think it is, improve the README so the evidence is unmistakable and resubmit.