DeployContext supports Python MCP servers out of the box. Build with FastAPI, uvicorn, and the official MCP Python SDK—we handle the rest.
requirements.txt or pyproject.toml filemcp package in your dependenciesDeployContext automatically detects Python projects by looking for:
| File | Runtime |
|---|---|
requirements.txt | Python |
pyproject.toml | Python |
package.json | Node.js |
Your requirements.txt should include:
mcp>=1.0.0
fastapi>=0.115.0
uvicorn[standard]>=0.32.0
sse-starlette>=2.1.0Your Python MCP server needs these endpoints:
GET /health — Health check endpointGET /sse — SSE endpoint for MCP communicationPOST /message — Message endpoint for receiving MCP requestsEnsure your repository is public or accessible to DeployContext.
Navigate to Deploy New MCP.
We'll automatically detect Python and validate the MCP SDK.
Set your MCP name, description, and click Deploy.
DeployContext looks for your Python entry point in this order:
server.pymain.pyapp.pysrc/server.pysrc/main.pyThese environment variables are available at runtime:
PORT — The port your server should listen on (default: 8081)MESSAGE_ENDPOINT — The message endpoint URL for SSEPython MCPs can use different transport modes:
--transport sse flagDeployContext automatically detects your transport mode and handles it appropriately. For native HTTP/SSE MCPs (recommended), you control the server directly. For stdio MCPs, the bridge handles the conversion automatically.
Ensure you have a requirements.txt or pyproject.toml in your repository root.
Add mcp>=1.0.0 to your dependencies.
Make sure your server listens on 0.0.0.0 and uses the PORT environment variable.
Ensure your /sse endpoint sends the endpoint event with the session ID.
If using hatchling, ensure your pyproject.toml has proper package configuration. DeployContext prefers pyproject.toml over requirements.txt when both exist.
See a complete working Python MCP server with text utilities:
View on GitHub →