Cloudflare Python Workers hit GA: FastAPI and openai at the edge

After a two-year preview, Python is a first-class Worker: web frameworks, the openai and mcp SDKs, and Postgres over sockets all run — minus threads.

Nowline SEP 22 3:00 AM banner

Top AI stories from the last hour

Top AI stories from the last hour

Copy markdown

  • FastAPI, Django and Flask run as-is

    Built-in ASGI/WSGI connectors let you deploy a real Python web app to Workers with no separate server and no JavaScript shim — your existing FastAPI or Flask project becomes an edge deploy.

  • openai, langchain and mcp finally import

    Upstream fixes route their HTTP clients through fetch inside WebAssembly, so the AI SDKs work — and Python gets native bindings to Workers AI, R2, D1, Durable Objects, Queues and Workflows with automatic type conversion, no glue.

  • Postgres and MySQL over real TCP

    Cloudflare added TCP socket syscalls in WebAssembly, so asyncpg and aiomysql connect through Hyperdrive natively. A Python Worker can now talk straight to your database.

  • The catch: no threads, no multiprocessing

    It's Pyodide compiled to WASM in the workerd runtime, so threading and multiprocessing are dead and parts of the stdlib are missing. Simon Willison notes local dev runs through pywrangler, confusingly shipped as workers-py on PyPI.

  • Build this weekend: an edge MCP server in Python

    With the mcp library plus a Workers AI binding, you can stand up a globally distributed MCP server in a few dozen lines of Python — no container, no cold-start babysitting, deployed to Cloudflare's edge.

  • Elsewhere: a continual-learning model on an 8 GB GPU

    Mini-AGI, an MIT byte-level model (540M params across 169 experts paged from disk), trains from scratch on a single 8 GB VRAM GPU and keeps learning without catastrophic forgetting. It's toy-level and the weights aren't published yet, but it's climbing Hacker News.