Skip to content

Server-side Stateful Sessions #129

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
headlessButSmart opened this issue Apr 8, 2025 · 1 comment
Open

Server-side Stateful Sessions #129

headlessButSmart opened this issue Apr 8, 2025 · 1 comment

Comments

@headlessButSmart
Copy link

During integration of MCP Server capabilities into our platform, we've come across a use case where we need to utilize certain session specific parameters across all RPC calls during the session. We are utilizing our own transport layer and utilizing core functionality only with a different approach to sessions, so this may not be 100% relevant for all, but, two minor changes would open up new capabilities:

  1. Adding a generic "Map<String, Object> sessionParameters" variable to McpServerSession
  2. Making "session" variable within McpAsyncServerExchange & McpSyncServerExchange accessible

With these two, information such as requestor profile can be passed with an initial request and made accessible in tool calls:

(exchange, arguments) -> {
	McpServerSession session = exchange.getSession();
	Map<String, Object> sessionParameters = session.getSessionParameters();
	//Enriched tool call with arguments & sessionParameters
}
@krzysztof-osiecki
Copy link

We have similar case and the proposed solution would be great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants