Loading...
Loading...
IntelliJ-IDEA MCP provides powerful IDE features including running tests, code analysis, refactoring, search, and project navigation. Use this when you need accurate Java code analysis (avoiding LSP false positives), running tests via IDEA configurations, refactoring symbols, or exploring codebase structure. Key commands: execute_run_configuration (run tests), get_file_problems (accurate errors/warnings), search_in_files_by_text (search code), list_directory_tree (view structure), get_file_text_by_path (read files), rename_refactoring (safe refactoring), execute_terminal_command (run shell commands).
npx skill4agent add dtprj/dongting idea-mcpprojectPath/Users/name/projectproject/Users/name/projectfilePathpathInProjectdirectoryPathsearch_in_files_by_textsearch_in_files_by_regexmaxUsageCountmaxUsageCount: 10find_files_by_name_keywordfind_files_by_globfileCountLimitfileCountLimit > actual matching filesprobablyHasMoreMatchingFilesfileCountLimit: 12fileCountLimitsearch_in_files_by_textget_file_problemsexecute_terminal_commandrename_refactoringreplace_text_in_filecreate_new_filereformat_fileprojectPathmaxUsageCountfileCountLimitfileCountLimit: 1-2get_file_problemsget_file_problemsget_file_text_by_pathexecute_run_configuration/Users/huangli/dt/dongtingprojectPathKvImpl.javaTool: IntelliJ-IDEA_find_files_by_name_keyword
Parameters:
projectPath: "/Users/huangli/dt/dongting" # Absolute path
nameKeyword: "KvImpl"
fileCountLimit: 2 # Start small; bug: limit > matches causes schema errorfind_files_by_globTool: IntelliJ-IDEA_find_files_by_glob
Parameters:
projectPath: "/Users/huangli/dt/dongting"
globPattern: "**/*KvImpl*.java"
fileCountLimit: 5Tool: IntelliJ-IDEA_search_in_files_by_text
Parameters:
projectPath: "/Users/huangli/dt/dongting"
searchText: "DtLog.getLogger"
maxUsageCount: 20 # REQUIRED parameter
caseSensitive: trueTool: IntelliJ-IDEA_search_in_files_by_regex
Parameters:
projectPath: "/Users/huangli/dt/dongting"
regexPattern: "private static final DtLog log = DtLogs\\.getLogger\\(.*\\)"
maxUsageCount: 10Tool: IntelliJ-IDEA_execute_run_configuration
Parameters:
projectPath: "/Users/huangli/dt/dongting"
configurationName: "client:test"
timeout: 120000 # 2 minutes for testsTool: IntelliJ-IDEA_get_run_configurations
Parameters:
projectPath: "/Users/huangli/dt/dongting"server/src/main/java/com/github/dtprj/dongting/raft/server/RaftNode.javaTool: IntelliJ-IDEA_get_file_problems
Parameters:
projectPath: "/Users/huangli/dt/dongting"
filePath: "server/src/main/java/com/github/dtprj/dongting/raft/server/RaftNode.java"
errorsOnly: trueTool: IntelliJ-IDEA_search_in_files_by_text
Parameters:
projectPath: "/Users/huangli/dt/dongting"
searchText: "currentTerm"
maxUsageCount: 50Tool: IntelliJ-IDEA_rename_refactoring
Parameters:
projectPath: "/Users/huangli/dt/dongting"
pathInProject: "server/src/main/java/com/github/dtprj/dongting/raft/server/RaftNode.java"
symbolName: "currentTerm"
newName: "currentElectionTerm"Tool: IntelliJ-IDEA_get_file_problems
Parameters:
projectPath: "/Users/huangli/dt/dongting"
filePath: "server/src/main/java/com/github/dtprj/dongting/raft/server/RaftNode.java"Tool: IntelliJ-IDEA_list_directory_tree
Parameters:
projectPath: "/Users/huangli/dt/dongting"
directoryPath: "." # Project root
maxDepth: 3Tool: IntelliJ-IDEA_get_all_open_file_paths
Parameters:
projectPath: "/Users/huangli/dt/dongting"| Task | Recommended Tool | Why |
|---|---|---|
| Java code analysis (errors, warnings) | IDEA MCP ( | More accurate for multi-module Maven projects; avoids LSP false positives |
| Running tests | IDEA MCP ( | Proper test environment, TeamCity-formatted output, dependency resolution |
| Refactoring (rename, move) | IDEA MCP ( | Semantic understanding, cross-file updates, safer than manual edits |
| Search code (text, regex) | IDEA MCP ( | Fast, indexes entire project; better than |
| Find files (by name, glob) | IDEA MCP ( | Fast indexed search; use workarounds for schema bugs |
| Read file content | LSP ( | LSP for quick reads; IDEA for large files or binary detection |
| Build/compile | Bash ( | Full control, reproducible; IDEA build may have caching issues |
| Git operations | Bash ( | Standard, predictable; IDEA MCP lacks git tools |
| Project exploration | IDEA MCP ( | Visual tree structure; better than |
| Terminal commands | IDEA MCP ( | IDEA for integrated terminal; Bash for complex pipelines |
| Operation | Recommended Timeout | Notes |
|---|---|---|
File search ( | 30000 (30s) | Usually fast; start with |
Text search ( | 60000 (60s) | Can be slower for large codebases; use |
Read file ( | 10000 (10s) | Fast for text files; binary files may fail |
Get file problems ( | 15000 (15s) | Quick analysis |
Run configuration ( | 300000 (5min) | Tests/builds can take minutes; adjust based on test size |
Build project ( | 300000 (5min) | Full rebuild may be slow |
Refactoring ( | 60000 (60s) | Usually fast for single symbols |
Directory listing ( | 20000 (20s) | Depends on project size |
maxUsageCountfileCountLimitget_all_open_file_pathsmvnread| Error Message | Likely Cause | Solution |
|---|---|---|
| Missing | Add required parameter: |
| | Reduce |
| IDEA not running or MCP server not connected | Verify IDEA is running with MCP plugin active; wait for connection |
| Operation taking longer than default timeout | Increase |
| Incorrect path (absolute vs relative confusion) | Use absolute path for |
| Search text not found or path incorrect | Verify search text exists; check |
| Trying to read binary/ non-text file | Use |
| | Verify project is fully loaded in IDEA; use absolute path |
maxUsageCountfileCountLimitfind_files_by_name_keywordfileCountLimitprojectPathlist_directory_treecreate_new_fileoverwrite: truereplace_text_in_fileget_file_text_by_path