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
Fix OAuth error handling for servers returning errors with HTTP 200 status
6
+
7
+
Some OAuth servers (e.g., GitHub) return error responses with HTTP 200 status instead of 4xx. The SDK now checks for an `error` field in the JSON response before attempting to parse it as tokens, providing users with meaningful error messages.
Respect capability negotiation in list methods by returning empty lists when server lacks capability
6
+
7
+
The Client now returns empty lists instead of sending requests to servers that don't advertise the corresponding capability:
8
+
-`listPrompts()` returns `{ prompts: [] }` if server lacks prompts capability
9
+
-`listResources()` returns `{ resources: [] }` if server lacks resources capability
10
+
-`listResourceTemplates()` returns `{ resourceTemplates: [] }` if server lacks resources capability
11
+
-`listTools()` returns `{ tools: [] }` if server lacks tools capability
12
+
13
+
This respects the MCP spec requirement that "Both parties SHOULD respect capability negotiation" and avoids unnecessary server warnings and traffic. The existing `enforceStrictCapabilities` option continues to throw errors when set to `true`.
0 commit comments