Giving AI Coding Agents IDE Superpowers: IDEA MCP Server Integration with Codex

This article explains how IntelliJ IDEA's built-in MCP Server (since 2025.2) enables AI coding agents like Codex to directly control the IDE via the Model Context Protocol, allowing them to run configurations, read diagnostics, format code, and debug Spring Boot applications instead of relying on blind command-line builds.

Java Architecture Diary
Java Architecture Diary
Java Architecture Diary
Giving AI Coding Agents IDE Superpowers: IDEA MCP Server Integration with Codex

01 Where Current Vibe Coding Falls Short

You ask Codex to add an endpoint to a Spring Boot service. It writes the code, runs mvn package, and returns a compilation failure. When you ask what went wrong, it pastes a screen of errors. But it cannot show you the red squiggly line in the IDE, the missing bean injection in the Run window, or any real-time logs. The agent has no IDE — only a command line. It modifies your code but you cannot see how it actually runs.

The core problem: packaging verification is a black box. The agent relies on existing build scripts, but you never see how the script runs, what parameters it uses, or which step fails. It only reports "failed" and you have to trust the conclusion without the process.

02 IDEA MCP Server Fills This Gap

IDEA MCP Server does one thing: it lets external coding agents call your locally running IntelliJ IDEA through the MCP (Model Context Protocol). Since IntelliJ IDEA 2025.2, this server is built in — no extra plugin needed. By 2026.x, JetBrains streamlined auto-configuration for clients including Claude Code, Codex, Cursor, and VS Code.

Run and restart : Directly launch your configured Run Configuration (e.g., a Spring Boot main class), capturing exit codes and output without manually stitching Maven commands.

Code diagnostics : Invoke IDEA's inspectors to scan files, returning syntax errors, warnings, and type mismatches in one go. This is far richer than compiler output — effectively giving the agent the IDE's Problems view.

Code formatting : Call reformat_file to apply your project's formatting rules, which is more reliable than the agent guessing indentation.

03 Wiring It Up in Codex

Prerequisites: IntelliJ IDEA 2025.2 or newer, and an MCP-capable Codex.

Step 1: Enable the MCP Server

Open Settings | Tools | MCP Server, check Enable MCP Server. A dialog lists the permissions third-party apps will receive — review and confirm.

MCP Server settings
MCP Server settings
Permission dialog
Permission dialog

Step 2: Let IDEA Auto-Configure Codex

On the same page, find Clients Auto-Configuration, click Auto-Configure next to Codex. IDEA writes the connection details into Codex's config file (typically ~/.codex/config.toml). Avoid copying the port manually — let IDEA do it to prevent typos.

Auto-configuration UI
Auto-configuration UI

Step 3: Verify the Connection

Restart Codex, type /mcp, and confirm the idea service shows as connected.

Manual Configuration (Alternative)

If you prefer manual setup, add this block to ~/.codex/config.toml:

[mcp_servers.idea]
url = "http://127.0.0.1:64342/stream"

04 Putting It to the Test

Return to the Spring Boot scenario. After Codex edits the code, it should no longer run mvn package blindly. Instead, it calls IDEA's execute_run_configuration to start the main class, streaming the raw Run window stack trace to you. You sit in front of the IDE with a two-column diff, real-time logs, and the ability to drop breakpoints at will.

Codex using IDEA MCP to run Spring Boot
Codex using IDEA MCP to run Spring Boot

You can codify this workflow in your project's AGENTS.md so Codex automatically invokes the IDEA MCP for deployment verification whenever it makes changes.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

MCPIDE integrationSpring BootIntelliJ IDEAModel Context Protocoldeveloper toolsCodexAI coding agents
Java Architecture Diary
Written by

Java Architecture Diary

Committed to sharing original, high‑quality technical articles; no fluff or promotional content.

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.