-
Notifications
You must be signed in to change notification settings - Fork 461
GitHub Copilot support for JetBrains IDE #312
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
base: main
Are you sure you want to change the base?
GitHub Copilot support for JetBrains IDE #312
Conversation
WalkthroughAdds JetBrains GitHub Copilot as a new MCP client, introduces explicit integer values to McpTypes (including new JetBrainsCopilot), and updates the ManualConfigEditorWindow to render a Copilot-specific instruction branch. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant Editor as ManualConfigEditorWindow
participant Types as McpTypes
participant Data as McpClients
User->>Editor: Open Manual Config
Editor->>Data: Load available clients
Data-->>Editor: Clients list (includes JetBrainsCopilot)
Editor->>Types: switch(selectedClient.Type)
alt Type == JetBrainsCopilot
Editor-->>User: Show JetBrains Copilot instructions
else Other types
Editor-->>User: Show existing type-specific UI
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Possibly related PRs
Suggested reviewers
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 4
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (3)
UnityMcpBridge/Editor/Data/McpClients.cs
(1 hunks)UnityMcpBridge/Editor/Models/McpTypes.cs
(1 hunks)UnityMcpBridge/Editor/Windows/ManualConfigEditorWindow.cs
(1 hunks)
🔇 Additional comments (1)
UnityMcpBridge/Editor/Models/McpTypes.cs (1)
5-12
: Enum McpTypes explicit values match original ordinals
Assignments 0–6 unchanged and new member at value 7 preserves existing serialization compatibility.
mcpType = McpTypes.VSCode, | ||
configStatus = "Not Configured", | ||
}, | ||
// 6) JetBrains GitHub Copilot |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix comment numbering inconsistency.
The comment says "6) JetBrains GitHub Copilot", but the previous entries use "5)" for VSCode and "3)" for Kiro below. The numbering should be consistent throughout the list for maintainability.
Consider renumbering all entries sequentially (1-8) to match the actual order in the list.
🤖 Prompt for AI Agents
In UnityMcpBridge/Editor/Data/McpClients.cs around line 137, the inline comment
"6) JetBrains GitHub Copilot" is misnumbered relative to the surrounding list;
renumber the entire list entries sequentially (1 through N, e.g., 1-8) to
reflect the actual order, updating this line and any other out-of-sequence
comment numbers so the list is consistent and maintainable.
// 6) JetBrains GitHub Copilot | ||
new() | ||
{ | ||
name = "JetBrains GitHub Copilot", | ||
windowsConfigPath = Path.Combine( | ||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), | ||
"github-copilot", | ||
"intellij", | ||
"mcp.json" | ||
), | ||
macConfigPath = Path.Combine( | ||
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), | ||
"Library", | ||
"Application Support", | ||
"", //TODO(PR): I need some help here | ||
"", //TODO(PR): I need some help here | ||
"mcp.json" | ||
), | ||
linuxConfigPath = Path.Combine( | ||
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), | ||
".config", | ||
"", //TODO(PR): I need some help here | ||
"", //TODO(PR): I need some help here | ||
"mcp.json" | ||
), | ||
mcpType = McpTypes.JetBrainsCopilot, | ||
configStatus = "Not Configured", | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Critical: Empty path segments will create invalid file paths.
Lines 151-152 and 158-159 contain empty string arguments in Path.Combine
, which will result in consecutive path separators (e.g., ~/Library/Application Support//mcp.json
on macOS). This creates invalid paths that cannot be used to locate the configuration file.
The correct paths for JetBrains GitHub Copilot need to be researched. Based on typical JetBrains IDE conventions, the paths are likely:
macOS:
macConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"Library",
"Application Support",
"github-copilot",
"intellij",
"mcp.json"
)
Linux:
linuxConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".config",
"github-copilot",
"intellij",
"mcp.json"
)
However, these paths should be verified against official JetBrains GitHub Copilot documentation.
Run the following web search to find the official configuration paths:
🌐 Web query:
What is the configuration file path for GitHub Copilot in JetBrains IDEs on macOS and Linux?
💡 Result:
The Copilot config file is github-copilot.xml.
- macOS: ~/Library/Application Support/JetBrains//options/github-copilot.xml. [1][2]
- Linux: ~/.config/JetBrains//options/github-copilot.xml. [1][2]
(If the file doesn't exist yet, change the Copilot language settings in the IDE or create the file manually.) [1]
Critical: Invalid JetBrains Copilot config paths
Lines 151–152 and 158–159 use empty string segments and point to a non-existent “mcp.json”. The actual Copilot config is an XML file named github-copilot.xml under JetBrains//options. Update to:
macConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"Library",
"Application Support",
"JetBrains",
"<PRODUCT><VERSION>",
"options",
"github-copilot.xml"
);
linuxConfigPath = Path.Combine(
Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".config",
"JetBrains",
"<PRODUCT><VERSION>",
"options",
"github-copilot.xml"
);
Replace <PRODUCT><VERSION>
with the target IDE and version (e.g. IntelliJIdea2025.2).
🤖 Prompt for AI Agents
In UnityMcpBridge/Editor/Data/McpClients.cs around lines 137 to 164, the
macConfigPath and linuxConfigPath currently contain empty string path segments
and point to a non-existent mcp.json; replace those path builders so they point
to the JetBrains XML config location: use
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
"Library", "Application Support", "JetBrains", "<PRODUCT><VERSION>", "options",
"github-copilot.xml") for macConfigPath and
Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
".config", "JetBrains", "<PRODUCT><VERSION>", "options", "github-copilot.xml")
for linuxConfigPath, and document or replace the placeholder <PRODUCT><VERSION>
with the target IDE and version (e.g. IntelliJIdea2025.2).
windowsConfigPath = Path.Combine( | ||
Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), | ||
"github-copilot", | ||
"intellij", | ||
"mcp.json" | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
Verify the Windows config path is correct.
The Windows path uses %LOCALAPPDATA%\github-copilot\intellij\mcp.json
. Please verify this is the correct location where JetBrains GitHub Copilot stores its MCP configuration file on Windows.
🌐 Web query:
What is the MCP configuration file location for GitHub Copilot in JetBrains IDEs on Windows?
💡 Result:
You don't need to hunt for a specific file path — in JetBrains IDEs GitHub Copilot's MCP config is edited from the Copilot UI (GitHub Copilot icon → Edit settings → "Edit in mcp.json"), which opens the mcp.json configuration used by the IDE. See GitHub's Copilot MCP docs and JetBrains' MCP/AI Assistant docs for details. [1][2]
Sources:
[1] GitHub docs — Extending Copilot Chat with the Model Context Protocol (MCP).
[2] JetBrains — Model Context Protocol (MCP) / MCP Server documentation.
Remove hardcoded Windows MCP config path. The Copilot MCP configuration isn’t stored at %LOCALAPPDATA%\github-copilot\intellij\mcp.json
—it’s managed through the IDE UI.
🤖 Prompt for AI Agents
In UnityMcpBridge/Editor/Data/McpClients.cs around lines 141-146, remove the
hardcoded Windows MCP config path that points to
%LOCALAPPDATA%\github-copilot\intellij\mcp.json; instead stop assuming a fixed
file location and either (a) obtain the MCP config path via the IDE/settings API
or a passed-in configuration value (e.g., GetMcpPathFromIDE() or a
constructor/initializer parameter), or (b) set the windowsConfigPath variable to
null/absent and rely on the IDE-managed configuration flow. Delete the hardcoded
Path.Combine block and replace it with a call or fallback that defers to the
IDE/configuration provider so the code no longer assumes a local file path.
else if (mcpClient?.mcpType == McpTypes.JetBrainsCopilot) | ||
{ | ||
EditorGUILayout.LabelField( | ||
" a) Going to File > Settings > Tools > GitHub Copilot > Model Context Protocol (MCP) > Configure", | ||
instructionStyle | ||
); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion | 🟠 Major
🧩 Analysis chain
Verify the instruction path matches JetBrains IDE UI.
The instruction path "File > Settings > Tools > GitHub Copilot > Model Context Protocol (MCP) > Configure" should be verified against the actual JetBrains IDE interface to ensure users can follow it successfully.
🌐 Web query:
How to configure Model Context Protocol (MCP) for GitHub Copilot in JetBrains IDEs?
💡 Result:
Short answer — use the Copilot Chat MCP config (mcp.json) inside the JetBrains Copilot Chat tools UI or enable the IDE’s built‑in MCP server and copy the client config. Steps + examples:
-
Open Copilot Chat in your JetBrains IDE (lower right Copilot icon) and switch to Agent mode. Click the tools icon (“Configure your MCP server”) → Add MCP Tools → Edit mcp.json. [1]
-
Add one or more MCP servers in mcp.json. Examples:
- Remote (GitHub API with PAT):
{
"servers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"requestInit": { "headers": { "Authorization": "Bearer YOUR_PAT_HERE" } }
}
}
} - Local (memory server):
{
"servers": {
"memory": {
"command": "npx",
"args": ["-y","@modelcontextprotocol/server-memory"]
}
}
}
Save the file and restart the client if needed. [1]
- Remote (GitHub API with PAT):
-
(Alternative) Use JetBrains’ built‑in MCP server (JetBrains 2025.2+): Settings | Tools | MCP Server → Enable MCP Server. Use Auto‑Configure for supported external clients or Copy SSE/StdIO config and paste into the external client’s config (then restart that client). You can also enable “Run shell commands / run configurations without confirmation” if desired. [2]
-
If using the JetBrains MCP proxy (for external clients or multiple IDEs) install the mcp‑server plugin or proxy (JetBrains mcp proxy / mcp-jetbrains) and configure the client to run the proxy (example: command: "npx", args: ["-y","@jetbrains/mcp-proxy"]). Set IDE_PORT/HOST env if needed. Troubleshooting notes (Node ≥18, nvm symlink) are in the repo/docs. [3][4]
References:
[1] GitHub Docs — Extending Copilot Chat with Model Context Protocol (MCP).
[2] JetBrains Help — Use your IDE as an MCP server (MCP settings & auto‑configure).
[3] JetBrains mcp-jetbrains / proxy repo (usage examples).
[4] JetBrains MCP Server plugin repo / docs.
Update JetBrains Copilot MCP configuration path
Change the instruction text in UnityMcpBridge/Editor/Windows/ManualConfigEditorWindow.cs (lines 104–110) to reflect the current Copilot Chat UI, for example:
EditorGUILayout.LabelField(
" a) Open Copilot Chat (click the lower-right Copilot icon), click the Tools icon (‘Configure your MCP server’) and edit mcp.json",
instructionStyle
);
🤖 Prompt for AI Agents
In UnityMcpBridge/Editor/Windows/ManualConfigEditorWindow.cs around lines 104 to
110, update the JetBrains Copilot MCP instruction string to reflect the current
Copilot Chat UI: replace the existing LabelField text that points to File >
Settings > Tools > GitHub Copilot with a new message instructing users to open
Copilot Chat (lower-right Copilot icon), click the Tools/Configure your MCP
server icon, and edit mcp.json, keeping the same instructionStyle parameter.
Awesome @melipefello! Would their docs have where the MCP configs go? |
Hey there, let me know if this is ok or need some changes :)
The only thing I couldn't find online was the path for the mcp.json on Linux and MacOS - I would be very thankful if someone could fetch those to help in this PR.
Summary by CodeRabbit
New Features
Documentation