Skip to content

Add configurable server name and title via translation strings#2159

Open
Copilot wants to merge 4 commits intomainfrom
copilot/add-string-override-logic
Open

Add configurable server name and title via translation strings#2159
Copilot wants to merge 4 commits intomainfrom
copilot/add-string-override-logic

Conversation

Copy link
Contributor

Copilot AI commented Mar 6, 2026

Summary

Adds support for overriding the MCP server name and title fields 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 name and title in the serverInfo field of the MCP initialization response. Making these fields configurable allows users to give each instance a unique identity.

What changed

  • Updated NewServer() to accept name and title parameters (with empty-string fallback to defaults) instead of hardcoded values
  • Updated NewMCPServer() to resolve name and title via cfg.Translator("SERVER_NAME", "github-mcp-server") and cfg.Translator("SERVER_TITLE", "GitHub MCP Server"), consistent with how all other user-visible strings (e.g. tool titles) are overridden
  • Added unit tests (TestNewServer_NameAndTitleViaTranslation) covering default values, custom name + title, and custom name only
  • Added documentation in README.md (i18n section) and docs/server-configuration.md

Users can now configure the server name and title via:

  • GITHUB_MCP_SERVER_NAME / GITHUB_MCP_SERVER_TITLE environment variables
  • "SERVER_NAME" / "SERVER_TITLE" keys in github-mcp-server-config.json

MCP impact

  • No tool or API changes

Prompts tested (tool changes only)

  • N/A — no tool changes

Security / limits

  • No security or limits impact

Tool renaming

  • I am not renaming tools as part of this PR

Lint & tests

  • Linted locally with ./script/lint
  • Tested locally with ./script/test

Docs

  • README.md updated with SERVER_NAME/SERVER_TITLE override docs
  • docs/server-configuration.md updated with quick reference entry

Closes #2158

@SamMorrowDrums
Copy link
Collaborator

@copilot you can start now

Copy link
Contributor Author

Copilot AI commented Mar 6, 2026

@copilot you can start now

