fix(server-stateless): requiredCapabilities is a ClientCapabilities object, not an array (#376)
The sep-2575-server-rejects-undeclared-capability check required
error.data.requiredCapabilities to be an array containing 'sampling'. The
schema's MissingRequiredClientCapabilityError defines it as a
ClientCapabilities object ({ "sampling": {} }), as do this repo's own
spec-types and the tasks/required-task-error scenario, so a spec-correct
server could not pass the check. It shipped because the positive -32021
branch had no self-test.
- stateless.ts: accept the object shape; each capability value must itself
be an object ({ "sampling": null } fails). State the shape in the
scenario's implementer-facing description.
- examples/servers/typescript/everything-server.ts: emit the object.
- stateless.test.ts: self-tests for object-passes / array-fails /
null-value-fails, sharing one capability-probe mock helper.
This commit is contained in:
parent
4944b26806
commit
9524edcf41
1 changed files with 98 additions and 17 deletions
|
|
@ -1663,7 +1663,9 @@ app.post('/mcp', async (req, res) => {
|
|||
error: {
|
||||
code: -32021,
|
||||
message: 'MissingRequiredClientCapabilityError',
|
||||
data: { requiredCapabilities: ['sampling'] }
|
||||
// Per the schema, requiredCapabilities is a ClientCapabilities
|
||||
// object keyed by the missing capability, not an array of names.
|
||||
data: { requiredCapabilities: { sampling: {} } }
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue