From 0ad258d4a4af03642372547af93cc6a58df0076e Mon Sep 17 00:00:00 2001 From: yashhzd <162511050+yashhzd@users.noreply.github.com> Date: Sat, 30 May 2026 11:19:02 +0200 Subject: [PATCH] fix: align Implementation.Name with VS Code config key Set the protocol-level Implementation.Name to "github" so the slug matches the configuration key VS Code derives from server.json's title. This fixes "Unknown tool 'github/github-mcp-server/*'" when references use the recommended "github/*" pattern. The MCP registry name in server.json (io.github.github/github-mcp-server) intentionally still uses the source-repo's last segment per the registry naming convention; only the client-facing Implementation.Name changes here. Fixes #1402 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- pkg/github/server.go | 12 +++++++++--- pkg/github/server_test.go | 4 ++-- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/pkg/github/server.go b/pkg/github/server.go index f56ac7d3a..05395c239 100644 --- a/pkg/github/server.go +++ b/pkg/github/server.go @@ -87,7 +87,7 @@ func NewMCPServer(ctx context.Context, cfg *MCPServerConfig, deps ToolDependenci o(serverOpts) } - ghServer := NewServer(cfg.Version, cfg.Translator("SERVER_NAME", "github-mcp-server"), cfg.Translator("SERVER_TITLE", "GitHub MCP Server"), serverOpts) + ghServer := NewServer(cfg.Version, cfg.Translator("SERVER_NAME", "github"), cfg.Translator("SERVER_TITLE", "GitHub MCP Server"), serverOpts) // Add middlewares. Order matters - for example, the error context middleware should be applied last so that it runs FIRST (closest to the handler) to ensure all errors are captured, // and any middleware that needs to read or modify the context should be before it. @@ -144,14 +144,20 @@ func addGitHubAPIErrorToContext(next mcp.MethodHandler) mcp.MethodHandler { // NewServer creates a new GitHub MCP server with the given version, server // name, display title, and options. If name or title are empty the defaults -// "github-mcp-server" and "GitHub MCP Server" are used. +// "github" and "GitHub MCP Server" are used. +// +// The "github" name aligns with the configuration key VS Code derives from +// the human-readable title, so tool prefixes like "github/*" resolve. It +// intentionally diverges from the MCP registry identifier +// (io.github.github/github-mcp-server in server.json), which uses the source +// repo's last segment per the registry naming convention. func NewServer(version, name, title string, opts *mcp.ServerOptions) *mcp.Server { if opts == nil { opts = &mcp.ServerOptions{} } if name == "" { - name = "github-mcp-server" + name = "github" } if title == "" { title = "GitHub MCP Server" diff --git a/pkg/github/server_test.go b/pkg/github/server_test.go index 7f909f431..f8a150a6a 100644 --- a/pkg/github/server_test.go +++ b/pkg/github/server_test.go @@ -207,7 +207,7 @@ func TestNewServer_NameAndTitleViaTranslation(t *testing.T) { { name: "defaults when using NullTranslationHelper", translator: translations.NullTranslationHelper, - expectedName: "github-mcp-server", + expectedName: "github", expectedTitle: "GitHub MCP Server", }, { @@ -242,7 +242,7 @@ func TestNewServer_NameAndTitleViaTranslation(t *testing.T) { t.Run(tt.name, func(t *testing.T) { t.Parallel() - srv := NewServer("v1.0.0", tt.translator("SERVER_NAME", "github-mcp-server"), tt.translator("SERVER_TITLE", "GitHub MCP Server"), nil) + srv := NewServer("v1.0.0", tt.translator("SERVER_NAME", "github"), tt.translator("SERVER_TITLE", "GitHub MCP Server"), nil) require.NotNil(t, srv) // Connect a client to retrieve the initialize result and verify ServerInfo.