MCP Python SDK

Active
GitHub Python MIT

Description

MCP Python SDK is the official Python implementation for building MCP servers and agent-side integrations with a standardized tool protocol.

Key Features

  • FastMCP high-level interface — quickly define MCP Server tools, resources and prompts with decorators
  • Multi-transport support — supports stdio, SSE and Streamable HTTP standard transport methods
  • Structured output — tool return values automatically serialized into structured JSON responses
  • Resource and prompt system — expose data via Resources, define interaction templates via Prompts
  • OAuth authentication support — built-in OAuth authentication flow in client
  • ASGI mounting — mountable into existing FastAPI/Starlette apps as sub-applications

Use Cases

💡 Quickly build MCP Servers exposing database query capabilities for LLM applications
💡 Wrap existing Python APIs into MCP-compatible tool services for agent invocation
💡 Build local MCP Servers connected to Claude Desktop for tool extensions
💡 Mount MCP Servers in FastAPI apps to provide standardized LLM context interfaces
💡 Build MCP clients to connect to and invoke any standard MCP Server

Strengths & Limitations

Strengths

  • Actively maintained, recent updates
  • High community interest (24.0k stars)
  • Permissive open-source license (MIT)

Categories

Quick Start

uv init mcp-server-demo
cd mcp-server-demo
uv add "mcp[cli]"

# server.py
from mcp.server.fastmcp import FastMCP

mcp = FastMCP("Demo", json_response=True)

@mcp.tool()
def add(a: int, b: int) -> int:
    """Add two numbers"""
    return a + b

@mcp.resource("greeting://{name}")
def get_greeting(name: str) -> str:
    return f"Hello, {name}!"

if __name__ == "__main__":
    mcp.run(transport="streamable-http")

Related Projects

MCP Use

10.5k · TypeScript
Active A+

MCP Use is a Model Context Protocol orchestration project that helps agents connect to MCP servers, unify tool invocation, and improve portability across toolchains.

mcptoolsprotocol +1
  • · Fullstack MCP framework with SDK for both TypeScript and Python
  • · Build MCP Servers with typed tool definitions and Zod schema validation
  • · MCP Apps — interactive React widgets that work across Claude, ChatGPT, and other clients

FastMCP

27.2k · Python
Active A+

FastMCP is a fast, Pythonic library for building MCP servers and clients with over 1 million daily downloads, making it easy to create Model Context Protocol tools.

mcpserverprotocol +2
  • · Decorator-Based Tools — Create MCP tools with Python functions and @mcp.tool decorator, auto-generating schema and docs
  • · MCP Client — Connect to any MCP server (local or remote) with full protocol handshake and session management
  • · Interactive Apps — Generate interactive UIs for tools that render directly in conversations

Awesome Claude Skills

72.6k · Python
Active A

A curated list of awesome Claude Skills, resources and tools for customizing Claude AI workflows.

mcptoolspython +1
  • · 1000+ production-ready skills - Covering 9 categories including document processing, dev tools, data analysis, marketing, and writing
  • · Cross-agent compatible - Works with Claude Code, Claude.ai, OpenAI Codex, Cursor, Gemini CLI, Windsurf and more
  • · Progressive loading architecture - Each skill loads only name and description (~100 tokens), full content on demand, hundreds coexist

Related Articles