Agents & MCP
Use when building or extending a Model Context Protocol server that exposes tools to Claude or other agents, especially as a Next.js App Router route with mcp-handler. Covers tool design as prompt engineering, the concrete route wiring, strict zod schemas, Bearer auth, and evaluating tools so the model actually calls them. Also use when a tool exists but the model ignores it, or a tool's schema lets the model pass something unusable. If an agent will call your API, use this skill.
4 files
Description
Use when building or extending a Model Context Protocol server that exposes tools to Claude or other agents, especially as a Next.js App Router route with mcp-handler. Covers tool design as prompt engineering, the concrete route wiring, strict zod schemas, Bearer auth, and evaluating tools so the model actually calls them. Also use when a tool exists but the model ignores it, or a tool's schema lets the model pass something unusable. If an agent will call your API, use this skill.
Build an MCP server whose tools a model can discover, call correctly, and recover from. This goes deeper than basic authoring: it assumes you are shipping a real HTTP server (not a local stdio toy), auth is required, and every tool call costs context or money.
Reach for this when you are:
route.ts pattern), not stdio.Work in this order. Skipping straight to code is the most common way tools end up unusable.
reference/tool-design.md.createMcpHandler with server.registerTool, wrap it in withMcpAuth + a verifyToken that resolves a Bearer key to a caller id, and return readable tool results (never throw across the transport). See reference/typescript_mcp_server.md.reference/evaluation.md.isError: true, not thrown exceptions. A thrown error kills the transport; a readable error lets the model recover..describe() on every field.limit, and summarize instead of dumping full tables.reference/tool-design.md - naming, descriptions, schemas, error results, pagination, free vs metered.reference/typescript_mcp_server.md - the concrete Next.js route.ts pattern with mcp-handler and auth.reference/evaluation.md - inspector, curl, result-shape asserts, an eval harness, and description iteration.Added 2026-07-01. Back to the Skill Library.

New tutorials, open-source projects, and deep dives on coding agents - delivered weekly.