#527: MCP Servers for Python Devs

Summary of #527: MCP Servers for Python Devs

by Michael Kennedy

1h 6mNovember 10, 2025

Overview of #527: MCP Servers for Python Devs

This episode of Talk Python to Me (host Michael Kennedy) interviews Den Delamarski (Microsoft, core AI division & Model Context Protocol contributor) about the Model Context Protocol (MCP): a standardized, opinionated "plumbing" layer that lets LLMs/agents talk to tools, apps, data sources and services in a consistent way. The conversation covers what MCP is, how it compares to other approaches (LSP analogy, RAG), Python tooling and SDKs, transports/hosting options, discovery via registries, security and auth, and lots of real-world examples (Blender, Notion, Cloudflare, ad platforms, game engines, podcast editing pipelines).

Key takeaways

  • MCP is a standard protocol that exposes primitives (tools, prompts, resources, elicitations) so LLMs and agentic clients can interact consistently with downstream systems.
  • Think of MCP as "USB‑C for AI": a single, discoverable interface for many tools and data sources rather than bespoke integrations per model/client.
  • MCP emphasizes composability: MCP servers can call other MCP servers; clients, editors, and agents can discover and wire up multiple servers.
  • The official Python SDK and FastMCP make building MCP servers in Python fast and familiar (decorator-based programming, Pydantic for structured outputs, async elicitations, streaming).
  • Security is built-in: the spec supports OAuth 2.1 flows for authorization; but consumers must still exercise caution when granting access.
  • There is a public MCP registry to discover servers; private registries are supported for internal-only servers.

What is MCP (plain language)

  • Purpose: Provide a universal, standard way for AI models/agents to access external capabilities and live data (APIs, apps, DBs, desktop apps, local tools) as well as invoke actions.
  • Core idea: Expose a small set of well-defined primitives (tools, prompts, resources, elicitations) that LLM clients can call, independent of the downstream tech details.
  • Example: A Blender MCP server might expose high-level primitives like create_sphere or set_lighting; an LLM invokes those primitives without knowing Blender's native API.

How MCP compares to related patterns

  • Versus LSP analogy: Like LSP standardized editor-language tooling, MCP standardizes AI-tool connectivity. There are echoes of LSP design, but MCP focuses on AI primitives.
  • Versus RAG (Retrieval-Augmented Generation): RAG augments model context with external text/knowledge (vector DBs, embeddings). MCP complements RAG by exposing live actions/data primitives rather than only document retrieval.
  • Versus plain REST/GraphQL: MCP is opinionated about auth, messaging and tool discovery so integrations behave consistently across servers and clients; avoids 17 different auth dances.

MCP building blocks (concepts)

  • Tools: callable primitives (functions) exposed by the server (e.g., send_email, list_files). For Python developers, a function decorated with @mcp.tool becomes a callable tool.
  • Prompts: reusable templates shipped by servers to guide LLMs on how to use tools (templated instructions).
  • Resources: representations of files, DBs, endpoints or other entities the server exposes to the model.
  • Elicitations: structured requests from the server to the client (or user) to gather required structured input (e.g., a date, select from options). Useful to avoid non-deterministic natural-language parsing.
  • Structured outputs: encourage deterministic responses (Pydantic models recommended in Python SDK).

Security & authorization

  • The MCP spec (updated June) includes an authorization model built on OAuth 2.1 — clients/hosts can bootstrap login flows, store tokens, and use those credentials when accessing private resources.
  • You as a consumer choose which MCP servers to add/install and which credentials to grant — exercise caution before granting broad access (don’t check API keys into Git repos).
  • Private registries are supported for enterprise/internal MCP servers.

Python + SDK + development model

  • Official Python SDK: maintained under the Model Context Protocol org (see repository: github.com/model-context-protocol/python-sdk).
  • FastMCP: FastAPI-like helper library for rapidly composing MCP servers; it simplifies auth and the server programming model.
  • Programming model: decorator-based (e.g., @mcp.tool, @mcp.prompt) similar to how FastAPI/Flask style decorators work — very familiar for Python web devs.
  • Structured I/O: use Pydantic models to define expected structured responses from model interactions.
  • Streaming & progress: the SDK supports streaming partial results and progress reporting so clients can show intermediate progress.
  • Servers can run as:
    • stdio (local stdin/stdout JSON-RPC pipes) — good for local, editor-embedded flows
    • streamable HTTP servers — hostable on cloud, home lab, container etc.
  • MCP servers can act as MCP clients (chain servers together); this enables composition and orchestration of multiple capabilities.

