smithery_migrate_stdio_to_http
Count occurrences of any character in your text instantly. Toggle case sensitivity to refine matches. Use it for validation, parsing, and quick text analysis.
Ask AI about smithery_migrate_stdio_to_http
Powered by Claude · Grounded in docs
I know everything about smithery_migrate_stdio_to_http. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Python MCP Server with FastMCP
A simple Python MCP server built using the official MCP Python SDK and FastMCP. This example demonstrates how you can host streamable HTTP servers on Smithery, with STDIO support for backwards compatibility.
See the complete guide: https://smithery.ai/docs/migrations/python-custom-container
Features:
- CORS: CORS headers for browser-based MCP clients
- Smithery Session Configuration: handles JSON session configuration passed via query parameters (learn more)
- Server Transport: Can run with both STDIO and HTTP transports using
TRANSPORTenv variable
Prerequisites
- Python 3.12 or higher
- uv package manager
- npx (optional, to launch smithery playground)
Project Structure
src/main.py- Main FastAPI server with MCP HTTP transportsrc/middleware.py- Custom middleware to extract session configurationpyproject.toml- Python dependencies and project configurationsmithery.yaml- Smithery deployment configurationDockerfile- Dockerfile to host server in Smitheryuv.lock- Lockfile for Python dependencies
Quick Start
-
Install dependencies:
uv sync -
Run the development server:
HTTP Mode:
TRANSPORT=http uv run python main.pySTDIO Mode (default):
uv run python main.py -
Test interactively: Once your server is running in HTTP mode, you can test it interactively using the Smithery playground (set port to match your server):
npx -y @smithery/cli playground --port 8080
-
Deploy your own version: To deploy your own MCP server:
- Connect your repository at https://smithery.ai/new
