Building an MCP server in Python (and connecting it to Claude Code)

An MCP server lets an AI model call your own tools. Here's how to build one in Python with the official SDK and connect it to Claude Code — tested end to end.