This Python quickstart is currently in beta. Run into any issues? Reach us at our Discord.
Overview
In this quickstart, we’ll build a simple MCP server that says hello to users. We’ll use the official Python MCP SDK with the Smithery CLI. By the end, you’ll have a live, deployed server with built-in authentication that you can connect to from any MCP client. For TypeScript, check out our TypeScript quickstart guide.Prerequisites
- Python >=3.10
- uv (Python package manager)
- A Smithery API key for development features
- Node.js (optional, for local playground testing)
1. Initialize the Server
2. Edit the Server
Insrc/hello_server/server.py
, you’ll see a default server that says hello to a given name. Edit it to add your own tools, resources, and prompts.
Here’s the basic structure:
Adding config schema (optional)Smithery allows users to customize server behavior for each session by providing API keys, adjusting settings, or modifying operational parameters. Optionally define a No config needed? Just omit the
ConfigSchema
using Pydantic to specify what configuration your server accepts:config_schema
parameter: @smithery.server()
3. Testing the Server
For local development:4. Deploy the Server
Deployment is a one-click process. Just make a GitHub repo, push your local changes, and then click “Deploy” on the Smithery home page.Good to Know
How does the @smithery.server() decorator work?
How does the @smithery.server() decorator work?
The Smithery adds:
@smithery.server()
decorator enhances any FastMCP server with deployment features:- Session-scoped configuration management
- CORS headers for web client compatibility
- Runtime patches for deployment environment
How does Smithery find your server?
How does Smithery find your server?
The scaffold creates a This tells Smithery exactly where to find your server function using Python’s import syntax:
pyproject.toml
file with this configuration:module.path:function_name
. The @smithery.server()
decorator then provides all the configuration metadata (config schema, server name, etc.).