-
Book Overview & Buying
-
Table Of Contents
Ship an MCP Server in Python - Fast
By :
When you expose an MCP server over HTTP, keep the shape simple and predictable: route everything through a single MCP endpoint. Clients POST JSON-RPC messages to that endpoint, and the server replies either as one JSON response (application/json) or as a stream (text/event-stream) for long-running calls. The MCP mental model doesn’t change: the client still performs the JSON-RPC initialize/initialized handshake before any tool call. Treat that handshake as your “open for business” gate, regardless of transport.
If you’re using FastMCP, this will look something like:
if __name__ == “__main__”:
mcp.run(transport=”streamable-http”)
By default, connect Inspector/clients to http://localhost:8000/mcp (the path may be configurable depending on how you mount the app).
Design checklist: server contract for Streamable HTTP
Change the font size
Change margin width
Change background colour