Skip to content

Strip Copilot-only MCP tools field from Claude gateway config#44868

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-github-mcp-tools-registration
Jul 11, 2026
Merged

Strip Copilot-only MCP tools field from Claude gateway config#44868
pelikhan merged 2 commits into
mainfrom
copilot/fix-github-mcp-tools-registration

Conversation

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Claude sessions were consistently failing to register GitHub MCP tools even when the MCP gateway and github-mcp-server were healthy and answering tools/list. The break was in the Claude-specific gateway config path: Copilot-only fields could leak into the config Claude consumes.

  • Root cause

    • The Claude gateway adapter normalized MCP server entries but preserved the gateway's tools field.
    • That field is valid for Copilot flows, but Claude's MCP config is expected to omit Copilot-specific fields.
  • Change

    • Update actions/setup/js/convert_gateway_config_claude.cjs to explicitly remove tools from each transformed server entry while still:
      • forcing type: "http"
      • rewriting gateway URLs to the runtime MCP endpoint
  • Regression coverage

    • Extend the adapter test to assert that Claude output drops tools while preserving the expected type, url, and headers.
    • Leave Copilot adapter behavior unchanged.
function transformClaudeEntry(entry, urlPrefix) {
  return normalizeGatewayEntry(entry, urlPrefix, transformed => {
    transformed.type = "http";
    delete transformed.tools;
  });
}


✨ PR Review Safe Output Test - Run 29143649515

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · 75.3 AIC · ⌖ 31.4 AIC · ⊞ 8.4K ·
Comment /smoke-claude to run again

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix github MCP tools registration issue in Claude Code Strip Copilot-only MCP tools field from Claude gateway config Jul 11, 2026
Copilot AI requested a review from pelikhan July 11, 2026 05:35
@github-actions

Copy link
Copy Markdown
Contributor

Great work on this fix, @Copilot! 👋 Stripping the Copilot-only tools field from the Claude gateway config is exactly the right approach, and the root cause analysis in the PR description is clear and well-structured.

The change is small, surgical, and directly addresses the Claude MCP tool registration failure. The regression test covering the dropped tools field while preserving type, url, and headers gives reviewers solid confidence. This looks ready for review! 🚀

Generated by ✅ Contribution Check · 111.8 AIC · ⌖ 11 AIC · ⊞ 6.2K ·

@pelikhan pelikhan marked this pull request as ready for review July 11, 2026 06:44
Copilot AI review requested due to automatic review settings July 11, 2026 06:44

Copilot AI left a comment

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.

Pull request overview

Removes Copilot-specific tools data from Claude MCP gateway configuration.

Changes:

  • Deletes tools during Claude entry transformation.
  • Adds regression coverage while preserving Copilot behavior.
Show a summary per file
File Description
actions/setup/js/convert_gateway_config_claude.cjs Removes unsupported tools field.
actions/setup/js/convert_gateway_config_adapters.test.cjs Verifies Claude output omits tools.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 0
  • Review effort level: Medium

@pelikhan pelikhan added the smoke label Jul 11, 2026
@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check.

No ADR enforcement needed: PR #44868 does not have the 'implementation' label and has 0 new lines of code in business logic directories (threshold: 100).

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

🚀 Smoke Antigravity MISSION COMPLETE! Antigravity has spoken. ✨

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

🚀 Smoke Pi MISSION COMPLETE! Pi delivered. 🥧

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

✅ All tools validated successfully! Agent Container Smoke Test confirms agent container is ready.

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

🚀 Smoke Gemini MISSION COMPLETE! Gemini has spoken. ✨

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Jul 11, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot Small failed. Please review the logs for details.

@github-actions

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions

Copy link
Copy Markdown
Contributor

📰 BREAKING: Smoke Copilot - AOAI (Entra) is now investigating this pull request. Sources say the story is developing...

@github-actions

Copy link
Copy Markdown
Contributor

🧪 Test Quality Sentinel Report

Test Quality Score: 100/100 — Excellent

Analyzed 1 test: 1 design, 0 implementation, 0 violation(s).

📊 Metrics (1 test)
Metric Value
Analyzed 1 (Go: 0, JS: 1)
✅ Design 1 (100%)
⚠️ Implementation 0 (0%)
Edge/error coverage 1 (100%)
Duplicate clusters 0
Inflation NO (1:1 ratio)
🚨 Violations 0
Test File Classification Issues
claude adapter enforces type=http, rewrites url, and drops Copilot-only tools actions/setup/js/convert_gateway_config_adapters.test.cjs:62 Design (behavioral contract) None

Verdict

Passed. 0% implementation tests (threshold: 30%). The modified test verifies the specific behavioral guarantee that Claude adapter strips Copilot-only tools field from MCP config. Clear assertions, no inflation, no violations.

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • awmgmcpg

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "awmgmcpg"

See Network Configuration for more information.

🧪 Test quality analysis by Test Quality Sentinel · 15.9 AIC · ⌖ 8.89 AIC · ⊞ 6.8K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

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.

