MCP in JetBrains IDEs: AI Assistant and MCP Server
On this page
Two different things with the same name
When people say "MCP in IntelliJ", they mean one of two setups, and the settings live in different places:
| You want to | Where | Direction |
|---|---|---|
| Let JetBrains AI Assistant call GitHub, a database or a browser | Settings, Tools, AI Assistant, Model Context Protocol (MCP) | The IDE is the client |
| Let Claude Code, Codex or another agent use your IDE's search, refactoring and run configurations | Settings, Tools, MCP Server | The IDE is the server |
This guide covers both. It follows the AI Assistant 2026.2 documentation, and the steps are the same in IntelliJ IDEA, PyCharm, WebStorm, GoLand and the other IDEs that run AI Assistant.
Part 1: connect MCP servers to AI Assistant
- Open Settings (Cmd+, on macOS, Ctrl+Alt+S on Windows and Linux).
- Go to Tools, then AI Assistant, then Model Context Protocol (MCP).
- Click Add. In the dialog, choose how to connect and paste the server's JSON.
The JSON uses the same mcpServers shape as Claude Desktop and Cursor. A local server that the IDE starts for you:
{
"mcpServers": {
"playwright": {
"command": "npx",
"args": ["-y", "@playwright/mcp@0.0.84"]
}
}
}A remote server over Streamable HTTP is just a URL. Microsoft's documentation server is a good one to test with, because it needs no account:
{
"mcpServers": {
"microsoftdocs": {
"url": "https://learn.microsoft.com/api/mcp"
}
}
}AI Assistant supports stdio and Streamable HTTP, plus the older SSE transport for legacy servers. Two other fields in the dialog are worth setting:
- Working directory: the folder the server starts in. Set it for servers that read files relative to where they run.
- Server level: available globally, or only in the current project. You can change it later in the Level column.
Already set up servers in Claude Desktop? The Import from Claude button copies them over instead of retyping each one.
Click Apply to start the server. The Status column shows whether it connected. If you'd rather approve each new or changed server yourself, turn off Automatically enable new and changed MCP servers.
Using the tools in chat
AI Assistant calls MCP tools on its own when a request needs them. To call one by hand, type / in the chat box and pick the tool. The same / menu has an Add Command option that opens the MCP settings directly.
If a server shows an error, use Reconnect first. For details, open Help, then Show Log in Finder (or Explorer), and look in the mcp folder.
Part 2: run your IDE as an MCP server
Since version 2025.2, JetBrains IDEs include a built-in MCP server. It gives an external agent access to what the IDE knows: project structure, symbol search, inspections and run configurations. A terminal agent like Claude Code gets far better answers about a large Java or Kotlin codebase when it can ask the IDE instead of grepping files.
- Open Settings, then Tools, then MCP Server.
- Click Enable MCP Server.
- Connect your agent. Under Clients Auto-Configuration, click Auto-Configure next to a detected client such as Claude Code, Codex or VS Code, and the IDE writes that client's config for you. Project Clients Auto-Configuration does the same for project-level config files.
For a client that isn't listed, use Manual Client Configuration. It has buttons to copy the SSE, stdio or HTTP config, which you paste into that client's MCP settings.
Two settings decide how much the agent can do. Exposed Tools lists every tool the IDE offers, and you can switch off ones you don't want an agent to use. Under command execution, an option lets the agent run shell commands or run configurations without asking. JetBrains calls it "brave mode". Leave it off unless you're working in a throwaway environment.
Check yourself
Tools, MCP Server. That runs the IDE as an MCP server. The Tools, AI Assistant, MCP page is for the opposite direction.
Use Import from Claude on the AI Assistant MCP settings page.
It lets the connected agent run shell commands and run configurations without asking. One bad instruction, or a prompt injection, could then run anything on your machine.