Add a Remote MCP Server to JetBrains AI Assistant and Junie
How to add a remote MCP server to a JetBrains IDE: the AI Assistant MCP settings and its url entry, Junie's mcp.json with headers and OAuth, global vs project level, logs, and how this differs from the IDE's own MCP server.
In IntelliJ IDEA, PyCharm, WebStorm and the other JetBrains IDEs, AI Assistant takes a remote MCP server as one entry with a url [1]:
{
"mcpServers": {
"my-server": {
"url": "https://mcp.example.com/mcp"
}
}
}
Open Settings | Tools | AI Assistant | Model Context Protocol (MCP), click Add, choose the HTTP connection, paste the JSON, then click OK and Apply [1]. You can also type / in the AI chat and pick Add Command [1].
Junie, JetBrains' coding agent, keeps its own server list in a separate mcp.json (below). Everything here is checked against JetBrains' AI Assistant and Junie documentation on 13 November 2026 [1][2][3].
One thing first, because the search results mix them up. The IDE also has a built-in MCP Server under Settings | AI | MCP Server [1]. That one runs the other way: it exposes your IDE to an outside client such as Claude Code or Codex. This page covers the opposite, connecting AI Assistant or Junie to a server somewhere else.
TL;DR:
- AI Assistant takes Streamable HTTP and SSE. Its examples use
/mcpfor Streamable HTTP and/ssefor SSE [1]. - Each server is global or per project. You pick the Server level when you add it and change it later in the Level column [1].
- AI Assistant's docs show no
headersfield for a remote server. Junie's do [1][3]. - Logs are files, one per server, under Help | Show Log in Explorer (or Finder), in the
mcpfolder [1].
Add the server to AI Assistant
The URL is the MCP endpoint itself, usually ending in /mcp, not the product's homepage or its docs page. The fields AI Assistant's page shows are url for a remote server and command with args for a local one; it lists no type field [1].
After Apply, the server shows in the list with its state in the Status column. Click the icon there to see the tools it offers [1].
To switch a server off, clear its checkbox and click Apply [1]. To have new or edited servers start without that step, turn on Automatically enable new and changed MCP servers [1]. Reconnect restarts the connection to the selected server [1].
Servers that need a token or a sign-in
AI Assistant's MCP page documents no header field and no sign-in flow for a remote server [1]. If your server needs a key, Junie is the documented route.
Junie reads mcp.json from two places [3]:
| File | Applies to |
|---|---|
.junie/mcp/mcp.json in the project |
That project, and it can be committed |
~/.junie/mcp/mcp.json |
Every project, private to your account |
A remote entry there takes url, headers and an optional timeout in milliseconds, between 1000 and 3600000 [3]:
{
"mcpServers": {
"my-server": {
"url": "https://mcp.example.com/mcp",
"headers": {
"Authorization": "Bearer your-token"
},
"timeout": 120000
}
}
}
The token sits in the file as plain text in the documented example [3], so keep it in the user file, not the project file you commit.
In the IDE, Junie's servers are under Settings | Tools | Junie | MCP Settings, where Add opens the mcp.json to edit and the list shows each server's status, its tools and whether it is global or project level [2][5]. Servers added there are saved to ~/.junie/mcp/mcp.json [5].
For OAuth, Junie's CLI documentation says a server that requires it is listed with an Authorization required status; select it, choose Authorize, sign in on the page that opens, and the status turns Active [3]. Whether the sign-in can work depends on what the server publishes: we read the authorization metadata of 169 servers that ask for credentials, from our registry census on 9 October 2026, and 162 offered Dynamic Client Registration [4]. MCP OAuth covers the server side.
When it will not connect
Start with the log. Help | Show Log in Explorer (Windows) or Show Log in Finder (macOS) opens the log folder, and its mcp folder has one log per configured server [1].
| What you see | Usual cause | Fix |
|---|---|---|
| The server is listed but not running | It is unchecked, or the change was not applied | Tick it and click Apply [1] |
| No tools, or an error from the server | The URL is the homepage or docs page | Use the endpoint, usually ending in /mcp |
401 in AI Assistant |
The server needs a key and the entry has no header | Add it through Junie's mcp.json with headers [3] |
401 in Junie with a header set |
Token wrong or expired | Replace it in headers |
| Junie shows Authorization required | The server uses OAuth | Select it, Authorize, sign in [3] |
| A server works in one project only | It was added at project level | Change it in the Level column [1] |
| A long tool call fails in Junie | It ran past the timeout | Raise timeout, up to 3600000 [3] |
| An outside client cannot reach your IDE | That is the IDE's own MCP Server, a different feature | Turn on Enable MCP Server on the IDE's MCP Server settings page, version 2025.2 and later [1] |
For what the server's own error codes mean, see MCP server errors and MCP server connection failed.
Check it from outside before you share it
The IDE connects from your own machine, so a server on localhost or your VPN works for you and for nobody else. Our MCP connection test calls your server from our network, runs the handshake and tools/list, and reports what a stranger on the internet gets back, with a dated URL you can share. If it passes there and fails in the IDE, the problem is in your configuration, not the server.
The same setup in other clients is in Cursor, VS Code, Zed, Windsurf, Kiro, Cline, Claude Code, Codex, Claude Desktop and ChatGPT, and remote MCP server vs stdio covers whether your server should have a public address at all.