mcpField
I
idea-mcp

idea-mcp

github.com/dtprjDevelopment20836 installsUpdated 4d ago
Repository

About idea-mcp

A practical skill for using IntelliJ IDEA MCP tools on code projects. It explains path conventions, search options, refactoring risks, and troubleshooting so developers can choose operations and verify results.

Key features

  1. 01Absolute and relative path guidance
  2. 02Search tool selection and result formats
  3. 03Refactoring and file-editing cautions
  4. 04Project build and error-checking tips
  5. 05Connection and timeout troubleshooting

Use cases

  1. 01Finding symbols and usages in a project
  2. 02Checking Java errors in multi-module Maven projects
  3. 03Compiling selected files after edits

MCP support

This skill documents operation details and pitfalls for IntelliJ IDEA MCP tools, helping clients use them accurately.

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/dtprj/dongting --skill idea-mcp

After installing, type/idea-mcpin Claude Code to confirm it loaded.

Details

From the project README

IntelliJ IDEA MCP Skill

Path Rules (Most Common Error Source)

ParameterPath TypeExample
projectPathABSOLUTE/Users/huangli/dt/dongting
filePath, pathInProject, directoryPath, contextPathRELATIVEserver/src/main/java/...

Getting this wrong is the #1 cause of "file not found" errors.

Gotchas and Tips

Two Search API Families

IDEA MCP has two sets of search tools that return different formats. Pick the right one:

  • search_in_files_by_text / search_in_files_by_regex — Returns matched lines with ||highlight|| markers. Good for quick "where is this string used" lookups. Supports fileMask filter.
  • search_text / search_regex / search_file / search_symbol — Returns structured results with exact coordinates (line, column, byte offsets). Supports paths glob filters and ! excludes. Use this when you need precise locations for further operations.
    • search_symbol is especially powerful — semantic symbol lookup (classes, methods, fields) returning full code snippets.
execute_terminal_command Does Not Use Shell by Default

Without executeInShell: true, shell features like $() expansion, pipes, and wildcards won't work. For most shell commands, prefer the Bash tool directly.

rename_refactoring Takes Symbol Name, Not Position

Parameters are symbolName (the exact identifier string) and newName, not file path + line/column. This is different from LSP-based rename.

build_project for Single-File Compilation

build_project with filesToRebuild parameter compiles specific files much faster than running mvn compile. Useful for quick verification after edits.

get_file_problems vs LSP Diagnostics

For multi-module Maven projects, get_file_problems is significantly more accurate than LSP lsp_diagnostics. Prefer it for Java error checking.

High-Risk Operations

  • rename_refactoring & replace_text_in_file — Modify code globally, verify with get_file_problems after use
  • reformat_file — Modifies formatting without confirmation

Troubleshooting

IssueSolution
Connection refusedVerify IDEA running with MCP plugin
Request timed outAccept permission dialog in IDEA
File not foundCheck absolute vs relative path (see Path Rules above)

Comments

Markdown supported