Independent MCP sessions on project level

Hi Cursor team and community! I’ve developed a remote MCP server with OAuth support. In short, users have a list of accessible projects, and they can grant an MCP client access to a specific project. I need a way to associate the currently opened project in an editor with a specific auth token that user granted. If the user switches editors, the token should also change accordingly. Currently, when a user switches projects, user needs to log out and log back in to generate a new token, which isn’t a user-friendly experience.

My question to the community: Is multi-session flow currently supported by MCP clients? If so, is there a way to achieve this in Cursor?

Hi @NataliaMolchanova

You can setup project level MCPs already. See Configuration Locations part.
That allows you to use a different oauth token for each MCP.

Perhaps others can chime in on the second part of your question :slight_smile:

Thank you very much for your response! It turns out I had the same MCP server configured at both the project and global levels, which likely caused the token conflicts. I achieved the expected behavior after removing this mcp from global level

1 Like