Umesh Malik adds a production MCP server to his site in ~300 lines
Umesh Malik walks through building a production-ready MCP server on a Cloudflare Worker in roughly 300 lines of code — no framework, no database — exposing four typed tools that let AI agents search posts, fetch Markdown, list topics, and read a profile.
Score breakdown
The post demonstrates that making a site agent-callable via MCP requires no new infrastructure — just a stateless worker and existing published assets — removing every technical barrier that would prevent an AI agent from using the site's content precisely.
- 01The MCP server runs on a Cloudflare Worker as a stateless JSON-RPC 2.0 handler in approximately 300 lines of code, with no framework or database.
- 02It uses the Streamable HTTP transport: a single `POST /mcp` endpoint that returns plain JSON (not SSE), since the server is read-only.
- 03Four method handlers are required: `initialize`, `tools/list`, `tools/call`, and `ping`, plus a no-op for notifications.
Umesh Malik's post argues that modern AI agents don't want to parse HTML — they want to call typed functions — and that the Model Context Protocol (MCP) is the standard that makes a site agent-callable rather than merely agent-readable. To illustrate the point concretely, he built and deployed a production MCP server on his own site and shares the real code throughout the article.
The implementation requires exactly four method handlers — `initialize`, `tools/list`, `tools/call`, and `ping` — plus a no-op for notifications, and clocks in at roughly 300 lines with no framework or database.
The server runs on a Cloudflare Worker as a stateless JSON-RPC 2.0 handler, using the Streamable HTTP transport: a single `POST /mcp` endpoint that accepts JSON-RPC messages and returns plain JSON responses (rather than SSE streams, since the read-only server has no streaming notifications to push). The implementation requires exactly four method handlers — `initialize`, `tools/list`, `tools/call`, and `ping` — plus a no-op for notifications, and clocks in at roughly 300 lines with no framework or database.
The server exposes four read-only tools: `search_posts` (ranked full-text search backed by an existing JSON feed), `get_post` (returns a single post as clean Markdown from prerendered pages), `list_topics` (lists curated topic hubs from a small constant), and `get_profile` (returns the author profile from an existing `llms.txt` file). Malik stresses that tool descriptions are written for models to read — not developers — so that an agent can correctly decide whether and how to invoke each tool. He also notes that discoverability is handled via a manifest at a well-known URL, an API catalog entry, and a `Link` header, and that the MCP server complements other agent-readiness signals like `llms.txt` and structured data without replacing them.
Key facts
- 01The MCP server runs on a Cloudflare Worker as a stateless JSON-RPC 2.0 handler in approximately 300 lines of code, with no framework or database.
- 02It uses the Streamable HTTP transport: a single `POST /mcp` endpoint that returns plain JSON (not SSE), since the server is read-only.
- 03Four method handlers are required: `initialize`, `tools/list`, `tools/call`, and `ping`, plus a no-op for notifications.
- 04Four read-only tools are exposed: `search_posts`, `get_post`, `list_topics`, and `get_profile`.
- 05Each tool is backed by assets already published on the site — a JSON feed, prerendered Markdown pages, and an existing `llms.txt` file.
- 06Tool descriptions are written for models to read, not developers, so agents can decide whether and how to call each tool.
- 07Discoverability is achieved via a manifest at a well-known URL, an API catalog entry, and a `Link` header.
Topics
Summary and scoring are generated automatically from the original article. We always link back to the publisher and never republish images or paywalled content. Last processed Jun 13, 2026 · 08:58 UTC. How this works →