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
{{ message }}
Repository navigation
NullPointerException in completion handler when Prompt has null arguments #932
The completion validation code in McpAsyncServer and McpStatelessAsyncServer throws a NullPointerException when a Prompt is registered with null arguments and a completion/complete request is received for that prompt.
This was introduced in commit 4c85963 (#972, the 2.0 forward-compat refactor), which changed Prompt constructors to stop coercing null arguments to an empty list — but did not update the SDK's own completion handler code that calls .arguments().stream() without a null guard.
Additionally, MIGRATION-2.0.md references a Prompt.withDefaults() factory method as the migration path, but this method was never implemented.
An empty completion result or a proper error response.
Actual behavior
{"jsonrpc":"2.0","id":2,"error":{"code":-32603,"message":"Cannot invoke \"java.util.List.stream()\" because the return value of \"io.modelcontextprotocol.spec.McpSchema$Prompt.arguments()\" is null"}}
Activity
fix: Return empty prompt completion result when prompt has no argumen…