Skip to content
Discussion options

You must be logged in to vote

Yes, it is shared. Every tool generated by from_openapi sends its requests through the single client you pass in (client.build_request(...) followed by client.send(...)). Anything stored on that client therefore applies to every MCP session: the cookie jar, default headers, auth, and the connection pool.

I checked this on fastmcp 4.1.0 with an in-process API:

  1. Session A calls a POST /login tool, and the API responds with Set-Cookie: session=....
  2. Session B, a separate Client(mcp), calls GET /whoami.
  3. The API receives cookie: session=<A's value>.

If the upstream API uses cookies for sessions, this leaks state between users. Some options:

  • Disable the cookie jar if you don't need cookies:

    from

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by MicaelJarniac
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants