← ClaudeAtlas

mcp-authoringlisted

When to author an MCP server, architecture overview (tools/resources/prompts), stdio vs HTTP+SSE transport tradeoffs, registration in .claude.json. Sub-modules: stdio-server-template.md (full TS code), http-server-on-workers.md (Hono + SSE on CF Workers), forge-mcp-from-openapi.md (extend forge script with --target=mcp-server). Fires when user asks to 'build an MCP server', 'expose X as an MCP tool', or 'add MCP to my Worker'.
heymegabyte/claude-skills · ★ 18 · AI & Automation · score 72
Install: claude install-skill heymegabyte/claude-skills
# 19 — MCP Authoring Three primitive types: - **Tools** — callable functions (JSON schema input → structured output). Model decides when to call. "Do something." - **Resources** — addressable content (files, DB rows, feeds) returned as text/binary. "Read something." - **Prompts** — reusable templates with typed args. "Fill and inject." Source authority: modelcontextprotocol.io/introduction, `@modelcontextprotocol/sdk` NPM. ## When to author an MCP server Build when: - A REST API/Worker would provide genuine agent value and schema-wrapping cost < benefit - Tool set needs sharing across multiple Claude sessions without copy-pasting prompts - CF Worker owns business logic and you want Claude persistent auth-aware access (HTTP transport = zero extra infra) - Extending the forge pipeline (`--target=mcp-server` — see `forge-mcp-from-openapi.md`) Do NOT build when a simple `[[hono-api]]` route + direct `fetch` suffices — MCP adds SDK overhead not justified for one-off integrations. ## Architecture ``` Claude Code / Claude Desktop │ JSON-RPC 2.0 ▼ ┌──────────────┐ │ MCP Server │ │ ┌────────┐ │ │ │ tools │ │ ← JSON-schema validated inputs + Zod-validated outputs │ ├────────┤ │ │ │resourc.│ │ ← URI-addressed, MIME-typed │ ├────────┤ │ │ │prompts │ │ ← Named templates with typed args │ └────────┘ │ └──────────────┘ │ ▼ External system (D1 / R2 / Vectorize / external API) ``` Every tool input: `z.parse()` before hit