Skip to content

Commit 096ecbb

Browse files
Merge branch 'main' into mcp-ui-apps-advanced
2 parents 6c529d0 + dd239d8 commit 096ecbb

40 files changed

+1846
-178
lines changed

.github/workflows/code-scanning.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ jobs:
3535
category: /language:go
3636
build-mode: autobuild
3737
runner: '["ubuntu-22.04"]'
38+
- language: javascript
39+
category: /language:javascript
40+
build-mode: none
41+
runner: '["ubuntu-22.04"]'
3842
steps:
3943
- name: Checkout repository
4044
uses: actions/checkout@v6
@@ -75,7 +79,7 @@ jobs:
7579
cache: false
7680

7781
- name: Set up Node.js
78-
if: matrix.language == 'go'
82+
if: matrix.language == 'go' || matrix.language == 'javascript'
7983
uses: actions/setup-node@v4
8084
with:
8185
node-version: "20"

.github/workflows/docker-publish.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
# https://github.com/sigstore/cosign-installer
4747
- name: Install cosign
4848
if: github.event_name != 'pull_request'
49-
uses: sigstore/cosign-installer@faadad0cce49287aee09b3a48701e75088a2c6ad #v4.0.0
49+
uses: sigstore/cosign-installer@ba7bc0a3fef59531c69a25acd34668d6d3fe6f22 #v4.1.0
5050
with:
5151
cosign-release: "v2.2.4"
5252

@@ -70,7 +70,7 @@ jobs:
7070
# https://github.com/docker/metadata-action
7171
- name: Extract Docker metadata
7272
id: meta
73-
uses: docker/metadata-action@c299e40c65443455700f0fdfc63efafe5b349051 # v5.10.0
73+
uses: docker/metadata-action@030e881283bb7a6894de51c315a6bfe6a94e05cf # v6.0.0
7474
with:
7575
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
7676
tags: |
@@ -93,7 +93,7 @@ jobs:
9393
key: ${{ runner.os }}-go-build-cache-${{ hashFiles('**/go.sum') }}
9494

9595
- name: Inject go-build-cache
96-
uses: reproducible-containers/buildkit-cache-dance@6f699a72a59e4252f05a7435430009b77e25fe06 # v3.3.1
96+
uses: reproducible-containers/buildkit-cache-dance@1b8ab18fbda5ad3646e3fcc9ed9dd41ce2f297b4 # v3.3.2
9797
with:
9898
cache-map: |
9999
{
@@ -106,7 +106,7 @@ jobs:
106106
# https://github.com/docker/build-push-action
107107
- name: Build and push Docker image
108108
id: build-and-push
109-
uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0
109+
uses: docker/build-push-action@d08e5c354a6adb9ed34480a06d141179aa583294 # v7.0.0
110110
with:
111111
context: .
112112
push: ${{ github.event_name != 'pull_request' }}

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ COPY ui/ ./ui/
77
RUN mkdir -p ./pkg/github/ui_dist && \
88
cd ui && npm run build
99

10-
FROM golang:1.25.7-alpine@sha256:f6751d823c26342f9506c03797d2527668d095b0a15f1862cddb4d927a7a4ced AS build
10+
FROM golang:1.25.8-alpine@sha256:8e02eb337d9e0ea459e041f1ee5eece41cbb61f1d83e7d883a3e2fb4862063fa AS build
1111
ARG VERSION="dev"
1212

1313
# Set the working directory

README.md

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,6 +1119,7 @@ The following sets of tools are available:
11191119
- `owner`: Repository owner (string, required)
11201120
- `pullNumber`: Pull request number (number, required)
11211121
- `repo`: Repository name (string, required)
1122+
- `threadId`: The node ID of the review thread (e.g., PRRT_kwDOxxx). Required for resolve_thread and unresolve_thread methods. Get thread IDs from pull_request_read with method get_review_comments. (string, optional)
11221123

11231124
- **search_pull_requests** - Search pull requests
11241125
- **Required OAuth Scopes**: `repo`
@@ -1171,7 +1172,7 @@ The following sets of tools are available:
11711172
- `owner`: Repository owner (username or organization) (string, required)
11721173
- `path`: Path where to create/update the file (string, required)
11731174
- `repo`: Repository name (string, required)
1174-
- `sha`: The blob SHA of the file being replaced. (string, optional)
1175+
- `sha`: The blob SHA of the file being replaced. Required if the file already exists. (string, optional)
11751176

11761177
- **create_repository** - Create repository
11771178
- **Required OAuth Scopes**: `repo`
@@ -1241,9 +1242,12 @@ The following sets of tools are available:
12411242
- `author`: Author username or email address to filter commits by (string, optional)
12421243
- `owner`: Repository owner (string, required)
12431244
- `page`: Page number for pagination (min 1) (number, optional)
1245+
- `path`: Only commits containing this file path will be returned (string, optional)
12441246
- `perPage`: Results per page for pagination (min 1, max 100) (number, optional)
12451247
- `repo`: Repository name (string, required)
12461248
- `sha`: Commit SHA, branch or tag name to list commits of. If not provided, uses the default branch of the repository. If a commit SHA is provided, will list commits up to that SHA. (string, optional)
1249+
- `since`: Only commits after this date will be returned (ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DD) (string, optional)
1250+
- `until`: Only commits before this date will be returned (ISO 8601 format: YYYY-MM-DDTHH:MM:SSZ or YYYY-MM-DD) (string, optional)
12471251

12481252
- **list_releases** - List releases
12491253
- **Required OAuth Scopes**: `repo`
@@ -1536,6 +1540,34 @@ set the following environment variable:
15361540
export GITHUB_MCP_TOOL_ADD_ISSUE_COMMENT_DESCRIPTION="an alternative description"
15371541
```
15381542

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

15411573
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/installation-guides/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ This directory contains detailed installation instructions for the GitHub MCP Se
77
- **[GitHub Copilot in other IDEs](install-other-copilot-ides.md)** - Installation for JetBrains, Visual Studio, Eclipse, and Xcode with GitHub Copilot
88
- **[Antigravity](install-antigravity.md)** - Installation for Google Antigravity IDE
99
- **[Claude Applications](install-claude.md)** - Installation guide for Claude Web, Claude Desktop and Claude Code CLI
10+
- **[Cline](install-cline.md)** - Installation guide for Cline
1011
- **[Cursor](install-cursor.md)** - Installation guide for Cursor IDE
1112
- **[Google Gemini CLI](install-gemini-cli.md)** - Installation guide for Google Gemini CLI
1213
- **[OpenAI Codex](install-codex.md)** - Installation guide for OpenAI Codex
14+
- **[Roo Code](install-roo-code.md)** - Installation guide for Roo Code
1315
- **[Windsurf](install-windsurf.md)** - Installation guide for Windsurf IDE
1416

1517
## Support by Host Application
@@ -23,8 +25,10 @@ This directory contains detailed installation instructions for the GitHub MCP Se
2325
| Copilot in JetBrains || ✅ Full (OAuth + PAT) | Local: Docker or Go build, GitHub PAT<br>Remote: JetBrains Copilot Extension v1.5.53+ | Easy |
2426
| Claude Code || ✅ PAT + ❌ No OAuth| GitHub MCP Server binary or remote URL, GitHub PAT | Easy |
2527
| Claude Desktop || ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Moderate |
28+
| Cline || ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Easy |
2629
| Cursor || ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Easy |
2730
| Google Gemini CLI || ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Easy |
31+
| Roo Code || ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Easy |
2832
| Windsurf || ✅ PAT + ❌ No OAuth | Docker or Go build, GitHub PAT | Easy |
2933
| Copilot in Xcode || ✅ Full (OAuth + PAT) | Local: Docker or Go build, GitHub PAT<br>Remote: Copilot for Xcode 0.41.0+ | Easy |
3034
| Copilot in Eclipse || ✅ Full (OAuth + PAT) | Local: Docker or Go build, GitHub PAT<br>Remote: Eclipse Plug-in for Copilot 0.10.0+ | Easy |
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
# Install GitHub MCP Server in Cline
2+
3+
[Cline](https://github.com/cline/cline) is an AI coding assistant that runs in VS Code-compatible editors (VS Code, Cursor, Windsurf, etc.). For general setup information (prerequisites, Docker installation, security best practices), see the [Installation Guides README](./README.md).
4+
5+
## Remote Server
6+
7+
Cline stores MCP settings in `cline_mcp_settings.json`. To edit it, click the Cline icon in your editor's sidebar, open the menu in the top right corner of the Cline panel, and select **"MCP Servers"**. You can add a remote server through the **"Remote Servers"** tab, or click **"Configure MCP Servers"** to edit the JSON directly.
8+
9+
```json
10+
{
11+
"mcpServers": {
12+
"github": {
13+
"url": "https://api.githubcopilot.com/mcp/",
14+
"type": "streamableHttp",
15+
"disabled": false,
16+
"headers": {
17+
"Authorization": "Bearer <YOUR_GITHUB_PAT>"
18+
},
19+
"autoApprove": []
20+
}
21+
}
22+
}
23+
```
24+
25+
Replace `YOUR_GITHUB_PAT` with your [GitHub Personal Access Token](https://github.com/settings/tokens). To customize toolsets, add server-side headers like `X-MCP-Toolsets` or `X-MCP-Readonly` to the `headers` object — see [Server Configuration Guide](../server-configuration.md).
26+
27+
> **Important:** The transport type must be `"streamableHttp"` (camelCase, no hyphen). Using `"streamable-http"` or omitting the type will cause Cline to fall back to SSE, resulting in a `405` error.
28+
29+
## Local Server (Docker)
30+
31+
1. Click the Cline icon in your editor's sidebar (or open the command palette and search for "Cline"), then click the **MCP Servers** icon (server stack icon at the top of the Cline panel), and click **"Configure MCP Servers"** to open `cline_mcp_settings.json`.
32+
2. Add the configuration below, replacing `YOUR_GITHUB_PAT` with your [GitHub Personal Access Token](https://github.com/settings/tokens).
33+
34+
```json
35+
{
36+
"mcpServers": {
37+
"github": {
38+
"command": "docker",
39+
"args": [
40+
"run", "-i", "--rm",
41+
"-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
42+
"ghcr.io/github/github-mcp-server"
43+
],
44+
"env": {
45+
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT"
46+
}
47+
}
48+
}
49+
}
50+
```
51+
52+
## Troubleshooting
53+
54+
- **SSE error 405 with remote server**: Ensure `"type"` is set to `"streamableHttp"` (camelCase, no hyphen) in `cline_mcp_settings.json`. Using `"streamable-http"` or omitting `"type"` causes Cline to fall back to SSE, which this server does not support.
55+
- **Authentication failures**: Verify your PAT has the required scopes
56+
- **Docker issues**: Ensure Docker Desktop is installed and running
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Install GitHub MCP Server in Roo Code
2+
3+
[Roo Code](https://github.com/RooCodeInc/Roo-Code) is an AI coding assistant that runs in VS Code-compatible editors (VS Code, Cursor, Windsurf, etc.). For general setup information (prerequisites, Docker installation, security best practices), see the [Installation Guides README](./README.md).
4+
5+
## Remote Server
6+
7+
### Step-by-step setup
8+
9+
1. Click the **Roo Code icon** in your editor's sidebar to open the Roo Code pane
10+
2. Click the **gear icon** (⚙️) in the top navigation of the Roo Code pane, then click on **"MCP Servers"** icon on the left.
11+
3. Scroll to the bottom and click **"Edit Global MCP"** (for all projects) or **"Edit Project MCP"** (for the current project only)
12+
4. Add the configuration below to the opened file (`mcp_settings.json` or `.roo/mcp.json`)
13+
5. Replace `YOUR_GITHUB_PAT` with your [GitHub Personal Access Token](https://github.com/settings/tokens)
14+
6. Save the file — the server should connect automatically
15+
16+
```json
17+
{
18+
"mcpServers": {
19+
"github": {
20+
"type": "streamable-http",
21+
"url": "https://api.githubcopilot.com/mcp/",
22+
"headers": {
23+
"Authorization": "Bearer YOUR_GITHUB_PAT"
24+
}
25+
}
26+
}
27+
}
28+
```
29+
30+
> **Important:** The `type` must be `"streamable-http"` (with hyphen). Using `"http"` or omitting the type will fail.
31+
32+
To customize toolsets, add server-side headers like `X-MCP-Toolsets` or `X-MCP-Readonly` to the `headers` object — see [Server Configuration Guide](../server-configuration.md).
33+
34+
## Local Server (Docker)
35+
36+
```json
37+
{
38+
"mcpServers": {
39+
"github": {
40+
"command": "docker",
41+
"args": [
42+
"run", "-i", "--rm",
43+
"-e", "GITHUB_PERSONAL_ACCESS_TOKEN",
44+
"ghcr.io/github/github-mcp-server"
45+
],
46+
"env": {
47+
"GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT"
48+
}
49+
}
50+
}
51+
}
52+
```
53+
54+
## Troubleshooting
55+
56+
- **Connection failures**: Ensure `type` is `streamable-http`, not `http`
57+
- **Authentication failures**: Verify PAT is prefixed with `Bearer ` in the `Authorization` header
58+
- **Docker issues**: Ensure Docker Desktop is running

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

internal/ghmcp/server.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ import (
1818
"github.com/github/github-mcp-server/pkg/inventory"
1919
"github.com/github/github-mcp-server/pkg/lockdown"
2020
mcplog "github.com/github/github-mcp-server/pkg/log"
21+
"github.com/github/github-mcp-server/pkg/observability"
22+
"github.com/github/github-mcp-server/pkg/observability/metrics"
2123
"github.com/github/github-mcp-server/pkg/raw"
2224
"github.com/github/github-mcp-server/pkg/scopes"
2325
"github.com/github/github-mcp-server/pkg/translations"
@@ -116,6 +118,10 @@ func NewStdioMCPServer(ctx context.Context, cfg github.MCPServerConfig) (*mcp.Se
116118
featureChecker := createFeatureChecker(cfg.EnabledFeatures)
117119

118120
// Create dependencies for tool handlers
121+
obs, err := observability.NewExporters(cfg.Logger, metrics.NewNoopMetrics())
122+
if err != nil {
123+
return nil, fmt.Errorf("failed to create observability exporters: %w", err)
124+
}
119125
deps := github.NewBaseDeps(
120126
clients.rest,
121127
clients.gql,
@@ -128,6 +134,7 @@ func NewStdioMCPServer(ctx context.Context, cfg github.MCPServerConfig) (*mcp.Se
128134
},
129135
cfg.ContentWindowSize,
130136
featureChecker,
137+
obs,
131138
)
132139
// Build and register the tool/resource/prompt inventory
133140
inventoryBuilder := github.NewInventory(cfg.Translator).

pkg/github/__toolsnaps__/create_or_update_file.snap

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"annotations": {
33
"title": "Create or update file"
44
},
5-
"description": "Create or update a single file in a GitHub repository. \nIf updating, you should provide the SHA of the file you want to update. Use this tool to create or update a file in a GitHub repository remotely; do not use it for local file operations.\n\nIn order to obtain the SHA of original file version before updating, use the following git command:\ngit ls-tree HEAD \u003cpath to file\u003e\n\nIf the SHA is not provided, the tool will attempt to acquire it by fetching the current file contents from the repository, which may lead to rewriting latest committed changes if the file has changed since last retrieval.\n",
5+
"description": "Create or update a single file in a GitHub repository. \nIf updating, you should provide the SHA of the file you want to update. Use this tool to create or update a file in a GitHub repository remotely; do not use it for local file operations.\n\nIn order to obtain the SHA of original file version before updating, use the following git command:\ngit rev-parse \u003cbranch\u003e:\u003cpath to file\u003e\n\nSHA MUST be provided for existing file updates.\n",
66
"inputSchema": {
77
"properties": {
88
"branch": {
@@ -30,7 +30,7 @@
3030
"type": "string"
3131
},
3232
"sha": {
33-
"description": "The blob SHA of the file being replaced.",
33+
"description": "The blob SHA of the file being replaced. Required if the file already exists.",
3434
"type": "string"
3535
}
3636
},

0 commit comments

Comments
 (0)