Making Your Website Native to AI Agents: Building a Stateless Public MCP Server and llms.txt
AI Architecture · 7 min
Recruiters and engineers increasingly use Claude Desktop, Cursor, and Gemini CLI to research candidates. Here is how this site exposes its portfolio, 45 ADRs, and live metrics over Streamable HTTP MCP (/mcp) and /llms.txt.
A growing share of technical visitors never read a website solely through a browser tab—they paste the URL into Claude Desktop, Cursor, Antigravity, or ChatGPT, or connect an agent directly to inspect the architecture.
To make charlieroffe.com a first-class citizen for AI agents while keeping my scale-to-zero Cloud Run architecture completely stateless (ADR-039), I implemented two open standards directly in the Express backend: /llms.txt (server/llms.ts) and a Streamable HTTP Model Context Protocol (MCP) server at POST /mcp (server/mcp.ts).
1. Dynamic `/llms.txt` and `/llms-full.txt` Generated from Single-Source-of-Truth Data
Rather than maintaining a static Markdown file that drifts out of sync with the site, GET /llms.txt and GET /llms-full.txt dynamically compile clean, structured Markdown briefings directly from src/data/portfolio.ts, src/data/adrs.ts, and the active feature flags:
- Executive summary, core competencies, and quantified career impact.
- Full work history and active cloud certifications.
- Direct links and full records for all 45 Architecture Decision Records (ADRs) and all 9 technical articles.
- Connection instructions for the public MCP server (
https://charlieroffe.com/mcp) and OpenAPI 3.1 specification (/api/openapi.json).
2. Stateless Streamable HTTP MCP Server (`POST /mcp`)
The Model Context Protocol (MCP) originally popularized stdio and stateful SSE transports—neither of which fits a public, scale-to-zero Cloud Run container where replicas spin down between calls. MCP's Streamable HTTP transport solves this by allowing each JSON-RPC 2.0 request (initialize, ping, tools/list, tools/call) to be answered in a single stateless POST /mcp round-trip (supporting protocol versions 2025-11-25, 2025-06-18, and 2025-03-26) without pulling in the heavy server SDK dependency:
export const SUPPORTED_PROTOCOL_VERSIONS = ['2025-11-25', '2025-06-18', '2025-03-26'] as const;
case 'initialize': {
const requested = params.protocolVersion;
const protocolVersion = SUPPORTED_PROTOCOL_VERSIONS.includes(requested)
? requested
: SUPPORTED_PROTOCOL_VERSIONS[0];
return {
jsonrpc: '2.0', id,
result: {
protocolVersion,
capabilities: { tools: { listChanged: false } },
serverInfo: { name: 'charlieroffe.com', title: 'Charlie Roffe — profile & architecture', version: version() },
instructions: INSTRUCTIONS,
},
};
}
```
Tools Exposed to External Agents
Any MCP client can connect to https://charlieroffe.com/mcp with zero API keys and invoke six deterministic, read-only tools (verified in tests/backend/mcp.test.ts):
get_profile: Returns Charlie's structured bio (overview,experiencewith optional employer filter,certifications,skills,education,availability, orthis_site) in English or Spanish.list_architecture_decisions: Lists and searches all 45 Architecture Decision Records (with optionalqueryandstatusfilters), returning ID, title, status (accepted/superseded), and canonical page URL.get_architecture_decision: Fetches the full Context, Decision, Consequences, and Alternatives of a specific ADR by ID (adr-033-ai-spend-guardrails) or number (033,ADR-33).list_technical_articles: Lists and searches Charlie's long-form engineering essays on/blog(with optionalqueryandcategoryfilters), returning slug ID, title, category, read time, excerpt, and URL.get_technical_article: Fetches the full CommonMark body of an article by slug (e.g.scale-to-zeroorgithub-controls), with an optionalcloud(gcp,aws,azure) filter for multi-cloud blueprints.get_site_status: Returns real-time Cloud Run availability, p50/p95 server response times, cookieless page views by source and country, daily AI budget usage, and the latest container deploy.
Why Deterministic Read-Only Tools Matter on a Public MCP Endpoint
Notice what these six MCP tools have in common: none of them invoke an LLM on my backend. The external agent (Claude, Cursor, Gemini CLI) already is an LLM! By serving structured portfolio data, ADRs, technical articles, and cached Cloud Monitoring metrics deterministically, my public MCP server has near-zero marginal cost, zero prompt-injection surface against backend models, and sub-10ms response latency.