Skip to content

Commit d516cfd

Browse files
committed
Add JetBrains Copilot plugin support
1 parent 89514e5 commit d516cfd

File tree

9 files changed

+50
-8
lines changed

9 files changed

+50
-8
lines changed

cmd/thv/app/config.go

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ Valid clients are:
4141
- claude-code: Claude Code CLI
4242
- cline: Cline extension for VS Code
4343
- cursor: Cursor editor
44+
- jetbrains-copilot: Copilot extension for JetBrains IDEs
4445
- roo-code: Roo Code extension for VS Code
4546
- vscode: Visual Studio Code
4647
- vscode-insider: Visual Studio Code Insiders edition`,
@@ -56,6 +57,7 @@ Valid clients are:
5657
- claude-code: Claude Code CLI
5758
- cline: Cline extension for VS Code
5859
- cursor: Cursor editor
60+
- jetbrains-copilot: Copilot extension for JetBrains IDEs
5961
- roo-code: Roo Code extension for VS Code
6062
- vscode: Visual Studio Code
6163
- vscode-insider: Visual Studio Code Insiders edition`,
@@ -150,11 +152,11 @@ func registerClientCmdFunc(cmd *cobra.Command, args []string) error {
150152

151153
// Validate the client type
152154
switch clientType {
153-
case "roo-code", "cline", "cursor", "claude-code", "vscode-insider", "vscode":
155+
case "roo-code", "cline", "cursor", "claude-code", "jetbrains-copilot", "vscode-insider", "vscode":
154156
// Valid client type
155157
default:
156158
return fmt.Errorf(
157-
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, vscode, vscode-insider)",
159+
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, jetbrains-copilot, vscode, vscode-insider)",
158160
clientType)
159161
}
160162

@@ -189,11 +191,11 @@ func removeClientCmdFunc(_ *cobra.Command, args []string) error {
189191

190192
// Validate the client type
191193
switch clientType {
192-
case "roo-code", "cline", "cursor", "claude-code", "vscode-insider", "vscode":
194+
case "roo-code", "cline", "cursor", "claude-code", "jetbrains-copilot", "vscode-insider", "vscode":
193195
// Valid client type
194196
default:
195197
return fmt.Errorf(
196-
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, vscode, vscode-insider)",
198+
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, jetbrains-copilot, vscode, vscode-insider)",
197199
clientType)
198200
}
199201

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
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/server/swagger.yaml

Lines changed: 5 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: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ const (
3737
VSCode MCPClient = "vscode"
3838
// ClaudeCode represents the Claude Code CLI.
3939
ClaudeCode MCPClient = "claude-code"
40+
// JetBrainsCopilot represents the Copilot plugin for JetBrains IDEs.
41+
JetBrainsCopilot MCPClient = "jetbrains-copilot"
4042
)
4143

4244
// Extension is extension of the client config file.
@@ -179,6 +181,26 @@ var supportedClientIntegrations = []mcpClientConfig{
179181
},
180182
IsTransportTypeFieldSupported: true,
181183
},
184+
{
185+
ClientType: JetBrainsCopilot,
186+
Description: "JetBrains Copilot plugin",
187+
SettingsFile: "mcp.json",
188+
RelPath: []string{
189+
"github-copilot", "intellij",
190+
},
191+
MCPServersPathPrefix: "/servers",
192+
PlatformPrefix: map[string][]string{
193+
"linux": {".config"},
194+
"darwin": {".config"},
195+
"windows": {"AppData", "Local"},
196+
},
197+
SupportedTransportTypesMap: map[types.TransportType]string{
198+
types.TransportTypeStdio: "sse",
199+
types.TransportTypeSSE: "sse",
200+
types.TransportTypeStreamableHTTP: "http",
201+
},
202+
Extension: JSON,
203+
},
182204
}
183205

184206
// ConfigFile represents a client configuration file

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

@@ -281,6 +289,9 @@ func TestSuccessfulClientConfigOperations(t *testing.T) {
281289
case Cline:
282290
assert.Contains(t, string(content), `"mcpServers":`,
283291
"Cline config should contain mcpServers key")
292+
case JetBrainsCopilot:
293+
assert.Contains(t, string(content), `"servers":`,
294+
"JetBrains Copilot config should contain servers key")
284295
}
285296
}
286297
})
@@ -306,7 +317,7 @@ func TestSuccessfulClientConfigOperations(t *testing.T) {
306317
case VSCode, VSCodeInsider:
307318
assert.Contains(t, string(content), testURL,
308319
"VSCode config should contain the server URL")
309-
case Cursor, RooCode, ClaudeCode, Cline:
320+
case Cursor, RooCode, ClaudeCode, Cline, JetBrainsCopilot:
310321
assert.Contains(t, string(content), testURL,
311322
"Config should contain the server URL")
312323
}

pkg/config/config_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ func TestSave(t *testing.T) {
106106
ProviderType: string(secrets.EncryptedType),
107107
},
108108
Clients: Clients{
109-
RegisteredClients: []string{"vscode", "cursor", "roo-code", "cline", "claude-code"},
109+
RegisteredClients: []string{"vscode", "cursor", "roo-code", "cline", "claude-code", "jetbrains-copilot"},
110110
},
111111
}
112112

0 commit comments

Comments
 (0)