2026.09.02 15:20 ~ 16:00 Panda

How I Stole PSI From Android Studio: Letting AI Navigate a Large Codebase

Development with AI English Interpretation available

AI coding agents read your codebase as plain text. Even LSP-backed tools re-index your project from scratch and double your memory footprint. Meanwhile, the IDE you already have open — Android Studio — has a far richer semantic understanding via its Program Structure Interface (PSI): the same engine that powers find-usages, refactoring, and inheritance navigation. What if AI agents could just ask Android Studio directly — "find usages of this method," "show me this function's signature, annotations, and visibility" — and get IDE-grade answers instead of grepping 10,000 files? In this talk, I'll share how I built a JetBrains plugin that exposes PSI as a Model Context Protocol (MCP) server, letting any AI agent borrow Android Studio's brain for codebase navigation. I'll cover: - Why plain-text AI fails on Android codebases: trailing-lambda parameters that are invisible to grep, inheritance hierarchies that require O(n) text search instead of O(1) IDE lookup, name collisions across modules, and Claude's own admission — "in a 1000+ line file with deep nesting, it's easy to lose track of which block is inside which." - Why PSI beats LSP for this: comparison with LSP-based tools like Serena — no re-indexing on every edit, no doubled memory footprint, real-time accuracy because the IDE is already maintaining the tree for you. - Use cases I've explored with PSI MCP: • Auto-generating Visual Regression Tests — drawing accurate UI trees for Compose screens (where trailing-lambda nesting normally trips up AI), then applying a greedy set-cover algorithm to generate minimal test cases with maximum coverage. • Design system color refactoring — using find-usages to safely propagate token changes across the codebase without the silent-failure modes of grep-and-replace. • ViewModel refactoring, AI code review, and stepping into Android framework source code — each leveraging a different slice of PSI. The plugin is publicly available on the JetBrains Marketplace and ships as an npm package. It will be open-sourced under Mercari shortly. I'd love to see what use cases the Android community comes up with that I haven't explored yet. Stop letting your AI guess about your codebase. Come learn how to give it the brain of your IDE. Project links for reviewers: - JetBrains Plugin: https://plugins.jetbrains.com/plugin/28643-psi-mcp-server - npm Package: https://www.npmjs.com/package/jetbrains-psi-mcp-server - Install guide / demo: https://gist.github.com/worker8/5ac7dade4a2c5b5e562576fdec137561

Intended audience

Prerequisite knowledge: - Basic Android development experience - Some familiarity with using AI coding agents (Claude Code, Cursor, GitHub Copilot, etc.) - No prior knowledge of PSI or MCP required — both will be introduced from scratch Who should attend: - Android engineers working in large or legacy codebases where AI agents frequently miss references, hallucinate function locations, or burn through context windows just grepping around. - Developers who have tried Claude Code / Cursor / Copilot on a real production codebase and felt the gap between "demo magic" and "actually useful on my project." - Anyone curious about Model Context Protocol (MCP) and what it looks like to build a custom MCP server that gives AI agents a capability they fundamentally lack. - Engineers interested in IDE plugin development, JetBrains Platform internals, or how Android Studio actually understands your code under the hood. Problems this session aims to resolve: - "Why does my AI agent keep missing usages of this function?" - "Why does it confuse two methods with the same name in different modules?" - "Why does it fail to find parameters passed as trailing lambdas?" - "Why does it read 25 files into context just to understand one screen?" - "Is there a way to give AI the same code intelligence my IDE already has?"

Sessions in the same time slot

View all sessions