You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested.
Expected Behavior
The MCP client should:
Properly validate its state and server capabilities before operations
Only expose client-appropriate methods
Handle protocol version negotiation clearly
Example of expected validation:
// Client should validate state before operationspublicMono<McpSchema.CallToolResult> callTool(McpSchema.CallToolRequestrequest) {
if (!this.isInitialized()) {
returnMono.error(newMcpError("Client must be initialized before calling tools"));
}
if (this.serverCapabilities.tools() == null) {
returnMono.error(newMcpError("Server does not provide tools capability"));
}
returnthis.mcpSession.sendRequest(...);
}
Current Behavior
Client operations don't validate initialization state or server capabilities, potentially leading to runtime errors
Client exposes server-side notification methods that shouldn't be called by clients:
// These methods should not exist in clientpublicMono<Void> sendResourcesListChanged()
publicMono<Void> promptListChangedNotification()
Protocol version handling lacks clear documentation and validation
Context
This issue affects developers using the MCP client in several ways:
Lack of validation can lead to confusing runtime errors when client isn't properly initialized
Exposed server methods can lead to protocol violations if called by client applications
Unclear protocol version handling can cause compatibility issues
Current workaround:
Developers must manually check initialization state and capabilities before operations, but this is error-prone and leads to duplicated code.
The text was updated successfully, but these errors were encountered:
Add client initialization and capability validation checks
- New isInitialized() method to check client state
- Validate server capabilities before tool/resource operations
- Add clear error messages for common failure cases
- Remove server-side notification methods from client: sendResourcesListChanged(), promptListChangedNotification()
- Improve protocol version handling
- Testing improvements and new initialization tests
Resolves#13
Signed-off-by: Christian Tzolov <[email protected]>
Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested.
Expected Behavior
The MCP client should:
Example of expected validation:
Current Behavior
Context
This issue affects developers using the MCP client in several ways:
Current workaround:
The text was updated successfully, but these errors were encountered: