Integrating AI Coding Agents into JetBrains IDEs with ACP: A Practical Guide

    This article explains how to integrate external AI coding agents into JetBrains IDEs using the Agent Client Protocol (ACP). It covers why native plugins and standalone CLI tools often fall short, how ACP enables context sharing and native UI interactions, and the required environment setup. You will find step-by-step instructions for installing the ACP adapter, configuring a custom agent through JSON, troubleshooting common issues, and recommendations for team adoption.

    1. Why Native Plugin Experiences Often Fall Short

    When using AI coding capabilities in JetBrains IDEs, developers typically run into two kinds of problems. First, official plugins have limited capabilities and interaction models, with weak integration between code completion, conversation context, and editor state. Second, standalone command-line AI coding tools often face compatibility issues on environments such as Windows, including terminal rendering, path handling, and encoding detection, which lead to sluggish interactions and garbled output.

    The solution is not to switch tools but to change how they are integrated: mount external AI coding agents into the IDE’s AI framework as custom agent services through a standardized protocol such as the Agent Client Protocol (ACP). This approach offers three benefits:

    • More complete context: the IDE can provide the agent with files, symbols, and dependency relationships it knows about.
    • More native interaction: chat panels, diff previews, and applying changes all go through the IDE’s own UI instead of a terminal character interface.
    • Better control: tool calls, permission confirmations, and log tracing are all governed centrally on the IDE side.

    2. How ACP Enables IDE and External Agent Collaboration

    ACP is essentially an inter-process communication protocol. The IDE acts as the client and the external agent as the server, exchanging structured messages over standard input and output streams. Understanding this chain helps with later troubleshooting:

    1. IDE AI panel <--> ACP adapter layer <--> External AI coding agent process
    2. | | |
    3. Context injection Message serialization Model calls and tool execution

    The key point is that the IDE does not call the model directly. Instead, it exposes capabilities such as reading files, modifying files, and running commands to the agent as tools, and the agent decides the order in which to call them. Integration quality therefore depends on two factors: how well the IDE version supports ACP, and whether the adapter layer process is available.

    3. Environment Preparation

    1. IDE version: a recent annual release (build 2025.3.2 or later) is recommended. Older versions lack the custom agent entry in the AI panel.
    2. AI assistant plugin: install it from the IDE’s right sidebar entry or the official plugin repository. The plugin build must be from after 2025.12. Basic chat capabilities are available without activation after installation.
    3. Runtime environment: a working Node.js runtime and package manager are required to launch the adapter layer process.
    4. Offline scenarios: on intranet machines, download the plugin package in a networked environment first, then install it offline.

    4. Installing the ACP Adapter Layer

    Run a global install in the terminal (on Windows, use PowerShell or CMD rather than the IDE’s built-in terminal):

    1. npm install -g @zed-industries/claude-code-acp

    After installation, restart the IDE so the plugin rescans PATH and the global package directory. If the installation is slow, switch to an internal mirror. If permissions are insufficient, run as administrator or configure the global directory to a user-space location.

    5. Configuring a Custom Agent

    In the top-right menu of the AI panel, select “Add Custom Agent”. The IDE opens a JSON configuration file. Replace its contents with the following structure:

    1. {
    2. "default_mcp_settings": {
    3. "use_idea_mcp": true,
    4. "use_custom_mcp": true
    5. },
    6. "agent_servers": {
    7. "Claude Code Agent": {
    8. "command": "npx",
    9. "args": ["@zed-industries/claude-code-acp"]
    10. }
    11. }
    12. }

    Field descriptions:

    • use_idea_mcp: allows the agent to use tool capabilities exposed by the IDE itself.
    • use_custom_mcp: allows loading custom tool services for easier extension.
    • command and args: specify how the agent process is launched. Here it is started through a package runner to avoid hard-coding absolute paths.

    After saving, reload the window. If the corresponding agent appears in the right panel, the configuration is successful.

    6. Troubleshooting Common Issues

    Symptom Possible cause Solution
    Panel unresponsive Adapter layer process not started Check that the Node runtime and global package can be invoked directly from the command line
    Command not found PATH not refreshed Restart the IDE or operating system, or use an absolute path
    Changes cannot be applied IDE tool permissions not enabled Enable use_idea_mcp and confirm diff preview permissions
    Garbled Chinese text Inconsistent terminal encoding Standardize on UTF-8 and avoid running in legacy terminals

    7. Recommendations for Team Adoption

    • Include the configuration file in a shared team template with unified agent names and tool switches.
    • Pin the adapter layer version in CI or local scripts to avoid inconsistent behavior across members.
    • For changes involving production configurations, follow a “preview the diff first, then apply” workflow.
    • Build observability for the agent call chain using log services and monitoring alerts.

    8. Conclusion

    Integrating external AI coding agents into JetBrains IDEs through ACP is fundamentally about trading a standard protocol for deeper context and more native interaction. Once you master environment preparation, dependency installation, JSON configuration, and troubleshooting, you can achieve a stable and controllable AI-assisted coding experience in complex environments such as Windows. You can also combine this with general cloud capabilities from Baidu AI Cloud, such as container platforms and log services, to roll it out at the team level.