SDK for using Smithery with Python
Project description
Smithery Python SDK
Build FastMCP servers with Smithery integration - adds session-scoped configuration, and seamless deployment to the Smithery platform.
Installation
# Recommended: using uv
uv add smithery
# Or using pip
pip install smithery
FastMCP Compatibility
When using with existing FastMCP servers, ensure you have compatible versions:
mcp>=1.6.0ORfastmcp>=2.0.0
Usage
from smithery import Server
from pydantic import BaseModel
class ConfigSchema(BaseModel):
debug: bool = False
@Server("My Server", config_schema=ConfigSchema)
def create_server():
pass
@create_server.tool()
def hello(name: str) -> str:
ctx = create_server.get_context()
config = ctx.session_config
# Access config using dot notation: config.debug
return f"Hello, {name}!" + (" (debug)" if config.debug else "")
if __name__ == "__main__":
create_server.run(transport="streamable-http")
For servers without config schema, just use @Server("My Server")
Configuration is passed via URL query parameters: http://localhost:8000/mcp?debug=true
CLI Commands
The SDK includes a CLI for development and testing:
# Initialize a new project
uvx smithery init
# Run server in development mode
uv run smithery dev
# Run server with playground for testing
uv run smithery playground
# Run with specific transport and port
uv run smithery dev --transport shttp --port 8080 --reload
See scaffold for a complete example
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file smithery-0.4.4.tar.gz.
File metadata
- Download URL: smithery-0.4.4.tar.gz
- Upload date:
- Size: 17.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18ae19af8405e6476ca4984036d4460822ec1647ad2262addb4909d03387d671
|
|
| MD5 |
524ead31d5be2abd9c58f016fe53286c
|
|
| BLAKE2b-256 |
1e75d0b0fc1a5c10a20f3e01cefd98276ccbe7b44d74eeb6551bd2f42d8b4768
|
Provenance
The following attestation bundles were made for smithery-0.4.4.tar.gz:
Publisher:
publish-python.yml on smithery-ai/sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
smithery-0.4.4.tar.gz -
Subject digest:
18ae19af8405e6476ca4984036d4460822ec1647ad2262addb4909d03387d671 - Sigstore transparency entry: 637604050
- Sigstore integration time:
-
Permalink:
smithery-ai/sdk@4f23f10cdac5b3915049e31b87473137efb02191 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/smithery-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@4f23f10cdac5b3915049e31b87473137efb02191 -
Trigger Event:
push
-
Statement type:
File details
Details for the file smithery-0.4.4-py3-none-any.whl.
File metadata
- Download URL: smithery-0.4.4-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
883d060b3ecc73a2972019760e342f5a04b62edf18e3bc03594a41851319808a
|
|
| MD5 |
5ff7bf0fe075e635bbbdcb60ea6202ec
|
|
| BLAKE2b-256 |
3054a088fa621c9c76a72a70079fac42b822137a1609ec08525168bd8e9f415d
|
Provenance
The following attestation bundles were made for smithery-0.4.4-py3-none-any.whl:
Publisher:
publish-python.yml on smithery-ai/sdk
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
smithery-0.4.4-py3-none-any.whl -
Subject digest:
883d060b3ecc73a2972019760e342f5a04b62edf18e3bc03594a41851319808a - Sigstore transparency entry: 637604051
- Sigstore integration time:
-
Permalink:
smithery-ai/sdk@4f23f10cdac5b3915049e31b87473137efb02191 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/smithery-ai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-python.yml@4f23f10cdac5b3915049e31b87473137efb02191 -
Trigger Event:
push
-
Statement type: