You know that feeling when you've built the same database connector for the fifth fucking time? OpenAI format, Claude format, whatever-new-AI-startup format - it never ends. The MCP Python SDK fixes this nightmare by letting you build one server that talks to everything.
I spent three weeks rebuilding the same PostgreSQL connector for different clients last month. MCP means I build it once, deploy it once, and everything just works. Claude Desktop, browser apps, mobile clients - they all use the same damn protocol.
The basic architecture is simple: MCP Servers expose tools/resources to MCP Clients, which feed context to AI hosts like Claude Desktop.
Check the official architecture guide - it's actually readable, which shocked me after dealing with most protocol docs.
FastMCP Framework
The SDK's FastMCP framework means you don't have to learn the protocol. Just write Python functions and slap decorators on them:
@mcp.tool()
def get_user_data(user_id: int) -> dict:
"""Fetch user data from database."""
# Your actual database logic here
return {"user_id": user_id, "name": "John Doe"}
FastMCP reads your type hints and generates the JSON schemas automatically. You write normal functions, it handles all the protocol bullshit in the background.
Transport Options
Stdio transport - Works great with Claude Desktop until Claude randomly stops recognizing your server (happens more than it should). The client spawns your Python script and talks through stdin/stdout. Perfect for development, less reliable than you'd hope.
SSE (Server-Sent Events) - For web apps. Browser clients connect through server-sent events, though you'll spend time debugging CORS issues. The MCP Inspector uses this, and it mostly works.
HTTP transport - The production-ready option. Scales horizontally, works with load balancers, and you can mount it inside existing FastAPI apps. This is what you want for anything serious.
Security and Authentication
OAuth 2.1 is built in, which actually works unlike some OAuth implementations I've suffered through. Standard flows, token refresh, the whole deal without the usual auth framework headaches.
Python Requirements
Python 3.10 minimum. Don't try running this on Python 3.9 - it'll break in mysterious ways. Dependencies are Pydantic for validation, anyio for async stuff, and httpx for HTTP.
Drops right into existing FastAPI or Django projects. No framework conflicts, no weird import issues. Just works.