| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Extensions currently must use the experimental field as a workaround.
This adds a dedicated extensions field (record of URI → object) to
ServerCapabilitiesSchema, enabling capabilities like
extensions["io.modelcontextprotocol/grouping"]: { listChanged: true }.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use "extension identifiers" (vendor-prefix/extension-name) instead of "URIs" per the SEP-2133 Extensions specification. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
⚠️ No Changeset foundLatest commit: 72ac715 Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset. This PR includes no changesetsWhen changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types Click here to learn what changesets are, and how to add one. Click here if you're a maintainer who wants to add a changeset to this PR |
Sorry, something went wrong.
|
@modelcontextprotocol/client
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/client@1630
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/server@1630
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/express@1630
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/hono@1630
npm i https://pkg.pr.new/modelcontextprotocol/typescript-sdk/@modelcontextprotocol/node@1630 commit: 72ac715 |
Sorry, something went wrong.
Addresses PR feedback: extensions need to be on both client and server capability objects per SEP-2133. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…tObjectSchema The merge with main brought in modelcontextprotocol#1612 which replaced AssertObjectSchema with JSONObjectSchema, but the extensions fields were not updated. Also fixes spec.types.ts to use JSONObject (matching experimental) for bidirectional type compatibility. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
This fix is needed — we've been hitting this in production building MCP Apps servers with x428 precondition support. The extensions field (now formally in the spec via SEP-2133) is silently stripped during initialize parsing, making getClientCapabilities().extensions always undefined. The ext-apps SDK's getUiCapability() function explicitly acknowledges this gap in its JSDoc ("pending SEP-1724"), but the compile-time type widening it uses doesn't help at runtime — the data is already gone by the time getClientCapabilities() returns. Our current workaround is intercepting _onrequest on the raw Server to capture extensions before Zod parsing: const rawServer = mcpServer.server as any;
const origOnRequest = rawServer._onrequest?.bind(rawServer);
if (origOnRequest) {
rawServer._onrequest = (request: any, extra: any) => {
if (request?.method === "initialize" && request?.params?.capabilities?.extensions) {
rawExtensions = request.params.capabilities.extensions;
}
return origOnRequest(request, extra);
};
}This is fragile (depends on SDK internals) and we'd love to drop it. The Go SDK already shipped extensions support (go-sdk#794). Would be great to get this merged. |
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks @chughtapan
Sorry, something went wrong.
|
@ochafik does this need something else? It still shows "unable to merge" on my side. |
Sorry, something went wrong.
|
+1 to this fix being needed, otherwise there is no way to detect MCP apps capability, and distinguish between Claude code vs. Claude chat (modelcontextprotocol/ext-apps#521). How might we get this merged soon @ochafik? |
Sorry, something went wrong.
|
Heyyy... any updates here / is anything blocking us from merging this improvement + bug-fix? |
Sorry, something went wrong.
|
This one didn't make it to 1.28.0? |
Sorry, something went wrong.
…#1630) Backport of #1630 to v1.x branch. Adds the `extensions` field to `ClientCapabilities` and `ServerCapabilities` to allow servers and clients to advertise extension support in the capability object, per SEP-2133. Adapted from the main branch implementation to use v1.x types: - Uses `object` type in spec.types.ts (matching existing `experimental` field) - Uses `AssertObjectSchema` in Zod schemas instead of `JSONObjectSchema` :house: Remote-Dev: homespace
| Back | FazBrowse Home | New Git URL |
According to SEP-2133, the protocol supports extensions which be be advertised in the capabilities object. This PR adds this field to the SDK
Motivation and Context
This enables extensions to build upon the typescript-sdk
How Has This Been Tested?
Existing and new tests pass.
Breaking Changes
No
Types of changes
Checklist
Additional context