Cette page est affichée en anglais. Une traduction française est en cours.
ScriptsMay 11, 2026·2 min de lecture

MCP Python SDK — Build MCP Servers & Clients

Build MCP servers and clients in Python with FastMCP, plus a CLI for dev and install flows; supports stdio, SSE, and Streamable HTTP transports.

MCP Hub
MCP Hub · Community
Prêt pour agents

Staging sûr pour cet actif

Cet actif est d'abord staged. Le prompt copié demande à l'agent d'inspecter les fichiers staged avant d'activer scripts, config MCP ou config globale.

Stage only · 17/100Policy : staging
Surface agent
Tout agent MCP/CLI
Type
CLI Tool
Installation
Stage only
Confiance
Confiance : Established
Point d'entrée
Asset
Commande de staging sûr
npx -y tokrepo@latest install 06ee3ea4-e573-4f6c-8cc4-cef1c1cc8de0 --target codex

Stage les fichiers d'abord; l'activation exige la revue du README et du plan staged.

Introduction

Build MCP servers and clients in Python with FastMCP, plus a CLI for dev and install flows; supports stdio, SSE, and Streamable HTTP transports.

  • Best for: Python teams building their own MCP tools (servers) or integrating MCP into internal agent runtimes
  • Works with: Python, uv/pip workflows, MCP transports (stdio/SSE/streamable HTTP) and FastMCP decorators
  • Setup time: 15 minutes

Quantitative Notes

  • PyPI install group: mcp[cli] (repo docs)
  • GitHub stars + forks (verified): see Source & Thanks
  • Setup time ~15 minutes (Python env + one demo server + inspector)

Practical Notes

A minimal, reliable path is: build one FastMCP server with 1–2 tools, run it in dev mode, then validate with the official inspector. Only after that, add auth/env handling and move to HTTP transports. If you’re using Claude Code, prefer explicit install steps and keep tool inputs narrow and typed.

Safety note: Don’t expose unconstrained exec/file tools over HTTP without an allowlist and auditing; MCP transports are powerful by design.

FAQ

Q: Is this only for servers? A: No. The SDK supports both building servers and writing MCP clients that connect to servers.

Q: Which transport should I pick? A: Use stdio for local tools, and Streamable HTTP for production-like deployments; SSE is also supported.

Q: Do I need uv? A: No. uv is recommended in docs, but pip works too (pip install "mcp[cli]").


🙏

Source et remerciements

GitHub: https://github.com/modelcontextprotocol/python-sdk Owner avatar: https://avatars.githubusercontent.com/u/182288589?v=4 License (SPDX): MIT GitHub stars (verified via api.github.com/repos/modelcontextprotocol/python-sdk): 22,953 GitHub forks (verified via api.github.com/repos/modelcontextprotocol/python-sdk): 3,411

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires