Skip to content

Commit 0ad258d

Browse files
yashhzdCopilot
andcommitted
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>
1 parent 5d47ccc commit 0ad258d

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

pkg/github/server.go

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func NewMCPServer(ctx context.Context, cfg *MCPServerConfig, deps ToolDependenci
8787
o(serverOpts)
8888
}
8989

90-
ghServer := NewServer(cfg.Version, cfg.Translator("SERVER_NAME", "github-mcp-server"), cfg.Translator("SERVER_TITLE", "GitHub MCP Server"), serverOpts)
90+
ghServer := NewServer(cfg.Version, cfg.Translator("SERVER_NAME", "github"), cfg.Translator("SERVER_TITLE", "GitHub MCP Server"), serverOpts)
9191

9292
// 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,
9393
// 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 {
144144

145145
// NewServer creates a new GitHub MCP server with the given version, server
146146
// name, display title, and options. If name or title are empty the defaults
147-
// "github-mcp-server" and "GitHub MCP Server" are used.
147+
// "github" and "GitHub MCP Server" are used.
148+
//
149+
// The "github" name aligns with the configuration key VS Code derives from
150+
// the human-readable title, so tool prefixes like "github/*" resolve. It
151+
// intentionally diverges from the MCP registry identifier
152+
// (io.github.github/github-mcp-server in server.json), which uses the source
153+
// repo's last segment per the registry naming convention.
148154
func NewServer(version, name, title string, opts *mcp.ServerOptions) *mcp.Server {
149155
if opts == nil {
150156
opts = &mcp.ServerOptions{}
151157
}
152158

153159
if name == "" {
154-
name = "github-mcp-server"
160+
name = "github"
155161
}
156162
if title == "" {
157163
title = "GitHub MCP Server"

pkg/github/server_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ func TestNewServer_NameAndTitleViaTranslation(t *testing.T) {
207207
{
208208
name: "defaults when using NullTranslationHelper",
209209
translator: translations.NullTranslationHelper,
210-
expectedName: "github-mcp-server",
210+
expectedName: "github",
211211
expectedTitle: "GitHub MCP Server",
212212
},
213213
{
@@ -242,7 +242,7 @@ func TestNewServer_NameAndTitleViaTranslation(t *testing.T) {
242242
t.Run(tt.name, func(t *testing.T) {
243243
t.Parallel()
244244

245-
srv := NewServer("v1.0.0", tt.translator("SERVER_NAME", "github-mcp-server"), tt.translator("SERVER_TITLE", "GitHub MCP Server"), nil)
245+
srv := NewServer("v1.0.0", tt.translator("SERVER_NAME", "github"), tt.translator("SERVER_TITLE", "GitHub MCP Server"), nil)
246246
require.NotNil(t, srv)
247247

248248
// Connect a client to retrieve the initialize result and verify ServerInfo.

0 commit comments

Comments
 (0)