Skip to content

Commit b6fa68f

Browse files
Vadaskiclaude
andcommitted
fix: correct spread order in withDefaultListChangedCapabilities (#893)
{ listChanged: X ?? true, ...capabilities.tools } puts the default first so the spread overwrites it — explicit undefined defeats the default. Fix to { ...capabilities.tools, listChanged: X ?? true } so the ?? true only applies when the user did not set listChanged. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent d53b63b commit b6fa68f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • packages/server/src/server

packages/server/src/server/mcp.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1036,11 +1036,11 @@ function withDefaultListChangedCapabilities(options?: ServerOptions): ServerOpti
10361036
...options,
10371037
capabilities: {
10381038
...capabilities,
1039-
...(capabilities.tools ? { tools: { listChanged: capabilities.tools.listChanged ?? true, ...capabilities.tools } } : {}),
1039+
...(capabilities.tools ? { tools: { ...capabilities.tools, listChanged: capabilities.tools.listChanged ?? true } } : {}),
10401040
...(capabilities.resources
1041-
? { resources: { listChanged: capabilities.resources.listChanged ?? true, ...capabilities.resources } }
1041+
? { resources: { ...capabilities.resources, listChanged: capabilities.resources.listChanged ?? true } }
10421042
: {}),
1043-
...(capabilities.prompts ? { prompts: { listChanged: capabilities.prompts.listChanged ?? true, ...capabilities.prompts } } : {})
1043+
...(capabilities.prompts ? { prompts: { ...capabilities.prompts, listChanged: capabilities.prompts.listChanged ?? true } } : {})
10441044
}
10451045
};
10461046
}

0 commit comments

Comments
 (0)