# python-sdk

> python-sdk is an open-source MCP server for developer tools. Python SDK for building MCP servers and clients with type-hinted functions. It is available on CLI, API and self-hosted.

- **Kind:** MCP server
- **Pricing:** Open source
- **Platforms:** CLI, API, self-hosted
- **Website:** https://py.sdk.modelcontextprotocol.io
- **Repository:** https://github.com/modelcontextprotocol/python-sdk
- **GitHub stars:** 24,889
- **License:** MIT
- **Categories:** [developer tools](https://ai-powered.com/categories/developer-tools)
- **Listing updated:** 2026-11-18

## About

The README says the package is the official Python implementation of the Model Context Protocol, and it covers both sides of the wire. You can write a server by decorating ordinary Python functions so they appear as tools or resources, and the SDK derives the input schema from their type hints and docstrings. The same package also includes a client that can connect to remote servers over Streamable HTTP or launch a local server as a stdio subprocess.

The project ships an `mcp` command-line tool, installed through the `cli` extra, with subcommands such as `mcp dev` for opening the MCP Inspector and `mcp run` for serving a file over a chosen transport. Stdio, Streamable HTTP and SSE are the transports listed. The docs also describe mounting an MCP server inside an existing FastAPI or Starlette app.

The SDK is aimed at Python developers who want to expose their own data or actions to LLM applications, or who are building a client that consumes MCP servers. It requires Python 3.11 or newer and is released under the MIT licence.

## Features

- **Decorator-based tool definitions:** Plain Python functions with type hints and docstrings are registered as MCP tools and resources.
- **Client and server in one package:** The same library provides classes for connecting to MCP servers as well as for hosting them.
- **Multiple transports:** Supports stdio, Streamable HTTP and SSE connections.
- **MCP Inspector integration:** The mcp dev command starts the Inspector so you can call tools and read resources interactively.
- **FastAPI and Starlette mounting:** The docs describe adding an MCP server to an existing FastAPI or Starlette application.
- **Published documentation:** Includes a get-started guide, API reference, migration guide and llms.txt index.

## Good for

- Exposing internal Python functions to an LLM assistant as MCP tools
- Prototyping and testing an MCP server with the Inspector before deployment
- Writing a Python client that calls tools on remote MCP servers
- Adding MCP endpoints to an existing FastAPI or Starlette web service

## FAQ

### Which Python versions are supported?

The README lists Python 3.11 and newer as the requirement.

### What transports does the SDK support?

The documentation lists stdio, Streamable HTTP and SSE.

### What license is it released under?

The repository is licensed under the MIT License.

### How do I install it?

The README gives uv add "mcp[cli]" or pip install "mcp[cli]".

### Is python-sdk free?

Yes. python-sdk is open source, so you can use and self-host it for free.

### What are the best alternatives to python-sdk?

The closest alternatives to python-sdk are fastapi_mcp, MCP Foundry — Build, Test & Publish MCP Servers, MCP-Bridge, awesome-mcp-servers and awesome-mcp-servers.

## Where this comes from

- Description: written from the project's README and the project's website.

## Alternatives

- [fastapi_mcp](https://ai-powered.com/mcp/fastapi-mcp): fastapi_mcp is an open-source MCP server for ai models and llm tooling.
- [MCP Foundry — Build, Test & Publish MCP Servers](https://ai-powered.com/mcp/mcp-foundry-build-test-and-publish-mcp-servers): MCP Foundry — Build, Test & Publish MCP Servers is a freemium MCP server for developer tools.
- [MCP-Bridge](https://ai-powered.com/mcp/mcp-bridge-2): MCP-Bridge is an open-source MCP server for ai models and llm tooling.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers): awesome-mcp-servers is an open-source MCP server for ai models and llm tooling.
- [awesome-mcp-servers](https://ai-powered.com/mcp/awesome-mcp-servers-2): awesome-mcp-servers is an open-source MCP server for developer tools.
- [MCP Failure Lab](https://ai-powered.com/mcp/mcp-failure-lab-2): MCP Failure Lab is an open-source MCP server for developer tools.
- [packagecloud MCP by usefulapi](https://ai-powered.com/mcp/packagecloud-mcp-by-usefulapi): packagecloud MCP by usefulapi is a freemium MCP server for developer tools.
- [Apollo MCP Server](https://ai-powered.com/mcp/apollo-mcp-server): Apollo MCP Server is an open-source MCP server for developer tools.

---
Source: https://ai-powered.com/mcp/python-sdk
