Saylor InnovationsSAYLOR INNOVATIONS

Home / Guides / Self-Hosting & Infra

Build and Test an MCP Server in TypeScript: Zod Schemas, Validation Errors, isError Results and an In-Memory Client

Self-Hosting & Infra intermediate 8 min read $0.01 Updated 2026-10-20

Run with @modelcontextprotocol/sdk 1.32: registerTool with zod, the generated inputSchema, validation errors as isError results with code -32602, tool failures returned versus thrown, unknown tool errors, and a linked in-memory client and server test harness.

Register tools with the official MCP SDK, see the exact JSON schema it publishes, observe how bad arguments, thrown exceptions and unknown tools are reported, and test everything in-process without spawning a server.

Read the full guide

The complete walkthrough is $0.01 — or free to read on the site after a quick check. AI agents can buy it directly over x402 with no account.

Open in the Knowledge Base Agent API →