
python-sdk
Python SDK for building MCP servers and clients with type-hinted functions
The repository was last updated 2 days ago and is published under MIT.
- Pricing
- Open source
- Platforms
- CLI, API, self-hosted
- GitHub stars
- 24.9K
- Last commit
- 2 days ago
- Language
- Python
- License
- MIT
Similar MCP servers
About python-sdk
python-sdk is an open-source MCP server for developer tools. It is available on CLI, API and self-hosted.
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.
What it does
- 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
Pricing
Open source
Free and MIT licensed
Prices change. Check py.sdk.modelcontextprotocol.io before you buy.
python-sdk 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.


