Skip to content

Commit 4c5b8f2

Browse files
committed
Add JetBrains Copilot plugin support
1 parent 46ddeb5 commit 4c5b8f2

File tree

9 files changed

+48
-9
lines changed

9 files changed

+48
-9
lines changed

cmd/thv/app/config.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ Valid clients are:
5050
- claude-code: Claude Code CLI
5151
- cline: Cline extension for VS Code
5252
- cursor: Cursor editor
53+
- jetbrains-copilot: Copilot extension for JetBrains IDEs
5354
- roo-code: Roo Code extension for VS Code
5455
- vscode: Visual Studio Code
5556
- vscode-insider: Visual Studio Code Insiders edition`,
@@ -65,6 +66,7 @@ Valid clients are:
6566
- claude-code: Claude Code CLI
6667
- cline: Cline extension for VS Code
6768
- cursor: Cursor editor
69+
- jetbrains-copilot: Copilot extension for JetBrains IDEs
6870
- roo-code: Roo Code extension for VS Code
6971
- vscode: Visual Studio Code
7072
- vscode-insider: Visual Studio Code Insiders edition`,
@@ -181,11 +183,11 @@ func registerClientCmdFunc(cmd *cobra.Command, args []string) error {
181183

182184
// Validate the client type
183185
switch clientType {
184-
case "roo-code", "cline", "cursor", "claude-code", "vscode-insider", "vscode":
186+
case "roo-code", "cline", "cursor", "claude-code", "jetbrains-copilot", "vscode-insider", "vscode":
185187
// Valid client type
186188
default:
187189
return fmt.Errorf(
188-
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, vscode, vscode-insider)",
190+
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, jetbrains-copilot, vscode, vscode-insider)",
189191
clientType)
190192
}
191193

@@ -220,11 +222,11 @@ func removeClientCmdFunc(_ *cobra.Command, args []string) error {
220222

221223
// Validate the client type
222224
switch clientType {
223-
case "roo-code", "cline", "cursor", "claude-code", "vscode-insider", "vscode":
225+
case "roo-code", "cline", "cursor", "claude-code", "jetbrains-copilot", "vscode-insider", "vscode":
224226
// Valid client type
225227
default:
226228
return fmt.Errorf(
227-
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, vscode, vscode-insider)",
229+
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, jetbrains-copilot, vscode, vscode-insider)",
228230
clientType)
229231
}
230232

docs/cli/thv_config_register-client.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_config_remove-client.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: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/server/swagger.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

docs/server/swagger.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ components:
1414
- VSCodeInsider
1515
- VSCode
1616
- ClaudeCode
17+
- JetBrainsCopilot
1718
client.MCPClientStatus:
1819
properties:
1920
client_type:
@@ -26,6 +27,7 @@ components:
2627
- VSCodeInsider
2728
- VSCode
2829
- ClaudeCode
30+
- JetBrainsCopilot
2931
installed:
3032
description: Installed indicates whether the client is installed on the
3133
system
@@ -282,6 +284,7 @@ components:
282284
- VSCodeInsider
283285
- VSCode
284286
- ClaudeCode
287+
- JetBrainsCopilot
285288
type: object
286289
v1.createClientResponse:
287290
properties:
@@ -295,6 +298,7 @@ components:
295298
- VSCodeInsider
296299
- VSCode
297300
- ClaudeCode
301+
- JetBrainsCopilot
298302
type: object
299303
v1.createRequest:
300304
description: Request to create a new workload

pkg/client/config.go

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ const (
3838
VSCode MCPClient = "vscode"
3939
// ClaudeCode represents the Claude Code CLI.
4040
ClaudeCode MCPClient = "claude-code"
41+
// JetBrainsCopilot represents the Copilot plugin for JetBrains IDEs.
42+
JetBrainsCopilot MCPClient = "jetbrains-copilot"
4143
)
4244

4345
// Extension is extension of the client config file.
@@ -136,6 +138,21 @@ var supportedClientIntegrations = []mcpClientConfig{
136138
RelPath: []string{},
137139
Extension: JSON,
138140
},
141+
{
142+
ClientType: JetBrainsCopilot,
143+
Description: "JetBrains Copilot plugin",
144+
SettingsFile: "mcp.json",
145+
RelPath: []string{
146+
"github-copilot", "intellij",
147+
},
148+
MCPServersPathPrefix: "/servers",
149+
PlatformPrefix: map[string][]string{
150+
"linux": {".config"},
151+
"darwin": {".config"},
152+
"windows": {"AppData", "Local"},
153+
},
154+
Extension: JSON,
155+
},
139156
}
140157

141158
// ConfigFile represents a client configuration file
@@ -209,7 +226,10 @@ func FindClientConfigs() ([]ConfigFile, error) {
209226
// build up more complex MCP server configurations for different clients
210227
// without leaking them into the CMD layer.
211228
func Upsert(cf ConfigFile, name string, url string) error {
212-
if cf.ClientType == VSCode || cf.ClientType == VSCodeInsider || cf.ClientType == ClaudeCode {
229+
if cf.ClientType == VSCode ||
230+
cf.ClientType == VSCodeInsider ||
231+
cf.ClientType == ClaudeCode ||
232+
cf.ClientType == JetBrainsCopilot {
213233
return cf.ConfigUpdater.Upsert(name, MCPServer{Url: url, Type: "sse"})
214234
}
215235

pkg/client/config_test.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ func createMockClientConfigs() []mcpClientConfig {
5959
MCPServersPathPrefix: "/mcpServers",
6060
Extension: JSON,
6161
},
62+
{
63+
ClientType: JetBrainsCopilot,
64+
Description: "JetBrains Copilot plugin (Mock)",
65+
RelPath: []string{"mock_jetbrains_copilot"},
66+
SettingsFile: "mcp.json",
67+
MCPServersPathPrefix: "/servers",
68+
Extension: JSON,
69+
},
6270
}
6371
}
6472

@@ -379,6 +387,9 @@ func TestSuccessfulClientConfigOperations(t *testing.T) {
379387
case Cline:
380388
assert.Contains(t, string(content), `"mcpServers":`,
381389
"Cline config should contain mcpServers key")
390+
case JetBrainsCopilot:
391+
assert.Contains(t, string(content), `"servers":`,
392+
"JetBrains Copilot config should contain servers key")
382393
}
383394
}
384395
})
@@ -404,7 +415,7 @@ func TestSuccessfulClientConfigOperations(t *testing.T) {
404415
case VSCode, VSCodeInsider:
405416
assert.Contains(t, string(content), testURL,
406417
"VSCode config should contain the server URL")
407-
case Cursor, RooCode, ClaudeCode, Cline:
418+
case Cursor, RooCode, ClaudeCode, Cline, JetBrainsCopilot:
408419
assert.Contains(t, string(content), testURL,
409420
"Config should contain the server URL")
410421
}

pkg/config/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ func TestSave(t *testing.T) {
110110
},
111111
Clients: Clients{
112112
AutoDiscovery: true,
113-
RegisteredClients: []string{"vscode", "cursor", "roo-code", "cline", "claude-code"},
113+
RegisteredClients: []string{"vscode", "cursor", "roo-code", "cline", "claude-code", "jetbrains-copilot"},
114114
},
115115
}
116116

0 commit comments

Comments
 (0)