Add configurable server name and title via translation strings#2159
Add configurable server name and title via translation strings#2159
Conversation
|
@copilot you can start now |
Allows users running multiple GitHub MCP Server instances (e.g., for github.com and GitHub Enterprise Server) to override the server name and title in the MCP initialization response. - Add --server-name / GITHUB_SERVER_NAME flag+env to override name - Add --server-title / GITHUB_SERVER_TITLE flag+env to override title - Defaults remain "github-mcp-server" and "GitHub MCP Server" - Applies to both stdio and HTTP server modes - Add tests for default and custom name/title Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Done! In commit 883579a I've added 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
|
@copilot that sounds like it doesn't go through the translation strings handler, I asked you to use the same scheme for that. Not create new flags and enc. We already have a feature for overwriting for example tool titles. |
Instead of new CLI flags (--server-name, --server-title), reuse the existing string override mechanism that already supports tool title/ description overrides throughout the codebase. Users can now configure the server name and title via: - GITHUB_MCP_SERVER_NAME / GITHUB_MCP_SERVER_TITLE env vars - "SERVER_NAME" / "SERVER_TITLE" keys in github-mcp-server-config.json This is consistent with how all other user-visible strings are overridden (e.g. GITHUB_MCP_TOOL_GET_ME_USER_TITLE). No new struct fields or CLI flags are needed. Co-authored-by: SamMorrowDrums <4811358+SamMorrowDrums@users.noreply.github.com>
Addressed in d417caa. The new CLI flags/struct fields have been removed. Instead, the server name and title are now resolved via the existing translation helper, exactly like tool titles:
Defaults remain 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:
If you need me to access, download, or install something from one of these locations, you can either:
|
Summary
Adds support for overriding the MCP server
nameandtitlefields in the initialization response via the existing translation string override mechanism, so users running multiple GitHub MCP Server instances can distinguish between them.Why
When running multiple GitHub MCP Server instances (e.g., one for github.com and one for GitHub Enterprise Server), agents can get confused because all instances report the same
nameandtitlein theserverInfofield of the MCP initialization response. Making these fields configurable allows users to give each instance a unique identity.What changed
NewServer()to acceptnameandtitleparameters (with empty-string fallback to defaults) instead of hardcoded valuesNewMCPServer()to resolve name and title viacfg.Translator("SERVER_NAME", "github-mcp-server")andcfg.Translator("SERVER_TITLE", "GitHub MCP Server"), consistent with how all other user-visible strings (e.g. tool titles) are overriddenTestNewServer_NameAndTitleViaTranslation) covering default values, custom name + title, and custom name onlyUsers can now configure the server name and title via:
GITHUB_MCP_SERVER_NAME/GITHUB_MCP_SERVER_TITLEenvironment variables"SERVER_NAME"/"SERVER_TITLE"keys ingithub-mcp-server-config.jsonMCP impact
The server initialization response (
serverInfo.nameandserverInfo.title) can now be customized; no tool schemas or APIs are changed.Prompts tested (tool changes only)
Security / limits
Tool renaming
Lint & tests
./script/lint./script/testDocs
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.