Metadata-Version: 2.4
Name: smithery
Version: 0.3.2
Summary: SDK for using Smithery with Python
Author: Smithery Team
Author-email: Smithery Team <contact@smithery.ai>
License-Expression: MIT
Classifier: Operating System :: OS Independent
Requires-Dist: mcp>=1.13.1
Requires-Dist: toml>=0.10.2
Requires-Dist: typer>=0.17.3
Requires-Dist: art>=6.3
Requires-Dist: uvicorn>=0.30.0
Requires-Dist: ruff==0.12.11 ; extra == 'dev'
Requires-Python: >=3.10
Project-URL: Bug Tracker, https://github.com/smithery-ai/python-sdk/issues
Project-URL: Homepage, https://github.com/smithery-ai/python-sdk
Provides-Extra: dev
Description-Content-Type: text/markdown

# Smithery Python SDK

Build FastMCP servers with Smithery integration - adds session-scoped configuration, and seamless deployment to the Smithery platform.

## Installation

```bash
# Recommended: using uv
uv add smithery

# Or using pip
pip install smithery
```

## Usage

```python
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:

```bash
# 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](scaffold/) for a complete example