Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions actions/setup/js/convert_gateway_config_adapters.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,14 @@ describe("convert gateway config shared pipeline", () => {
describe("convert gateway config adapters", () => {
const urlPrefix = "http://host.docker.internal:80";

it("claude adapter enforces type=http and rewrites url", () => {
const converted = transformClaudeEntry({ type: "ignored", url: "http://old/mcp/github", headers: { Authorization: "token" } }, urlPrefix);
it("claude adapter enforces type=http, rewrites url, and drops Copilot-only tools", () => {
const converted = transformClaudeEntry({ type: "ignored", url: "http://old/mcp/github", headers: { Authorization: "token" }, tools: ["read"] }, urlPrefix);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice regression coverage — asserting the tools field is dropped guards against future leakage.

expect(converted).toEqual({
type: "http",
url: "http://host.docker.internal:80/mcp/github",
headers: { Authorization: "token" },
});
expect(converted.tools).toBeUndefined();
});

it("copilot adapter adds tools wildcard only when missing", () => {
Expand Down
3 changes: 3 additions & 0 deletions actions/setup/js/convert_gateway_config_claude.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ function transformClaudeEntry(entry, urlPrefix) {
return normalizeGatewayEntry(entry, urlPrefix, transformed => {
// Claude uses "type": "http" for HTTP-based MCP servers
transformed.type = "http";
// The MCP gateway may include a "tools" field for Copilot, but Claude's
// MCP config format does not support that field.
delete transformed.tools;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good defensive cleanup — explicitly deleting the Copilot-only tools field keeps Claude's MCP config schema-clean. 👍

});
}

Expand Down
Loading