Skip to content

Add Capabilities API configuration to disable listChanged notifications for static MCP tools#6292

Merged
pelikhan merged 4 commits into
mainfrom
copilot/add-capabilities-api-config
Dec 12, 2025
Merged

Add Capabilities API configuration to disable listChanged notifications for static MCP tools#6292
pelikhan merged 4 commits into
mainfrom
copilot/add-capabilities-api-config

Conversation

Copilot AI commented Dec 12, 2025

Copy link
Copy Markdown
Contributor

The MCP server was not configuring capabilities, causing clients to expect dynamic tool list notifications even though gh-aw's tools are static and never change at runtime.

Changes

  • Upgraded MCP SDK from v1.1.0 to v1.1.1-pre (main branch) to access the Capabilities API
  • Configured server capabilities in pkg/cli/mcp_server.go to set Tools.ListChanged: false
  • Added integration test to verify capability configuration is correctly advertised to clients

Implementation

server := mcp.NewServer(&mcp.Implementation{
    Name:    "gh-aw",
    Version: GetVersion(),
}, &mcp.ServerOptions{
    Capabilities: &mcp.ServerCapabilities{
        Tools: &mcp.ToolCapabilities{
            ListChanged: false,  // Tools are static, no notifications needed
        },
    },
})

This reduces unnecessary overhead by signaling to clients that they don't need to listen for tool list change notifications.

Note

The issue referenced pkg/gateway/gateway.go but this file doesn't exist. Only pkg/cli/mcp_server.go creates an MCP server instance and required updating.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • go.googlesource.com
    • Triggering command: /update-job-proxy /update-job-proxy -o br-6071feb4dff5 -j DOCKER-ISOLATION-STAGE-2 Trus_Root_CA.pem /usr/share/ca-certificates/mozilla/SSL.com_Root_Certification_Authority_RSA.crt test tos_TrustedRoot_git go /home/dependabot--global sed -e CA1.pem /usr/share/ca-certificates/mozilla/UCA_Global_G2_Root.crt /usr/local/sbin/test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-123541d8a3f6 -j DOCKER-ISOLATION-STAGE-2 e=false sed e/git-remote-https _-_G2.pem %H %ct %D bb2e21e6144e6004blob e/git-remote-htt346938d642f2ec3594ed81d874461961cd0faa76:go.mod rese�� om/charmbracelet/x --hard /bin/git ID_Root_G2.pem /usr/share/ca-ce--wait /usr/bin/sed git (dns block)
  • go.uber.org
    • Triggering command: /update-job-proxy /update-job-proxy -o br-6071feb4dff5 -j DOCKER-ISOLATION-STAGE-2 Trus_Root_CA.pem /usr/share/ca-certificates/mozilla/SSL.com_Root_Certification_Authority_RSA.crt test tos_TrustedRoot_git go /home/dependabot--global sed -e CA1.pem /usr/share/ca-certificates/mozilla/UCA_Global_G2_Root.crt /usr/local/sbin/test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-123541d8a3f6 -j DOCKER-ISOLATION-STAGE-2 e=false sed e/git-remote-https _-_G2.pem %H %ct %D bb2e21e6144e6004blob e/git-remote-htt346938d642f2ec3594ed81d874461961cd0faa76:go.mod rese�� om/charmbracelet/x --hard /bin/git ID_Root_G2.pem /usr/share/ca-ce--wait /usr/bin/sed git (dns block)
  • go.yaml.in
    • Triggering command: /update-job-proxy /update-job-proxy -o br-6071feb4dff5 -j DOCKER-ISOLATION-STAGE-2 Trus_Root_CA.pem /usr/share/ca-certificates/mozilla/SSL.com_Root_Certification_Authority_RSA.crt test tos_TrustedRoot_git go /home/dependabot--global sed -e CA1.pem /usr/share/ca-certificates/mozilla/UCA_Global_G2_Root.crt /usr/local/sbin/test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-123541d8a3f6 -j DOCKER-ISOLATION-STAGE-2 e=false sed e/git-remote-https _-_G2.pem %H %ct %D bb2e21e6144e6004blob e/git-remote-htt346938d642f2ec3594ed81d874461961cd0faa76:go.mod rese�� om/charmbracelet/x --hard /bin/git ID_Root_G2.pem /usr/share/ca-ce--wait /usr/bin/sed git (dns block)
  • gopkg.in
    • Triggering command: /update-job-proxy /update-job-proxy -o br-6071feb4dff5 -j DOCKER-ISOLATION-STAGE-2 Trus_Root_CA.pem /usr/share/ca-certificates/mozilla/SSL.com_Root_Certification_Authority_RSA.crt test tos_TrustedRoot_git go /home/dependabot--global sed -e CA1.pem /usr/share/ca-certificates/mozilla/UCA_Global_G2_Root.crt /usr/local/sbin/test (dns block)
    • Triggering command: /update-job-proxy /update-job-proxy -o br-123541d8a3f6 -j DOCKER-ISOLATION-STAGE-2 e=false sed e/git-remote-https _-_G2.pem %H %ct %D bb2e21e6144e6004blob e/git-remote-htt346938d642f2ec3594ed81d874461961cd0faa76:go.mod rese�� om/charmbracelet/x --hard /bin/git ID_Root_G2.pem /usr/share/ca-ce--wait /usr/bin/sed git (dns block)
  • https://api.github.com/user
    • Triggering command: /usr/bin/gh gh api user --jq .login --noprofile ache/go/1.25.0/x64/pkg/tool/linux_amd64/vet me-repo a27efde6d2db850agit pkg/cli/mcp_workconfig /opt/hostedtoolcuser.name bash --no�� (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login pkg/cli/templates/ ache/go/1.25.0/x64/pkg/tool/linuTest User ache/go/1.25.0/x64/pkg/tool/linux_amd64/cgo 96/create_issue.git -buildtags 1/x64/bin/node ache/go/1.25.0/x64/pkg/tool/linux_amd64/cgo api eam.git eam.git e/git-remote-https -bool -buildtags 7198321/b403/scrxterm-color e/git-remote-https (http block)
    • Triggering command: /usr/bin/gh gh api user --jq .login /run/containerd/io.containerd.runtime.v2.task/moby/327a639d8600ed0b2ff23a02c2627ac9bd31536e3ace98c2e323b194abf07fe1/init.pid 327a639d8600ed0b2ff23a02c2627ac9bd31536e3ace98c2e323b194abf07fe1 ps ac9bd31536e3ace98c2e323b194abf07fe1/log.json /tmp/go-build313aw -d/gh-aw ps -act�� -action.git -d/gh-aw /usr/bin/infocmp pload-artifact/gbash /tmp/go-build313/usr/bin/runc e/git-remote-htt--root infocmp (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

This section details on the original issue you should resolve

<issue_title>[plan] Add Capabilities API configuration to MCP servers</issue_title>
<issue_description>## Objective

Adopt the new Capabilities API from MCP Go SDK v1.1.0 to configure server behavior and disable unnecessary listChanged notifications.

Context

The MCP Go SDK v1.1.0 introduced a new Capabilities API that allows controlling server behavior. Since gh-aw's MCP tools are static (they don't change at runtime), we should disable listChanged notifications to reduce unnecessary overhead.

Approach

Update MCP server creation in two files to use ServerOptions:

File 1: pkg/cli/mcp_server.go (around line 105)

Current:

server := mcp.NewServer(&mcp.Implementation{
    Name:    "gh-aw",
    Version: GetVersion(),
}, nil)

Updated:

server := mcp.NewServer(&mcp.Implementation{
    Name:    "gh-aw",
    Version: GetVersion(),
}, &mcp.ServerOptions{
    Capabilities: &mcp.ServerCapabilities{
        ListChanged: false,  // Tools are static, no notifications needed
    },
})

File 2: pkg/gateway/gateway.go (around line 85)

Apply the same pattern to the gateway's MCP server creation.

Files to Modify

  • pkg/cli/mcp_server.go - Add ServerOptions with Capabilities
  • pkg/gateway/gateway.go - Add ServerOptions with Capabilities

Acceptance Criteria

  • Both MCP servers use ServerOptions with ListChanged: false
  • MCP server starts successfully with new configuration
  • Existing tool invocations continue to work
  • No listChanged notifications are sent unnecessarily
  • Tests pass: make test
    Related to [plan] Adopt MCP Go SDK v1.1.0 improvements #6249

AI generated by Plan Command for discussion #6222

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 3 commits December 12, 2025 20:18
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Co-authored-by: mnkiefer <8320933+mnkiefer@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Capabilities API configuration to MCP servers Add Capabilities API configuration to disable listChanged notifications for static MCP tools Dec 12, 2025
Copilot AI requested a review from mnkiefer December 12, 2025 20:43
@pelikhan pelikhan marked this pull request as ready for review December 12, 2025 21:15
@pelikhan pelikhan merged commit 7cf886b into main Dec 12, 2025
117 checks passed
@pelikhan pelikhan deleted the copilot/add-capabilities-api-config branch December 12, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[plan] Add Capabilities API configuration to MCP servers

3 participants