Allow servers / clients to advertise extensions in the capability object (#1630)

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Tapan Chugh 2026-03-23 17:37:05 -07:00 • committed by GitHub
commit 677511b5a7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 66 additions and 4 deletions

View file

@ -586,7 +586,7 @@ export interface ClientCapabilities {
* @example Extensions — UI extension with MIME type support
* {@includeCode ./examples/ClientCapabilities/extensions-ui-mime-types.json}
*/
extensions?: { [key: string]: object };
extensions?: { [key: string]: JSONObject };
}
/**
@ -703,7 +703,7 @@ export interface ServerCapabilities {
* @example Extensions — UI extension support
* {@includeCode ./examples/ServerCapabilities/extensions-ui.json}
*/
extensions?: { [key: string]: object };
extensions?: { [key: string]: JSONObject };
}
/**

View file

@ -557,7 +557,11 @@ export const ClientCapabilitiesSchema = z.object({
/**
* Present if the client supports task creation.
*/
tasks: ClientTasksCapabilitySchema.optional()
tasks: ClientTasksCapabilitySchema.optional(),
/**
* Extensions that the client supports. Keys are extension identifiers (vendor-prefix/extension-name).
*/
extensions: z.record(z.string(), JSONObjectSchema).optional()
});
export const InitializeRequestParamsSchema = BaseRequestParamsSchema.extend({
@ -635,7 +639,11 @@ export const ServerCapabilitiesSchema = z.object({
/**
* Present if the server supports task creation.
*/
tasks: ServerTasksCapabilitySchema.optional()
tasks: ServerTasksCapabilitySchema.optional(),
/**
* Extensions that the server supports. Keys are extension identifiers (vendor-prefix/extension-name).
*/
extensions: z.record(z.string(), JSONObjectSchema).optional()
});
/**