Skip to content

Add JetBrains Copilot plugin as a supported client #814

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions cmd/thv/app/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ Valid clients are:
- claude-code: Claude Code CLI
- cline: Cline extension for VS Code
- cursor: Cursor editor
- jetbrains-copilot: Copilot extension for JetBrains IDEs
- roo-code: Roo Code extension for VS Code
- vscode: Visual Studio Code
- vscode-insider: Visual Studio Code Insiders edition`,
Expand All @@ -56,6 +57,7 @@ Valid clients are:
- claude-code: Claude Code CLI
- cline: Cline extension for VS Code
- cursor: Cursor editor
- jetbrains-copilot: Copilot extension for JetBrains IDEs
- roo-code: Roo Code extension for VS Code
- vscode: Visual Studio Code
- vscode-insider: Visual Studio Code Insiders edition`,
Expand Down Expand Up @@ -150,11 +152,11 @@ func registerClientCmdFunc(cmd *cobra.Command, args []string) error {

// Validate the client type
switch clientType {
case "roo-code", "cline", "cursor", "claude-code", "vscode-insider", "vscode":
case "roo-code", "cline", "cursor", "claude-code", "jetbrains-copilot", "vscode-insider", "vscode":
// Valid client type
default:
return fmt.Errorf(
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, vscode, vscode-insider)",
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, jetbrains-copilot, vscode, vscode-insider)",
clientType)
}

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

// Validate the client type
switch clientType {
case "roo-code", "cline", "cursor", "claude-code", "vscode-insider", "vscode":
case "roo-code", "cline", "cursor", "claude-code", "jetbrains-copilot", "vscode-insider", "vscode":
// Valid client type
default:
return fmt.Errorf(
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, vscode, vscode-insider)",
"invalid client type: %s (valid types: roo-code, cline, cursor, claude-code, jetbrains-copilot, vscode, vscode-insider)",
clientType)
}

Expand Down
1 change: 1 addition & 0 deletions docs/cli/thv_config_register-client.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions docs/cli/thv_config_remove-client.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/server/docs.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/server/swagger.json

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/server/swagger.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions pkg/client/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ const (
VSCode MCPClient = "vscode"
// ClaudeCode represents the Claude Code CLI.
ClaudeCode MCPClient = "claude-code"
// JetBrainsCopilot represents the Copilot plugin for JetBrains IDEs.
JetBrainsCopilot MCPClient = "jetbrains-copilot"
)

// Extension is extension of the client config file.
Expand Down Expand Up @@ -179,6 +181,27 @@ var supportedClientIntegrations = []mcpClientConfig{
},
IsTransportTypeFieldSupported: true,
},
{
ClientType: JetBrainsCopilot,
Description: "JetBrains Copilot plugin",
SettingsFile: "mcp.json",
RelPath: []string{
"github-copilot", "intellij",
},
MCPServersPathPrefix: "/servers",
PlatformPrefix: map[string][]string{
"linux": {".config"},
"darwin": {".config"},
"windows": {"AppData", "Local"},
},
Extension: JSON,
SupportedTransportTypesMap: map[types.TransportType]string{
types.TransportTypeStdio: "sse",
types.TransportTypeSSE: "sse",
types.TransportTypeStreamableHTTP: "http",
},
IsTransportTypeFieldSupported: true,
},
}

// ConfigFile represents a client configuration file
Expand Down
21 changes: 20 additions & 1 deletion pkg/client/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ func createMockClientConfigs() []mcpClientConfig {
MCPServersPathPrefix: "/mcpServers",
Extension: JSON,
},
{
ClientType: Cline,
Description: "VS Code Cline extension (Mock)",
RelPath: []string{"mock_cline"},
SettingsFile: "mcp_settings.json",
MCPServersPathPrefix: "/mcpServers",
Extension: JSON,
},
{
ClientType: ClaudeCode,
Description: "Claude Code CLI (Mock)",
Expand All @@ -51,6 +59,14 @@ func createMockClientConfigs() []mcpClientConfig {
MCPServersPathPrefix: "/mcpServers",
Extension: JSON,
},
{
ClientType: JetBrainsCopilot,
Description: "JetBrains Copilot plugin (Mock)",
RelPath: []string{"mock_jetbrains_copilot"},
SettingsFile: "mcp.json",
MCPServersPathPrefix: "/servers",
Extension: JSON,
},
}
}

Expand Down Expand Up @@ -273,6 +289,9 @@ func TestSuccessfulClientConfigOperations(t *testing.T) {
case Cline:
assert.Contains(t, string(content), `"mcpServers":`,
"Cline config should contain mcpServers key")
case JetBrainsCopilot:
assert.Contains(t, string(content), `"servers":`,
"JetBrains Copilot config should contain servers key")
}
}
})
Expand All @@ -298,7 +317,7 @@ func TestSuccessfulClientConfigOperations(t *testing.T) {
case VSCode, VSCodeInsider:
assert.Contains(t, string(content), testURL,
"VSCode config should contain the server URL")
case Cursor, RooCode, ClaudeCode, Cline:
case Cursor, RooCode, ClaudeCode, Cline, JetBrainsCopilot:
assert.Contains(t, string(content), testURL,
"Config should contain the server URL")
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func TestSave(t *testing.T) {
ProviderType: string(secrets.EncryptedType),
},
Clients: Clients{
RegisteredClients: []string{"vscode", "cursor", "roo-code", "cline", "claude-code"},
RegisteredClients: []string{"vscode", "cursor", "roo-code", "cline", "claude-code", "jetbrains-copilot"},
},
}

Expand Down
Loading