feat(core): add isSpecType / specTypeSchemas Records for runtime validation of spec types (#1887)

This commit is contained in:
Felix Weinberger 2026-04-30 13:16:23 +01:00 • committed by GitHub
commit 96db044fe9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -0,0 +1,6 @@
---
'@modelcontextprotocol/client': minor
'@modelcontextprotocol/server': minor
---
Export `isSpecType` and `specTypeSchemas` records for runtime validation of any MCP spec type by name. `isSpecType.ContentBlock(value)` is a type predicate; `specTypeSchemas.ContentBlock` is a `StandardSchemaV1<ContentBlock>` validator. Guards are standalone functions, so `arr.filter(isSpecType.ContentBlock)` works. Also export the `SpecTypeName` and `SpecTypes` types.