✅ Test Quality Sentinel: 100/100. 0% implementation tests (threshold: 30%).

@github-actions

Copy link
Copy Markdown
Contributor

Caution

agentic threat detected
Threat detection flagged this output in warn mode. Manual review is REQUIRED before any follow-up automation.

Details

The threat detection engine failed to produce results.

Review the workflow run logs for details.

Pull request created: #44897

Generated by Changeset Generator · 3.14 AIC · ⊞ 11.5K

@github-actions

Copy link
Copy Markdown
Contributor

Smoke Test: Codex - 29143649512
PRs: #44860 [log] Add debug logging to custom linter analyzers
PRs: #44830 Consolidate pr-sous-chef run reports into a daily rolling issue thread
Status: FAIL
Skipped: Set issue field (no editable issue fields available)

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex · 10.5 AIC · ⌖ 0.638 AIC · ⊞ 10.9K ·
Comment /smoke-codex to run again

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

A quiet build hums
Symbols bloom in statvar light
Checks settle like snow

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex · 10.5 AIC · ⌖ 0.638 AIC · ⊞ 10.9K ·
Comment /smoke-codex to run again

@github-actions

Copy link
Copy Markdown
Contributor

💥 Smoke Test: Claude — Run 29143649515

Core #1-12: all ✅
PR Review #13-19: 13✅ 14✅ 15✅ 16⚠️ 17✅ 18⚠️ 19⚠️

⚠️ #16 skipped (no unresolved threads visible), #18 blocked by allowed-files config, #19 skipped (no safe PR).

Overall: PASS — Claude engine nominal! 🦸

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · 75.3 AIC · ⌖ 31.4 AIC · ⊞ 8.4K ·
Comment /smoke-claude to run again

@github-actions github-actions Bot left a comment

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.

💥 Automated smoke test review - all systems nominal!

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

💥 [THE END] — Illustrated by Smoke Claude · 75.3 AIC · ⌖ 31.4 AIC · ⊞ 8.4K
Comment /smoke-claude to run again

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. 👍

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.

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

Stone bot walks in mist
Small tests drum on iron branches
Green dawn hums alive

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

Warning

Firewall blocked 6 domains

The following domains were blocked by the firewall during workflow execution:

  • accounts.google.com
  • android.clients.google.com
  • clients2.google.com
  • contentautofill.googleapis.com
  • safebrowsingohttpgateway.googleapis.com
  • www.google.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "accounts.google.com"
    - "android.clients.google.com"
    - "clients2.google.com"
    - "contentautofill.googleapis.com"
    - "safebrowsingohttpgateway.googleapis.com"
    - "www.google.com"

See Network Configuration for more information.

📰 BREAKING: Report filed by Smoke Copilot · 61 AIC · ⌖ 3.57 AIC · ⊞ 19.1K ·
Comment /smoke-copilot to run again
Add label smoke to run again

@github-actions

Copy link
Copy Markdown
Contributor

Smoke test 29143662082 summary:

  • Tests 1-2: ✅
  • Tests 3-6: ❌
    Overall: FAIL
    @app/copilot-swe-agent @pelikhan @Copilot

📰 BREAKING: Report filed by Smoke Copilot - AOAI (Entra) · 18.7 AIC · ⌖ 2.48 AIC · ⊞ 17.6K ·
Comment /smoke-copilot-aoai-entra to run again
Add label smoke to run again

@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

Field Value
Category bug
Risk medium
Priority Score 75 / 100
Recommended Action fast_track

Score breakdown: Impact 35/50 · Urgency 25/30 · Quality 15/20

Rationale: Small targeted bug fix (+6/-2 lines) with clear root-cause that restores Claude MCP tool registration. CI passing, 1 review. High urgency — directly unblocks Claude sessions from failing to register GitHub MCP tools.

Generated by 🔧 PR Triage Agent · 151.2 AIC · ⌖ 7.52 AIC · ⊞ 5.4K ·

@pelikhan

Copy link
Copy Markdown
Collaborator

@copilot investigate https://github.com/github/gh-aw/actions/runs/29143649515/job/86521396282 and ensure the issue is fixed

Copilot AI commented Jul 11, 2026

Copy link
Copy Markdown
Contributor Author

@copilot investigate https://github.com/github/gh-aw/actions/runs/29143649515/job/86521396282 and ensure the issue is fixed

Investigated job 86521396282 in run 29143649515: the run completed successfully and audit shows error_count: 0, no missing tools, and no MCP failures. I also re-ran the adapter regression test locally (convert_gateway_config_adapters.test.cjs) and it passes. The fix is present in 126407c.

@pelikhan pelikhan merged commit 89e328d into main Jul 11, 2026
272 of 273 checks passed
@pelikhan pelikhan deleted the copilot/fix-github-mcp-tools-registration branch July 11, 2026 07:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

github MCP tools never registered by Claude Code despite the server answering gateway RPC calls successfully

3 participants