Skip to content

Allow MCP servers to "resume state" #192

@stippi

Description

@stippi

Is your feature request related to a problem? Please describe.
Let me describe the problem/need using the example of the Claude Desktop app as MCP client: For my MCP server, I let users configure a bunch of projects the server should know about. Then, I expose an "open_project" tool, that Claude can execute. This establishes state in the MCP server. Other tools such as "list_files" take the opened project as context. When I resume a chat within Claude Desktop in which a project was opened, I need some way of "restoring state". Currently, I have to tell Claude "Oh, and you need to open the project again, btw".

Describe the solution you'd like
One simple solution could be this:

Introduce the concept of a "state JSON". The MCP server can send a notification that the state has updated, which causes the MCP client to pull it and store it somehow. Claude Desktop for example would store the state along with the individual chat. One caveat is branching within the chat. Maybe Claude Desktop would have to store multiple states, whenever there was a change, and track at which point in the chat the state changed, such that when the user branches off by editing a message, the state is restored to that point in time. Whenever the MCP client is resuming a session, it can then restore the state by sending a set_state message. The actual state is opaque of course, the server would implement the interpretation of the state. I would leave versioning the state JSON up to the MCP server implementation and not put it into the protocol itself.

Describe alternatives you've considered
There could also be a session identification or something, that the MCP server could use to run its own state management. That however would have all MCP servers that need this re-implement state management. I'd rather have this feature in the clients, especially because of the chat branching described above.

Additional context
None.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions