GitHub - danlapid/python-workers-mcp

Python Workers: FastMCP Example

This is an example of a Python Worker that uses the FastMCP package.

Deploy to Workers

Note

Due to the size of the Worker, this example can only be deployed if you're using the Workers Paid plan. Free plan users will encounter deployment errors because this Worker exceeds the 3MB size limit.

Developing and Deploying

To develop your Worker run:

To deploy your Worker run:

Testing

To test run:

Linting and Formatting

This project uses Ruff for linting and formatting:

uv ruff format . --check
uv ruff check .

IDE Integration

To have good autocompletions in your IDE simply select .venv-workers/bin/python as your IDE's interpreter.