# MCP Python SDK

CreateWithAI Hub page: https://createwithaihub.com/apis-sdks/mcp-python-sdk
Latest version of this file: https://createwithaihub.com/apis-sdks/mcp-python-sdk.md

- Type: API / SDK · Category: APIs & SDKs
- Publisher: Model Context Protocol project
- Pricing: Free · License: MIT
- Runs on: macOS, Windows, Linux

Official Python SDK for building Model Context Protocol servers and clients, with an optional mcp CLI.

The MCP Python SDK is the official Python implementation of the Model Context Protocol. It lets you build MCP servers that expose tools, resources and prompts to any MCP host, and MCP clients that connect to any server, over stdio, Streamable HTTP and SSE. The optional cli extra adds the mcp command for running and testing servers during development.

Useful for: Writing a small Python MCP server that gives an AI assistant access to your scripts, files or APIs, or connecting a Python agent to existing MCP servers.

## Key features

- Build MCP servers with tools, resources and prompts
- Build MCP clients that connect to any MCP server
- stdio, Streamable HTTP and SSE transports
- mcp CLI (mcp dev, mcp run, mcp install) via the cli extra

## Connection

- SDK language: Python

## Before you start

- Python 3.11+

## Install steps from the official documentation

Install with uv:

```
uv add "mcp[cli]"
```

Install with pip:

```
pip install "mcp[cli]"
```

## Official links

- Website: https://modelcontextprotocol.io
- Source repository: https://github.com/modelcontextprotocol/python-sdk
- Documentation: https://py.sdk.modelcontextprotocol.io/
- Source: https://github.com/modelcontextprotocol/python-sdk (Features, transports, Python 3.11+ requirement, install command; MIT via GitHub API; not archived)
