Tour the Atmosphere. Switch clients, share universal links, browse any PDS.

Add a hosted MCP server: eighteen read-only tools over the Atmosphere

The fifth surface. /api/mcp serves the 2026-07-28 stateless protocol (with the 2025 Streamable HTTP fallback) via mcp-handler on a plain route handler; /mcp is the human landing page with a Markdown twin behind the same Accept negotiation as /about. Tools wrap the existing protocol layer, one file per group under src/lib/mcp/tools/: resolve (resolve_link, list_waypoints), identity (resolve_identity, get_identity_history), repositories (describe_repo, list_records, get_record, describe_pds), graph (get_backlinks over Constellation), Bluesky layer (get_profile, get_thread, search_posts, search_actors), and lexicons (list_trending_lexicons, get_lexicon_activity, search_lexicons, sample_recent_records, get_lexicon_schema via the _lexicon DNS method). Every host not hard-coded in config — including PDS endpoints out of DID documents — passes the SSRF guard before any fetch; failures reuse the ApiErrorCode enum so agents branch on the same codes as the REST API; every result carries at:// URIs and universal links. The resolve and waypoints routes now delegate to extracted cores (src/lib/resolveLink.ts, src/lib/waypointCatalog.ts) shared with the tools, byte-identical HTTP behavior. appview.ts gains searchPosts, searchActors and a recursive thread type; spaceLexicon.ts exports its existing resolveLexiconDid. New deps, web app only: mcp-handler (Apache-2.0), @modelcontextprotocol/server (MIT), zod (MIT) — approved by the maintainer, packages/ stays zero-dependency. Test infra learns the service layer: the alias resolver now handles relative extensionless imports under src/, and npm test runs with --experimental-transform-types for the one parameter property in cache.ts. 34 new tests (registration surface, schema bounds, offline validation paths, SSRF rejections); a live smoke pass exercised all eighteen tools against production upstreams. Known caveat: Bluesky's search endpoint 403s data-center IPs, so search_posts may answer upstream_error from hosted deploys; the tool says so honestly. Deploy note: add a WAF rate-limit rule for /api/mcp in the Vercel dashboard before announcing (docs/mcp-server-plan.md, decision D7). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SChxoUgB6ujkJMh6Pjan46


Author Claude Co-author Claude Fable 5 Date Commit Parent b689e3ae