AI GitHub
MCP Python SDK for servers and clients
Implement Model Context Protocol capabilities in Python.
Key Takeaways
- The SDK provides client and server APIs for protocol exchanges and transport handling.
- Start with a supported Python version and a simple transport.
- Expose a simple deterministic function in a local server and invoke it using a client.
- A callable tool still needs application-level permissions and validation.
How it works
The SDK provides client and server APIs for protocol exchanges and transport handling. Tools, resources and prompts can be registered with implementations in an existing Python application.
What you need
Start with a supported Python version and a simple transport. Use the SDK's examples for the server style that best matches how the application will connect.
What to try first
Expose a simple deterministic function in a local server and invoke it using a client. Confirm input validation and inspect the result shape before connecting a model.
Use a tool that takes an optional argument and a nested input. It makes the behavior of schema generation and server-side errors easy to inspect.
Where to look for failures
A callable tool still needs application-level permissions and validation. Check how errors and cancellation propagate across the transport.
Related Franklin pages
Check tool discovery, argument validation and error behavior before introducing a model. The same fixture can serve as a contract test across server implementations and clients.
- Write MCP servers and clients in TypeScript with typed protocol primitives. MCP TypeScript SDK for protocol integrations
- Turn Python functions and related content into MCP servers with concise definitions. FastMCP for building Python tool servers
Browse Franklin for concrete examples of tools and services exposed through MCP. Franklin’s MCP directory
Project documentation
Try it for your workflow
Explore the project’s documentation for setup and usage, or save this page to a collection for later.
Read the project documentation ↗