Skip to content

Commit 89ef2ca

Browse files
SamMorrowDrumsAnika-SolCopilot
committed
docs: document SERVER_NAME and SERVER_TITLE overrides
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>
1 parent 7dc7b34 commit 89ef2ca

File tree

4 files changed

+35
-2
lines changed

4 files changed

+35
-2
lines changed

README.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1536,6 +1536,34 @@ set the following environment variable:
15361536
export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description"
15371537
```
15381538

1539+
### Overriding Server Name and Title
1540+
1541+
The same override mechanism can be used to customize the MCP server's `name` and
1542+
`title` fields in the initialization response. This is useful when running
1543+
multiple GitHub MCP Server instances (e.g., one for github.com and one for
1544+
GitHub Enterprise Server) so that agents can distinguish between them.
1545+
1546+
| Key | Environment Variable | Default |
1547+
|-----|---------------------|---------|
1548+
| `SERVER_NAME` | `GITHUB_MCP_SERVER_NAME` | `github-mcp-server` |
1549+
| `SERVER_TITLE` | `GITHUB_MCP_SERVER_TITLE` | `GitHub MCP Server` |
1550+
1551+
For example, to configure a server instance for GitHub Enterprise Server:
1552+
1553+
```json
1554+
{
1555+
"SERVER_NAME": "ghes-mcp-server",
1556+
"SERVER_TITLE": "GHES MCP Server"
1557+
}
1558+
```
1559+
1560+
Or using environment variables:
1561+
1562+
```sh
1563+
export GITHUB_MCP_SERVER_NAME="ghes-mcp-server"
1564+
export GITHUB_MCP_SERVER_TITLE="GHES MCP Server"
1565+
```
1566+
15391567
## Library Usage
15401568

15411569
The exported Go API of this module should currently be considered unstable, and subject to breaking changes. In the future, we may offer stability; please file an issue if there is a use case where this would be valuable.

docs/server-configuration.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ We currently support the following ways in which the GitHub MCP Server can be co
1515
| Lockdown Mode | `X-MCP-Lockdown` header | `--lockdown-mode` flag or `GITHUB_LOCKDOWN_MODE` env var |
1616
| Insiders Mode | `X-MCP-Insiders` header or `/insiders` URL | `--insiders` flag or `GITHUB_INSIDERS` env var |
1717
| Scope Filtering | Always enabled | Always enabled |
18+
| Server Name/Title | Not available | `GITHUB_MCP_SERVER_NAME` / `GITHUB_MCP_SERVER_TITLE` env vars or `github-mcp-server-config.json` |
1819

1920
> **Default behavior:** If you don't specify any configuration, the server uses the **default toolsets**: `context`, `issues`, `pull_requests`, `repos`, `users`.
2021

pkg/github/server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,9 @@ func addGitHubAPIErrorToContext(next mcp.MethodHandler) mcp.MethodHandler {
176176
}
177177
}
178178

179-
// NewServer creates a new GitHub MCP server with the specified GH client and logger.
179+
// NewServer creates a new GitHub MCP server with the given version, server
180+
// name, display title, and options. If name or title are empty the defaults
181+
// "github-mcp-server" and "GitHub MCP Server" are used.
180182
func NewServer(version, name, title string, opts *mcp.ServerOptions) *mcp.Server {
181183
if opts == nil {
182184
opts = &mcp.ServerOptions{}

pkg/github/server_test.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,11 +220,13 @@ func TestNewServer_NameAndTitleViaTranslation(t *testing.T) {
220220
clientResultCh <- clientResult{err: err}
221221
return
222222
}
223+
t.Cleanup(func() { _ = cs.Close() })
223224
clientResultCh <- clientResult{result: cs.InitializeResult()}
224225
}()
225226

226-
_, err := srv.Connect(context.Background(), st, nil)
227+
ss, err := srv.Connect(context.Background(), st, nil)
227228
require.NoError(t, err)
229+
t.Cleanup(func() { _ = ss.Close() })
228230

229231
got := <-clientResultCh
230232
require.NoError(t, got.err)

0 commit comments

Comments
 (0)