Separate MCP server vs. mounting MCP in FastAPI: does the extra hop matter?
DetectiveNew8385 · reddit · 2026-11-18
A developer built a small MCP server with FastMCP (Python SDK, Streamable HTTP, stateless) and is weighing two architectures for exposing an existing FastAPI REST API to an LLM:
- Option A: a separate MCP server calling the API over HTTP — adds a network hop per tool call, but on localhost/same-region it's a few ms, negligible next to LLM inference (seconds) and upstream calls (hundreds of ms); could add up with chatty tools or many sequential calls.
- Option B: mount the MCP app inside the same FastAPI service sharing the service layer — no hop and shared code, but couples MCP deployment to the API.
The author leans toward A's overhead being acceptable in most cases and is gathering practical input before scaling up.
More from coding & agent
- Dev rebuilds all of Singapore in 1:1 scale with 100+ Astra Codex threads and 1,000+ subagents — gabrielchua · 2026-11-18
- Coinbase Ventures maps the agentic trading stack: where value accrues when agents trade — davidyin44 · 2026-11-18
- Granola Launches an Agent-Facing Version: 1M+ Notes Read by Agents Daily — soleio · 2026-11-18
- Dev moves 100% of work to Devin Bots: a CTO bot orchestrates all agents via iMessage — smtabatabaie · 2026-11-18
- Microsoft ships MAI Code 2 and Code 2 Flash coding models into GitHub Copilot — marlene_zw · 2026-11-18
- Microsoft launches Agent 365 Business Analytics to track agent spend and ROI — donasarkar · 2026-11-18