The away fixture — shipping to production.
From a program on your laptop to a service others can call — same tool, new plumbing.
“Deploying” an MCP server sounds heavy, but it is not a special act. It just means deciding where the server runs and how clients reach it. The tool code you already wrote — the @mcp.tool() functions — does not change at all.
There are three stages, and they are the same server each time. On your machine, over stdio, the client launches it as a local program (where we have been so far). Across your machine, you run it as a small web service on localhost, so several local apps share one running copy. In production, you host that same web service so authorized people can reach it over the internet.
Only two things change as you move outward: the transport line at the bottom of your file, and where you run it. Going to production adds the ordinary duties of any web service — HTTPS, authentication, hosting — but nothing about the tool itself.
Flip between the three stages and watch exactly what changes — and what stays untouched.
@mcp.tool() · async def offside_calls(player, season) -> str
- Switch transport to Streamable HTTP and bind to
0.0.0.0so the host can accept outside connections. - Serve over HTTPS. Terminate TLS at a reverse proxy or load balancer in front of the server.
- Require authentication. Only authorized clients may call — MCP supports OAuth 2.1 for HTTP; at minimum, check an API token.
- Host it like any service: a container or VM kept alive by a process manager (Docker, systemd, or a cloud platform).
- Validate every input. Never trust arguments blindly — a caller could send anything. Guard, limit, and sanitise.
- Log and monitor calls, and version your tools so changing one does not break clients already using it.
Same tool. Different plumbing.
A local stdio server, a localhost web service, and a hosted production service are the same MCP server — the difference is one transport line and where it runs. The model, the client, and your tool functions behave identically; only the address and the framing change.
So build once over stdio, prove it works, then take it on tour: flip the transport to Streamable HTTP, put it behind HTTPS and auth, and host it. Production is not a rewrite — it is the same server, wired to reach further.