{
 "schema_version": 1,
 "generated": "2026-10-31",
 "id": "modelcontextprotocol-python-sdk--serve-mcp-over-http-and-call-it-from-python",
 "repo": "modelcontextprotocol/python-sdk",
 "repo_url": "https://github.com/modelcontextprotocol/python-sdk",
 "repo_slug": "modelcontextprotocol-python-sdk",
 "title": "Serve an MCP server over HTTP and call it from Python",
 "page_title": "How to serve an MCP server over HTTP and call it from Python with Python SDK",
 "summary": "Run your server with Streamable HTTP and connect the SDK's Client to it with a URL.",
 "who": "An engineer preparing to deploy an MCP server rather than run it as a local subprocess.",
 "problem": "Local stdio servers are fine for one laptop, but a shared server needs an HTTP transport and a client to test it.",
 "outcome": "A server reachable at a URL and a short Python client that calls its tools and prints structured results.",
 "steps": [
  "Install with `uv add \"mcp[cli]\"`",
  "Serve your server with `uv run mcp run server.py --transport streamable-http`",
  "Write a client that opens Client(\"http://localhost:8000/mcp\") and calls call_tool, as in the README",
  "Read result.structured_content for the output",
  "See the Clients docs to launch a local server as a stdio subprocess instead"
 ],
 "agent_prompt": "Using modelcontextprotocol/python-sdk, serve my server.py with `uv run mcp run server.py --transport streamable-http` and write a Python client that calls <tool> with <arguments> and prints the structured result.",
 "agents": [
  "claude-code",
  "codex",
  "cursor"
 ],
 "difficulty": "Intermediate",
 "time": "20 minutes",
 "basis": "readme",
 "caveat": "The README example runs on localhost with no authentication; add auth before exposing a server beyond your machine.",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "python",
 "requirements": [
  "Python 3.11 or later",
  "uv or pip",
  "The cli extra for the mcp command-line tool",
  "Optional: the MCP Inspector, which mcp dev opens"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/modelcontextprotocol-python-sdk/serve-mcp-over-http-and-call-it-from-python/",
 "md": "https://dedupedai.com/use-cases/modelcontextprotocol-python-sdk/serve-mcp-over-http-and-call-it-from-python/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/modelcontextprotocol-python-sdk--serve-mcp-over-http-and-call-it-from-python.json",
 "api_version": "v1"
}
