Skip to content

Commit 836c570

Browse files
danbarrclaude
andauthored
Add GitHub Copilot CLI as a supported MCP client (#5287)
Copilot CLI reads MCP server entries from ~/.copilot/mcp-config.json using the standard mcpServers map. Register it with type "http" for streamable HTTP and SSE for the legacy transport, matching the behaviour we already use for VS Code and Cursor. Co-authored-by: Dan Barr <6922515+danbarr@users.noreply.github.com> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 17451d1 commit 836c570

7 files changed

Lines changed: 39 additions & 10 deletions

File tree

docs/cli/thv_client_register.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/cli/thv_client_remove.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/server/docs.go

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/server/swagger.json

Lines changed: 4 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/server/swagger.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/client/config.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,8 @@ const (
9898
KimiCli ClientApp = "kimi-cli"
9999
// Factory represents the Factory.ai Droid CLI.
100100
Factory ClientApp = "factory"
101+
// CopilotCli represents the GitHub Copilot CLI.
102+
CopilotCli ClientApp = "copilot-cli"
101103
)
102104

103105
const (
@@ -1003,6 +1005,25 @@ var supportedClientIntegrations = []clientAppConfig{
10031005
SkillsGlobalPath: []string{".factory", skillsDirName},
10041006
SkillsProjectPath: []string{".factory", skillsDirName},
10051007
},
1008+
{
1009+
ClientType: CopilotCli,
1010+
Description: "GitHub Copilot CLI",
1011+
SettingsFile: "mcp-config.json",
1012+
MCPServersPathPrefix: "/mcpServers",
1013+
RelPath: []string{".copilot"},
1014+
Extension: JSON,
1015+
SupportedTransportTypesMap: map[types.TransportType]string{
1016+
types.TransportTypeStdio: httpTransportLabel,
1017+
types.TransportTypeSSE: "sse",
1018+
types.TransportTypeStreamableHTTP: httpTransportLabel,
1019+
},
1020+
IsTransportTypeFieldSupported: true,
1021+
MCPServersUrlLabelMap: map[types.TransportType]string{
1022+
types.TransportTypeStdio: defaultURLFieldName,
1023+
types.TransportTypeSSE: defaultURLFieldName,
1024+
types.TransportTypeStreamableHTTP: defaultURLFieldName,
1025+
},
1026+
},
10061027
{
10071028
// Xcode does not support MCP; it is an LLM-gateway-only entry.
10081029
// Cast LLMClientApp → ClientApp for internal config storage; the type

pkg/client/config_test.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ func TestSuccessfulClientConfigOperations(t *testing.T) {
504504
case AmpWindsurf:
505505
assert.Contains(t, string(content), `"mcpServers":`,
506506
"AmpWindsurf config should contain mcpServers key")
507-
case LMStudio, Trae, Kiro, Antigravity, GeminiCli, KimiCli, Factory:
507+
case LMStudio, Trae, Kiro, Antigravity, GeminiCli, KimiCli, Factory, CopilotCli:
508508
assert.Contains(t, string(content), `"mcpServers":`,
509509
"Config should contain mcpServers key")
510510
case VSCodeServer:
@@ -563,7 +563,7 @@ func TestSuccessfulClientConfigOperations(t *testing.T) {
563563
"VSCode config should contain the server URL")
564564
case Cursor, RooCode, ClaudeCode, Cline, Windsurf, WindsurfJetBrains, AmpCli,
565565
AmpVSCode, AmpCursor, AmpVSCodeInsider, AmpWindsurf, LMStudio, Goose, Trae, Continue, OpenCode, Kiro, Antigravity, Zed, GeminiCli, VSCodeServer,
566-
MistralVibe, Codex, KimiCli, Factory:
566+
MistralVibe, Codex, KimiCli, Factory, CopilotCli:
567567
assert.Contains(t, string(content), testURL,
568568
"Config should contain the server URL")
569569
}
@@ -1292,8 +1292,8 @@ func TestGetAllClients(t *testing.T) {
12921292

12931293
clients := GetAllClients()
12941294

1295-
// Should return all 27 supported clients
1296-
assert.Len(t, clients, 27, "Expected 27 supported clients")
1295+
// Should return all 28 supported clients
1296+
assert.Len(t, clients, 28, "Expected 28 supported clients")
12971297

12981298
// Verify the list is sorted alphabetically
12991299
for i := 1; i < len(clients); i++ {
@@ -1507,7 +1507,7 @@ func TestGetClientListCSV(t *testing.T) {
15071507
clientNames[i-1], clientNames[i])
15081508
}
15091509

1510-
// Count the number of clients (should be 25)
1510+
// Count the number of clients (should be 28)
15111511
clients := strings.Split(csv, ", ")
1512-
assert.Len(t, clients, 27, "Expected 27 clients in CSV list")
1512+
assert.Len(t, clients, 28, "Expected 28 clients in CSV list")
15131513
}

0 commit comments

Comments
 (0)