Skip to content

Restrict Server Messages to Initialized Clients with Appropriate Capabilities #15

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

Closed
tzolov opened this issue Feb 18, 2025 · 1 comment
Labels
bug Something isn't working lifecycle server
Milestone

Comments

@tzolov
Copy link
Contributor

tzolov commented Feb 18, 2025

Ensure that server sends notifications only to initialized clients with appropriate capabilities

Expected Behavior

  • Send notifications only to initialized clients
  • For client initiated request/response operations (e.g. all server features) return a single response only to the client-session that has initiated the request.
  • Send Root and Sampling requests only to the client that initiated the current session and only if they provide those capabilities

Current Behavior

Server broadcasts notifications and requests without checking:

  • Client initialization state
  • Client capabilities
  • Session ownership
@tzolov tzolov added the bug Something isn't working label Feb 27, 2025
@tzolov tzolov added this to the 0.8.0 milestone Feb 27, 2025
tzolov added a commit that referenced this issue Mar 20, 2025
This commit introduces a major refactoring of the MCP Java SDK to implement a session-based architecture
for server-side implementations. The changes improve the SDK's ability to handle multiple concurrent
client connections and provide an API better aligned with the MCP specification.

Key changes:

- Introduce McpServerTransportProvider interface to manage client connections
- Rename ClientMcpTransport to McpClientTransport and ServerMcpTransport to McpServerTransport
- Add exchange objects (McpAsyncServerExchange, McpSyncServerExchange) for client interaction
- Update handler signatures to include exchange parameter: (args) -> result to (exchange, args) -> result
- Rename Registration classes to Specification classes
- Update method names (e.g., rootsChangeConsumers to rootsChangeHandlers)
- Deprecate old interfaces and classes for removal in 0.9.0
- Add migration guide (migration-0.8.0.md)

Resolves #9, #15

Co-authored-by: Dariusz Jędrzejczyk <[email protected]>
Signed-off-by: Christian Tzolov <[email protected]>
@tzolov
Copy link
Contributor Author

tzolov commented Mar 20, 2025

Resolved by #31

@tzolov tzolov closed this as completed Mar 20, 2025
tzolov added a commit that referenced this issue Mar 20, 2025
This commit introduces a major refactoring of the MCP Java SDK to implement a session-based architecture
for server-side implementations. The changes improve the SDK's ability to handle multiple concurrent
client connections and provide an API better aligned with the MCP specification.

Key changes:

- Introduce McpServerTransportProvider interface to manage client connections
- Rename ClientMcpTransport to McpClientTransport and ServerMcpTransport to McpServerTransport
- Add exchange objects (McpAsyncServerExchange, McpSyncServerExchange) for client interaction
- Update handler signatures to include exchange parameter: (args) -> result to (exchange, args) -> result
- Rename Registration classes to Specification classes
- Update method names (e.g., rootsChangeConsumers to rootsChangeHandlers)
- Deprecate old interfaces and classes for removal in 0.9.0
- Add migration guide (migration-0.8.0.md)

Resolves #9, #15

Co-authored-by: Christian Tzolov <[email protected]>
Signed-off-by: Christian Tzolov <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lifecycle server
Projects
None yet
Development

No branches or pull requests

1 participant