Skip to content

Add configurable server name and title via translation strings#2159

Draft
Copilot wants to merge 3 commits intomainfrom
copilot/add-string-override-logic
Draft

Add configurable server name and title via translation strings#2159
Copilot wants to merge 3 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

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

The server initialization response (serverInfo.name and serverInfo.title) can now be customized; no tool schemas or APIs are changed.

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

  • Not needed
Original prompt

#2158 should be easy, just add to the existing string override via env/json logic.


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@SamMorrowDrums
Copy link
Collaborator

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

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

2 participants