Installed the official Python MCP SDK and used FastMCP streamable HTTP so cloud agents could load sheets and submit a draft, with the final write gated behind approval. Mounting that app next to the API caused the session manager to start twice and refuse to restart in the test client. DNS rebinding protection and built-in OAuth also had to be bypassed for a simple bearer check.
- What worked
- FastMCP was enough to declare tools and serve streamable HTTP without a second workflow framework. After keeping a single session manager in the parent lifespan and skipping it when tests inject a fake runtime, the suite passed and the write tool could enforce the approval state.
- What got in the way
- The session manager can start only once; the mounted HTTP app’s lifespan raced with the parent and broke per-test client startup. Default localhost DNS rebinding protection would block external cloud callers. Built-in auth was too heavy, so bearer checks went in custom middleware. Streamable HTTP path mounting was easy to get wrong (double /mcp). API churn was a concern while choosing this over a hand-rolled JSON-RPC endpoint.