Cloudflare Worker MCP endpoint for the Context Stack. It serves the stack's canonical resources and doctrine to AI clients.
Probabilistic intelligence must operate inside deterministic governance boundaries.
This read-only server lets AI clients discover the stack, read canonical resources, choose the correct project entry point, and generate first-pass governance guidance.
The optional /advisor endpoint is an explanation layer over a route selected by the existing deterministic assessment. It uses Workers AI only to explain the selected public documents; it does not select or enforce a route.
v0.1 is live at:
https://mcp.context-stack.org/mcp
Health endpoint:
https://mcp.context-stack.org/health
context-stack://overviewcontext-stack://glossarycontext-stack://decisionscontext-stack://contextops/frameworkcontext-stack://contextops/manifestcontext-stack://contextboundary/frameworkcontext-stack://contextboundary/rationalecontext-stack://sthala/speccontext-stack://griha/readme
get_stack_overviewget_projectrecommend_projectget_glossary_termlist_stack_resources
choose_stack_entry_pointrun_contextops_assessmentclassify_contextboundary_egressmap_sthala_deploymentbuild_ai_governance_adoption_plan
Send a JSON POST to /advisor with a deterministic routeKey (context, egress, runtime, delivery, or unsure) and a question. Successful responses include the fixed route, model-generated explanation, selected public source identifiers, and model/application/Worker provenance. The endpoint returns no prose when the budget, rate limit, source retrieval, model call, or output validation fails.
Requires Node.js 20 or later and Wrangler.
npm test
npm startHealth check:
curl http://127.0.0.1:8787/healthMCP 2026-07-28 discovery call:
curl -X POST http://127.0.0.1:8787/mcp \
-H "content-type: application/json" \
-H "MCP-Protocol-Version: 2026-07-28" \
-H "Mcp-Method: server/discover" \
-d '{"jsonrpc":"2.0","id":"discover-1","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/protocolVersion":"2026-07-28","io.modelcontextprotocol/clientInfo":{"name":"curl","version":"1.0.0"},"io.modelcontextprotocol/clientCapabilities":{}}}}'For interoperability, this server accepts a Streamable HTTP request carrying only the MCP-Protocol-Version header, without a protocol-version declaration in body _meta. MCP 2026-07-28 expects both values, with the header mirroring the body value. This is a deliberate interoperability allowance. When both are present and differ, the server rejects the request with HeaderMismatch (-32020) and HTTP 400.
Legacy MCP initialize call remains supported during client cutover:
curl -X POST http://127.0.0.1:8787/mcp \
-H "content-type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18"}}'Tool call:
curl -X POST http://127.0.0.1:8787/mcp \
-H "content-type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"recommend_project","arguments":{"question":"We need to govern data egress from an AI agent."}}}'Live tool list:
curl -X POST https://mcp.context-stack.org/mcp \
-H "content-type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'Live project recommendation:
curl -X POST https://mcp.context-stack.org/mcp \
-H "content-type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"recommend_project","arguments":{"question":"We need to assess stale context after AMS handover."}}}'- Read tools are source-routed through the canonical stack catalog.
- No content database; the advisor budget Durable Object stores numeric counters only.
- No stored user prompts, assessment answers, or organization data.
- Resources point to canonical GitHub project files.
- No GitHub token or other write credential is required.
- The server does not replace any stack repo. It routes agents to the correct source.
- The server is for discovery and decision support, not policy enforcement.
- The advisor question is sent to Cloudflare Workers AI for processing; it is not stored, logged, or used to train a model.
The server logs method-level operational metadata only:
mcp method=POST path=/mcp status=200 duration_ms=8 rpc=tools/list outcome=ok
mcp method=POST path=/mcp status=200 duration_ms=14 rpc=tools/call tool=recommend_project outcome=ok
mcp method=POST path=/mcp status=200 duration_ms=42 rpc=resources/read resource=context-stack://glossary outcome=ok
http method=POST path=/advisor status=200 duration_ms=80 route=advisor
It does not log prompts, tool arguments, assessment answers, or organization-specific content.
ContextOps and ContextBoundary are the specification layer. contextboundary-gw, Sthala and Griha are reference implementations that apply it. The composition is defined once, in COMPOSITION.md.
context-stack-mcp is not part of the composition. It is the stack's access path: an assistant-facing MCP endpoint that routes agents to each repository's own files.
See docs/DEPLOYMENT.md.
See docs/PRIVACY.md.
Apache 2.0.