$npx -y skills add jonnyzzz/mcp-steroid --skill promptIntelliJ API Power User Guide
| 1 | IntelliJ API Power User Guide |
| 2 | |
| 3 | RECOMMENDED: Execute Kotlin code directly in IntelliJ IDEA's runtime with full access to IntelliJ Platform APIs. |
| 4 | |
| 5 | |
| 6 | # MCP Steroid - IDE API Access for AI Agents |
| 7 | |
| 8 | Execute Kotlin code directly in IntelliJ IDEA's runtime with full access to the IntelliJ Platform API. |
| 9 | |
| 10 | ## Important Notes for AI Agents |
| 11 | |
| 12 | **Learning Curve**: Writing working code for IntelliJ APIs may require several attempts. This is normal! The API is vast and powerful. Keep trying - each attempt teaches you more about the available APIs. Use `printException()` to see stack traces when errors occur. |
| 13 | |
| 14 | **Drop-in replacement for LSP**: This MCP server replaces LSP (Language Server Protocol) tools with IntelliJ's native APIs — same operations, deeper understanding: |
| 15 | - PSI (Program Structure Interface) instead of LSP document symbols — full semantic analysis |
| 16 | - IntelliJ inspections, refactorings, intentions instead of LSP code actions |
| 17 | - Full project model with module dependencies instead of workspace folders |
| 18 | - Platform-specific indices for O(1) code search instead of filesystem scans |
| 19 | |
| 20 | ## Common task → resource cheat sheet |
| 21 | |
| 22 | Before reading further, if your task matches one of these, skip straight to the linked recipe: |
| 23 | |
| 24 | | Task | Fetch this | |
| 25 | |---|---| |
| 26 | | Find duplicate / cloned / DRY-violation / copy-paste code | `mcp-steroid://ide/find-duplicates` | |
| 27 | | Run a single named inspection + apply quick-fix | `mcp-steroid://ide/inspect-and-fix` | |
| 28 | | List enabled inspections in the project | `mcp-steroid://ide/inspection-summary` | |
| 29 | | Multi-file literal-text edit | one `steroid_execute_code` script: read + replace + save all files in a single `writeAction { }` | |
| 30 | | Find usages of a symbol | `mcp-steroid://lsp/find-references` | |
| 31 | | Run / debug a test | `mcp-steroid://ide/demo-debug-test` | |
| 32 | | Run Maven / Gradle tests | `mcp-steroid://skill/execute-code-maven`, `mcp-steroid://skill/execute-code-gradle` | |
| 33 | | API discovery / exploration | continue reading this guide | |
| 34 | |
| 35 | The full index is in the "MCP Resources (Use Them)" section below. |
| 36 | |
| 37 | ## Quickstart Flow |
| 38 | |
| 39 | ``` |
| 40 | 1. steroid_list_projects → get list of open projects |
| 41 | 2. Pick the `project_name` of the one you want (the unique routing key — NOT the human-readable `name`) |
| 42 | 3. steroid_execute_code → run Kotlin code with that project_name |
| 43 | 4. steroid_execute_feedback → report success/failure for tracking |
| 44 | ``` |
| 45 | |
| 46 | Each `steroid_list_projects` entry has TWO name fields: `project_name` (the within-IDE-unique, |
| 47 | opaque routing KEY you pass back to every project-scoped tool) and `name` (the human-readable |
| 48 | folder name, informational/display only). Always route by `project_name`. To find the right |
| 49 | project for a file or directory path, pick the project whose `path` is the longest prefix of your |
| 50 | target path (this disambiguates nested checkouts and git worktrees). |
| 51 | |
| 52 | **Example session:** |
| 53 | ``` |
| 54 | → steroid_list_projects |
| 55 | ← {"projects":[{"project_name":"my-app-9fk2a0xq","name":"my-app","path":"/path/to/my-app","backend_name":"iu-9fk2a0xq"}]} |
| 56 | |
| 57 | → steroid_execute_code(project_name="my-app-9fk2a0xq", code="println(project.name)", ...) |
| 58 | ← "my-app" |
| 59 | |
| 60 | → steroid_execute_feedback(project_name="my-app-9fk2a0xq", task_id="...", execution_id="...", success_rating=1.0, explanation="Got project name") |
| 61 | ``` |
| 62 | |
| 63 | ## When to Use This Skill |
| 64 | |
| 65 | **ALWAYS prefer IntelliJ APIs over file-based operations:** |
| 66 | |
| 67 | | Instead of... | Use IntelliJ API | |
| 68 | |---------------------------------|--------------------------------| |
| 69 | | Reading files with `cat`/`read` | VFS and PSI APIs | |
| 70 | | Searching with `grep`/`find` | Find Usages, Structural Search | |
| 71 | | Manual text replacement | Automated refactorings | |
| 72 | | Guessing code structure | Query project model directly | |
| 73 | |
| 74 | The IDE has indexed everything. It knows the code better than any file search. |
| 75 | |
| 76 | ## Available Tools |
| 77 | |
| 78 | ### `steroid_list_projects` |
| 79 | List all open projects. Each entry has `project_name` (the unique routing key to pass to |
| 80 | `steroid_execute_code` and the other project-scoped tools), `name` (the human-readable folder |
| 81 | name, informational only), and `path`. To map a file/dir path to a project, pick the project whose |
| 82 | `path` is the longest prefix of your target path. |
| 83 | |
| 84 | ### `steroid_list_windows` |
| 85 | List open IDE windows (and background tasks) and their associated projects. Some windows may not be tied to a project and a project can have multiple windows. |
| 86 | Use this in multi-window setups to pick the correct `window_id` for screenshot/input tools. Each |
| 87 | window and task entry references its project by `project_name` — the single routing key. Look up that |
| 88 | project's human-readable `name` and `path` via `steroid_list_projects` by that key (they are not |
| 89 | duplicated on window/task entries). |
| 90 | |
| 91 | ### `steroid_take_screenshot` |
| 92 | Capture a screenshot of the IDE frame and return image content. |
| 93 | |
| 94 | **HEAVY ENDPOINT**: Use only for debugging and tricky configuration. Prefer `steroid_execute_code` for regular automation. |
| 95 | |
| 96 | **Parameters:** |
| 97 | - `project_name` (required): the `project_name` from `stero |