Spec PR #3002 (part of the final 2026-07-28 revision) moved serverInfo from the DiscoverResult body to _meta['io.modelcontextprotocol/serverInfo'] and demoted the request envelope's clientInfo from required to SHOULD. The checks still asserted the old shape, failing SDKs that follow the final revision. - Vendor schema types at spec commit 71e30695. - server-stateless: drop the missing-clientInfo rejection case and assert the opposite (a clientInfo-less request must be served, new check sep-2575-request-meta-client-info-optional); discover no longer requires body serverInfo; new SHOULD-level check sep-2575-server-identifies-in-result-meta (WARNING when the _meta identity is absent, SKIPPED when discover itself failed). - request-metadata (client side): the clientInfo SHOULD moves out of the MUST check into its own id sep-2575-client-sends-client-info (WARNING on absence), so requirement levels never blend in one check id. - Mock servers and the everything-server example emit the _meta identity and accept clientInfo-less requests.
This commit is contained in:
parent
ce25103b1b
commit
d1c0b95917
1 changed files with 237 additions and 120 deletions
|
|
@ -1266,11 +1266,11 @@ app.post('/mcp', async (req, res) => {
|
|||
|
||||
// Per-Request Metadata Integrity Checks (Fields verification).
|
||||
// A request missing any required `_meta` field is malformed: -32602 and,
|
||||
// on HTTP, status 400 Bad Request.
|
||||
// on HTTP, status 400 Bad Request. `clientInfo` is a SHOULD since spec
|
||||
// PR #3002 and is never required.
|
||||
if (
|
||||
!meta ||
|
||||
!meta['io.modelcontextprotocol/protocolVersion'] ||
|
||||
!meta['io.modelcontextprotocol/clientInfo'] ||
|
||||
!meta['io.modelcontextprotocol/clientCapabilities']
|
||||
) {
|
||||
return res.status(400).json({
|
||||
|
|
@ -1372,7 +1372,13 @@ app.post('/mcp', async (req, res) => {
|
|||
// served on this path, so the capability must be declared too.
|
||||
resources: {}
|
||||
},
|
||||
serverInfo: { name: 'everything-stateless-server', version: '1.0.0' }
|
||||
// Spec PR #3002: server identity lives in the result `_meta`.
|
||||
_meta: {
|
||||
'io.modelcontextprotocol/serverInfo': {
|
||||
name: 'everything-stateless-server',
|
||||
version: '1.0.0'
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue