Tag

#mcp

12 posts tagged.

Tutorials

Your Zod .refine() never reaches the model

Measured on ai 7.0.118 and zod 4.6.5: a .refine() on a tool input schema is stripped before the schema reaches the model, with no warning. z.string().startsWith('acct_') arrives as a pattern; the same rule written as a refinement arrives as nothing.

11 min read161
Tutorials

Your MCP stdio server keeps running after the client dies (Node)

An MCP stdio server that holds a timer or a pool open does not exit when its client dies. Measured on SDK 1.30.0 and Node 24.8.0: it is reparented to init and keeps running. StdioServerTransport registers no stdin end-of-file listener. Here is the reproduction and the four-line fix.

9 min read139
AI agents

Remote MCP Server in Python (2026): Serve Tools over Streamable HTTP

A runnable 2026 tutorial for turning a local Python MCP server into a remote one over Streamable HTTP. Serve tools, prove the endpoint with curl and MCP Inspector, switch on the DNS-rebinding protection that ships off by default, add a bearer token, then connect a client. Covers the Mcp-Session-Id requirement and the host and port arguments that moved off the constructor between SDK majors.

14 min read502
MCP servers

How to Build an MCP Server (2026): Your First Server, Wired to Claude

The Model Context Protocol (MCP) is a standard way to expose tools to any MCP-capable client, Claude Desktop, IDEs, or your own agents, so you write an integration once and reuse it everywhere. In this tutorial you build an MCP server in TypeScript that exposes a single typed tool over the stdio transport, test it with the MCP Inspector, then register it with Claude and call it from a real conversation. You will also learn the one rule that trips up everyone on stdio: never write to stdout. By the end you have a reusable server you can extend with your own tools.

5 min read609
#mcp · AgentNotebook