mcp-authoringlisted
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