Discovery & ecosystem

  • MCP Registry: a centralized index/API launched (Sept 2025) to discover public MCP servers. There are also other registries (e.g., Glama AI) and GitHub indexing (github.com/mcp).
  • Many prebuilt MCP servers already exist (awesome lists): Blender, Notion, Cloudflare, MongoDB, Jira/Atlassian, ad platforms (Google/Facebook), DoorDash, Strava, Unity, chess, game telemetry, text‑to‑speech, podcast tooling, and many niche specialty servers.
  • Use cases span consumer apps, enterprise data access, developer tooling, game engines, multimedia pipelines, marketing analytics and more.

Hosting, transports and local-first workflows

  • You can host MCP servers anywhere Python runs: cloud providers, home lab, Raspberry Pi, a container behind Nginx, etc.
  • Local-only privacy: run local models & MCP servers for sensitive tasks (e.g., personal photos or local transcripts) — combine local tooling with MCP primitives.
  • Networking tip: Tailscale (WireGuard overlay) is useful for exposing local MCP servers securely without opening public ports; helps remote access from clients/agents without public exposure.

Example: Podcast production pipeline (practical MCP example)

  • Components:
    • Audio processing tool (ffmpeg) exposed as MCP primitives
    • Transcription tool (Whisper) exposed as generate_transcript
    • Podcast site tooling (create landing page)
    • Cloud upload (Cloudflare) MCP server for file hosting
    • Audio cleanup (Descript‑like) MCP server
  • Flow:
    • LLM/agent invokes generate_transcript for episode #200
    • Server elicits missing structured inputs (e.g., episode metadata)
    • Chains uploads and publishes using the Cloudflare MCP server
  • Benefits: automates transcript generation, highlights extraction, timestamps and site publishing with composable primitives.

Practical recommendations / next steps

  1. Explore:
    • MCP docs and guides on modelcontextprotocol.io
    • MCP registry and GitHub org (github.com/mcp and github.com/model-context-protocol)
  2. Try the Python SDK:
    • Clone the Python SDK repo and run sample servers.
    • Add @mcp.tool decorated functions and test as a stdio or HTTP MCP server.
  3. Use FastMCP for rapid prototyping: it provides common server primitives, auth helpers, streaming and structured I/O integration.
  4. Start small and local: expose one narrow, well‑specified tool (e.g., transcript generator or file manager) and add Pydantic schemas for deterministic outputs.
  5. Be careful with credentials: use OAuth flows, avoid storing API keys in public repos, and consider private registries for internal services.
  6. Consider Tailscale or similar overlay networks to securely expose local MCP servers to your clients without public ports.

Notable quotes & metaphors

  • "MCP is USB‑C for AI." — (summary of how MCP standardizes connections between models and external capabilities)
  • "Think of MCP servers as a universal translation layer — you do it once and it just works across editors and agents." — Den Delamarski
  • "Tools = functions; add a decorator and the function becomes an LLM-invokable primitive." — paraphrase describing the Python dev experience

Useful links (from the episode)

  • Model Context Protocol Python SDK: github.com/model-context-protocol/python-sdk
  • MCP Registry & GitHub index: github.com/mcp (registry/index of MCP servers)
  • FastMCP: fast MCP helper libraries (look under the MCP GitHub org / FastMCP projects)
  • Glama AI / PunkPa: an ecosystem registry (awesome lists of MCP servers)

Closing notes

MCP is about standardizing how agents and LLMs access live data and actions so tooling becomes portable and composable. For Python devs it offers a familiar, decorator-based dev experience, Pydantic structured outputs, and the ability to prototype locally or host in cloud/home lab setups. Start with a narrow server, use the Python SDK and FastMCP, register or discover servers in registries, and always treat authorization and access with caution.