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.
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.
npm error notarget No matching version found for @anthropic-ai/sdk means you asked for a major that does not exist. Anthropic ships two SDKs on unrelated version lines: Python is on 1.5.0, npm has never left 0.x. Read from both registries, with the caret trap that follows.
ImportError: cannot import name 'streamablehttp_client' means pip resolved MCP Python SDK 2.x against v1 client code. The rename is one underscore. The part nobody mentions is that passing your own httpx2 client silently drops the 300 second read timeout to 5 (2026).
Set _meta["anthropic/requiresUserInteraction"] to true and Claude Code prompts for that tool on every call, even in bypassPermissions, and even when an allow rule matches. It shipped in v2.1.199 with no changelog entry, which is why almost nobody has written about it.
MCP error -32000: Connection closed is generated inside the client SDK and is never sent by a server. It means your MCP server process died. Here is how to recover the real error, and a measured correction to the stdout advice (2026).
The exact claude_desktop_config.json setup to connect a local MCP server to Claude Desktop, verify it with the MCP Inspector, and fix a server that will not show up.
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.
A runnable 2026 guide to custom tools in the Claude Agent SDK: define functions with tool() / @tool, bundle them into an in-process MCP server, register with allowedTools, and gate risky calls per argument with canUseTool. TypeScript and Python.
A runnable Python quickstart: install the Claude Agent SDK, stream a run with query(), then give the agent your own tools with the @tool decorator and ClaudeSDKClient. Builds a weather agent that chains two tools.
A runnable 2026 quickstart: install the Claude Agent SDK, wire a custom tool with tool() and createSdkMcpServer(), and let the agent loop call it for you in about 40 lines of TypeScript.
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.