Bring Android Studio's powerful semantic code analysis to AI assistants via the Model Context Protocol (MCP).
Get precise, context-aware code understanding that goes far beyond text-based searching - find usages, navigate to definitions, explore inheritance hierarchies, and more.
While the underlying approach applies to any JetBrains IDE in principle, this plugin requires an IDE that bundles the Kotlin, Java, and Gradle plugins — it declares a hard dependency on each (see plugin.xml) and is built around Kotlin's K2 semantic analysis, with partial Java support. In practice that means IntelliJ IDEA and Android Studio, which are the only IDEs it is actively developed and tested against.
-
Install the Android Studio plugin:
- Download
jetbrain-psi-plugin-x.y.z.zipfrom releases - Install in Android Studio:
Settings > Plugins > Install Plugin from Disk - Restart IDE
- (optional) In
Settings > Tools > PSI MCP Server, choose which open project the server serves (the HTTP port is fixed at51234)
- Download
-
Point your AI assistant at the plugin's HTTP MCP endpoint. For Claude Code, in your claude config file:
"mcpServers": { "jetbrain-psi-mcp-server": { "type": "http", "url": "http://localhost:51234/mcp" } }
The plugin speaks MCP directly over HTTP at
/mcp. -
Now launch
$ claudeand make sure you leave your Android Studio opened and make sure that it's done indexing (important!). -
Try to search for something, e.g.
> find usages of ClickableRowIf your model doesn't automatically invoke PSI MCP, you can be explicit:
> find usages of ClickableRow (using PSI MCP)- Make sure MCP server is working, run this:
For Claude:
claude mcp list | grep jetbrain-psi-mcp-serverYou should see the server listed and ✓ Connected.
- Make sure the Android Studio Plugin is working, curl the health endpoint, you should see "OK" reply:
$ curl http://localhost:51234/health
OK%- Verify MCP transport directly:
$ curl -s -X POST http://localhost:51234/mcp \
-H 'Content-Type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}' | head -c 200Navigation & analysis:
find-declaration- Go to the declaration of the symbol at a locationfind-usages- Semantic references to the symbol at a locationfind-implementations- Implementations/overrides of an interface or abstract memberfind-symbols- Fuzzy (camel-hump) symbol search by name across the codebaseget-containing-context- The class/method enclosing a locationget-call-hierarchy- Incoming/outgoing call hierarchy of a functionget-type-info- Resolved type at a position (K2 Analysis API)get-kdoc- KDoc/JavaDoc of the declaration at a positionget-diagnostics- Inspection/compiler warnings and errors for file(s)
Project structure:
module-search- Find modules by fuzzy/partial name with their dependencies, dependents, and content roots (relevance-ranked, paginated)check-sync-status- Verify the served project matches and has finished indexinggradle-sync- Trigger a Gradle sync
Refactoring & edits:
rename- Rename a symbol across the projectsafe-delete- Delete a symbol if it is unused (reports blockers)move-file- Move a file, updating references and packageextract-interface- Extract an interface from a classadd-import- Add an importadd-parameter- Add a parameter to a functionfind-import-suggestions- Suggest imports for an unresolved referenceorganize-imports- Remove unused imports and sort themformat-code- Reformat a file or line rangeapply-quick-fix- List or apply IDE quick-fixes
All tools use IntelliJ's semantic analysis for precise, context-aware results that understand language syntax, scoping, and inheritance. module-search is query-scoped and paginated so it stays usable on large projects (2000+ modules) without blowing the response-size budget.
Symbol Analysis:
"Find all usages of the calculateTotal function"
"What class contains the code at line 50 of MainActivity.kt?"
"Find all subclasses of BaseActivity"
"Navigate to the definition of the onClick variable"
Module Analysis:
"Find all authentication-related modules"
"Search for modules containing 'payment' and show their dependencies"
"Find modules using fuzzy search: 'cart', 'auth', 'ds4'"
"Which modules does the ':feature:checkout' module depend on?"
If your MCP server fails to connect:
- Verify the plugin is running -
curl http://localhost:51234/healthshould returnOK - Verify the endpoint - your MCP config URL must be
http://localhost:51234/mcp(the plugin's port is fixed at51234) - Restart Android Studio - Required after installing or upgrading the plugin
- Check indexing - The plugin needs the project to be done indexing before PSI tools work reliably
- DEVELOPMENT.md - Building, testing, and contributing
- ARCHITECTURE.md - Technical details and design decisions
This is an independent open-source project published by Mercari, Inc. It is not
affiliated with, endorsed by, or sponsored by JetBrains s.r.o. or Google LLC.
"IntelliJ", "IntelliJ IDEA", "JetBrains", and "Android Studio" are trademarks of
their respective owners and are used here only to describe compatibility.