Done! In commit 883579a I've added --server-name and --server-title flags (also configurable via GITHUB_SERVER_NAME and GITHUB_SERVER_TITLE environment variables) that override the name and title fields in the MCP server's initialization response. Both flags apply to stdio and HTTP server modes, with defaults of "github-mcp-server" and "GitHub MCP Server" when not set.

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:

  • golangci-lint.run
    • Triggering command: /usr/bin/curl curl -sSfL REDACTED -buildid YACarFP6UQ6_EYJA9iFq/YACarFP6UQ6_EYJA9iFq -goversion go1.24.13 -c=4 -race -nolocalimports -importcfg /tmp/go-build240666041/b317/importcfg 8129�� x64/src/runtime/-errorsas -trimpath (dns block)
  • raw.ghe.example.com
    • Triggering command: /tmp/go-build240666041/b360/oauth.test /tmp/go-build240666041/b360/oauth.test -test.testlogfile=/tmp/go-build240666041/b360/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build240666041/b225/vet.cfg _.a d8BpzlMIc x64/pkg/tool/lingo1.24.13 -I cgo -I x64/pkg/tool/lin/tmp/go-build240666041/b186/vet.cfg ortc�� _.a x64/src/crypto/tls/alert.go ache/go/1.24.13/x64/pkg/tool/lin-o GXo0mpsAx /dev/null /tmp/ccDD93gl.s ache/go/1.24.13/-buildtags (dns block)
  • raw.mycompanygithub.com
    • Triggering command: /tmp/go-build240666041/b392/utils.test /tmp/go-build240666041/b392/utils.test -test.testlogfile=/tmp/go-build240666041/b392/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build240666041/b329/vet.cfg _.a 8129866/b170/ x64/pkg/tool/linux_amd64/compile--64 8129866/b174/ bug -dumpdir x64/pkg/tool/lin/tmp/go-build240666041/b262/vet.cfg 8129�� 3Htkjhy8B23z -I (dns block)
  • raw.myghe.com
    • Triggering command: /tmp/go-build240666041/b392/utils.test /tmp/go-build240666041/b392/utils.test -test.testlogfile=/tmp/go-build240666041/b392/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build240666041/b329/vet.cfg _.a 8129866/b170/ x64/pkg/tool/linux_amd64/compile--64 8129866/b174/ bug -dumpdir x64/pkg/tool/lin/tmp/go-build240666041/b262/vet.cfg 8129�� 3Htkjhy8B23z -I (dns block)
  • raw.notgithub.com
    • Triggering command: /tmp/go-build240666041/b392/utils.test /tmp/go-build240666041/b392/utils.test -test.testlogfile=/tmp/go-build240666041/b392/testlog.txt -test.paniconexit0 -test.timeout=10m0s /tmp/go-build240666041/b329/vet.cfg _.a 8129866/b170/ x64/pkg/tool/linux_amd64/compile--64 8129866/b174/ bug -dumpdir x64/pkg/tool/lin/tmp/go-build240666041/b262/vet.cfg 8129�� 3Htkjhy8B23z -I (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add string override via env/json logic Add configurable server name and title via env/flag Mar 6, 2026
@SamMorrowDrums
Copy link
Collaborator

@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.

Copy link
Contributor Author

Copilot AI commented Mar 6, 2026

@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 ...

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:

  • GITHUB_MCP_SERVER_NAME env var (or "SERVER_NAME" in github-mcp-server-config.json)
  • GITHUB_MCP_SERVER_TITLE env var (or "SERVER_TITLE" in github-mcp-server-config.json)

Defaults remain "github-mcp-server" and "GitHub MCP Server" when not set.

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:

  • raw.ghe.example.com
    • Triggering command: /tmp/go-build532434299/b360/oauth.test /tmp/go-build532434299/b360/oauth.test -test.testlogfile=/tmp/go-build532434299/b360/testlog.txt -test.paniconexit0 -test.timeout=10m0s FhftMRwLLfpnpWTCFtHC/FhftMRwLLfpnpWTCFtHC -goversion go1.24.13 -c=4 -race -nolocalimports -importcfg /tmp/go-build532434299/b224/importcfg (dns block)
  • raw.mycompanygithub.com
    • Triggering command: /tmp/go-build532434299/b392/utils.test /tmp/go-build532434299/b392/utils.test -test.testlogfile=/tmp/go-build532434299/b392/testlog.txt -test.paniconexit0 -test.timeout=10m0s Z2K_-s5uZNTggzO08Qlj/Z2K_-s5uZNTggzO08Qlj -goversion go1.24.13 -c=4 -race -nolocalimports -importcfg /tmp/go-build532434299/b326/importcfg (dns block)
  • raw.myghe.com
    • Triggering command: /tmp/go-build532434299/b392/utils.test /tmp/go-build532434299/b392/utils.test -test.testlogfile=/tmp/go-build532434299/b392/testlog.txt -test.paniconexit0 -test.timeout=10m0s Z2K_-s5uZNTggzO08Qlj/Z2K_-s5uZNTggzO08Qlj -goversion go1.24.13 -c=4 -race -nolocalimports -importcfg /tmp/go-build532434299/b326/importcfg (dns block)
  • raw.notgithub.com
    • Triggering command: /tmp/go-build532434299/b392/utils.test /tmp/go-build532434299/b392/utils.test -test.testlogfile=/tmp/go-build532434299/b392/testlog.txt -test.paniconexit0 -test.timeout=10m0s Z2K_-s5uZNTggzO08Qlj/Z2K_-s5uZNTggzO08Qlj -goversion go1.24.13 -c=4 -race -nolocalimports -importcfg /tmp/go-build532434299/b326/importcfg (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title Add configurable server name and title via env/flag Add configurable server name and title via translation strings Mar 6, 2026
Copilot AI and others added 3 commits March 13, 2026 09:37
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>
@SamMorrowDrums SamMorrowDrums force-pushed the copilot/add-string-override-logic branch from d417caa to 4258ee9 Compare March 13, 2026 08:39
@SamMorrowDrums SamMorrowDrums marked this pull request as ready for review March 13, 2026 08:52
@SamMorrowDrums SamMorrowDrums requested a review from a team as a code owner March 13, 2026 08:52
Copilot AI review requested due to automatic review settings March 13, 2026 08:52
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/title from translation overrides, with default fallbacks.
  • Add unit test coverage for overridden vs default server name/title.
  • Document the new SERVER_NAME / SERVER_TITLE keys 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>
@SamMorrowDrums SamMorrowDrums force-pushed the copilot/add-string-override-logic branch from 4258ee9 to 89ef2ca Compare March 13, 2026 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make MCP Server name and title configurable

4 participants