Fix: Respect explicit listChanged: false capability setting (#1513)

This commit is contained in:
Matt 2026-02-10 11:24:47 +01:00 • committed by GitHub
commit 8654c7fd3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 97 additions and 4 deletions

View file

@ -117,7 +117,7 @@ export class McpServer {
this.server.registerCapabilities({
tools: {
listChanged: true
listChanged: this.server.getCapabilities().tools?.listChanged ?? true
}
});
@ -429,7 +429,7 @@ export class McpServer {
this.server.registerCapabilities({
resources: {
listChanged: true
listChanged: this.server.getCapabilities().resources?.listChanged ?? true
}
});
@ -509,7 +509,7 @@ export class McpServer {
this.server.registerCapabilities({
prompts: {
listChanged: true
listChanged: this.server.getCapabilities().prompts?.listChanged ?? true
}
});

View file

@ -452,7 +452,10 @@ export class Server extends Protocol<ServerContext> {
return this._clientVersion;
}
private getCapabilities(): ServerCapabilities {
/**
* Returns the current server capabilities.
*/
public getCapabilities(): ServerCapabilities {
return this._capabilities;
}