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 |
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. |
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:
|
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>
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>
d417caa to
4258ee9
Compare
There was a problem hiding this comment.
Pull request overview
Adds support for overriding the MCP server name/title (as reported in initialize) using the existing translations override mechanism, and documents the new configuration knobs.
Changes:
- Update server initialization to source
name/titlefrom translation overrides, with default fallbacks. - Add unit test coverage for overridden vs default server name/title.
- Document the new
SERVER_NAME/SERVER_TITLEkeys and corresponding environment variables.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| README.md | Documents SERVER_NAME / SERVER_TITLE overrides and env vars. |
| pkg/github/server.go | Passes overridable name/title into MCP Implementation and adds defaults. |
| pkg/github/server_test.go | Adds test verifying initialize response includes overridden/default server name/title. |
| docs/server-configuration.md | Updates configuration matrix to include server name/title overrides for local server. |
You can also share your feedback on Copilot code review. Take the survey.
Add documentation for the server name and title customization feature to the README i18n section and server-configuration.md quick reference. This helps users running multiple GitHub MCP Server instances discover how to configure unique identities via environment variables or the config JSON file. Co-authored-by: Anika Reiter <1503135+Anika-Sol@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
4258ee9 to
89ef2ca
Compare
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
Prompts tested (tool changes only)
Security / limits
Tool renaming
Lint & tests
./script/lint./script/testDocs
Closes #2158