Skip to content
Open
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
12 changes: 9 additions & 3 deletions pkg/github/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions pkg/github/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
{
Expand Down Expand Up @@ -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.
Expand Down
Loading