PhpStorm's MCP Server: Giving Your AI Agents Eyes Inside the IDE
PhpStorm 2026.1 ships an expanded MCP server that lets Claude Code, Windsurf, and other agents use PhpStorm's own static analysis tools.
If you have been using Claude Code or another AI coding agent alongside PhpStorm, you have probably noticed a friction point: the agent knows the file system, it can read your PHP, but it has no idea what PhpStorm actually thinks about that code. It cannot see the inspection warnings, it does not know about the framework-aware type inference, and it has no access to the structural search patterns that PhpStorm has built up from understanding your project. You get a capable external agent working alongside a sophisticated IDE, but they are not actually talking to each other.
PhpStorm 2026.1, released in March, addresses this directly through an expanded built-in MCP server. The result is that agents like Claude Code, Windsurf, Codex, and others can now reach into the IDE and use its tools — not just read files, but query PhpStorm’s analysis engine, run inspections, execute IDE actions, and perform structural code searches. It is a meaningful shift in what AI-assisted PHP development actually looks like day to day.
What the MCP Server Exposes
The Model Context Protocol server was first added to PhpStorm in version 2025.2 as an early integration for connecting external agents. In 2026.1, JetBrains substantially expanded the toolset it exposes. The server now gives connected agents access to four main capability categories.
Inspections and quick-fixes. An agent can ask PhpStorm to run its static analysis inspections on a file or a range of code and get back the same results you would see in the IDE’s Problems panel. It can also request the available quick-fixes for a given inspection hit and apply them. This means that when Claude Code is working through a refactor, it can offload the “is this correct PHP?” question to PhpStorm’s analysis engine rather than relying solely on its own training data.
IDE search. Both structural search and semantic search are now available to agents. Structural search lets you define a code pattern — using PhpStorm’s SSR syntax — and find every instance of that pattern across the project. Semantic search understands code meaning rather than just text matching. An agent can use these to find all call sites for a method, locate all usages of a specific annotation, or identify every place a particular pattern is applied, before making changes.
IDE actions. Agents can trigger IDE actions directly, which means they can handle setup and configuration tasks that would otherwise require you to navigate menus manually. This is particularly useful for things like running code formatting, triggering a reindex, or configuring project-level settings.
Laravel Idea integration. If you have the Laravel Idea plugin installed, its MCP server also ships alongside PhpStorm’s built-in MCP server, giving connected agents framework-aware tooling on top of the standard PHP analysis.
Enabling and Configuring the Server
The MCP server ships disabled by default. You turn it on in Settings → Tools → MCP Server. Once enabled, PhpStorm generates the configuration that external agents need to connect. For supported tools — Claude Code, Cursor, VS Code with the appropriate extension, Windsurf, and Codex among them — PhpStorm can auto-configure the connection directly from that same settings menu rather than requiring you to manually edit a config file.
For Claude Code specifically, JetBrains maintains a PhpStorm plugin for Claude Code that provides Claude Code with context and instructions for using the PhpStorm MCP tools correctly. Worth installing alongside the MCP server setup.
Once connected, you can verify the integration is working by asking your agent to describe inspection issues in a known problematic file, or by requesting a structural search for a pattern you know exists in the project.
A Practical Example: Inspection-Aware Refactoring
Here is the kind of workflow this enables. Suppose you are refactoring a service class that has accumulated some issues — deprecated method calls, a few undefined variable inspection hits, and some type mismatch warnings that PHPStan would catch. Normally you would run PHPStan in the terminal, read the output, go back to your agent with that context, and have it make changes. Then you would run PHPStan again to see if the changes introduced new issues.
With the MCP server connected, the loop tightens considerably. You can ask Claude Code to work through the file using PhpStorm’s inspections as its feedback mechanism:
Claude, refactor UserService.php to address all current inspection issues.
Use PhpStorm's inspection tool to identify the problems, fix them,
then verify no new inspections are introduced.
The agent calls the PhpStorm MCP server to get the current inspection results, generates fixes, applies them to the file, and then calls inspections again to confirm the file is clean. The IDE’s analysis is in the loop, not bolted on afterward as a verification step.
This pattern extends naturally to any workflow where you want the agent to work with code quality information, not just code text.
Working With Structural Search
Structural search is one of PhpStorm’s most underused features in general, and the MCP integration makes it even more accessible. You define a search pattern using PhpStorm’s template syntax, and the IDE finds matching code structures regardless of formatting or variable names.
An agent can use this to answer questions like “find every place in the project where we are directly accessing the $request->input() without validation.” You provide the structural pattern, the MCP tool runs the search, and the agent gets back a list of file locations to work through.
// Structural search pattern for direct input access
$request->input('$name$')
// Agent can request this pattern be searched across the project
// via the PhpStorm MCP server and get back all matching locations
Combined with semantic search, which can find usages by understanding the code’s meaning rather than just matching text, agents now have a much more reliable way to find exactly what they need to change before making edits.
The Broader Agent Client Protocol
Beyond the MCP server itself, PhpStorm 2026.1 also supports the Agent Client Protocol for working with multiple AI providers in the IDE’s built-in AI chat. Where previous versions supported Junie and Claude, 2026.1 adds GitHub Copilot, Cursor, and others. This is a separate feature from the MCP server — it is about which agents can work inside the PhpStorm AI chat interface, while the MCP server is about giving external agents (running in your terminal or elsewhere) access to IDE capabilities.
For most day-to-day PHP development, the MCP server integration with an external agent like Claude Code is where the practical value lives. The AI chat in the IDE is useful for quick questions, but the external agent workflow — where the agent can read, write, and interact with your whole project over a longer session — benefits more from the inspection and search tools the MCP server exposes.
Setting Expectations
It is worth being direct about what this is and is not. The MCP integration does not make AI agents infallible PHP developers. They still make mistakes, still generate code that does not quite fit your architecture, and still need review. What it does do is give them access to a better feedback signal — PhpStorm’s analysis engine rather than just their own judgment — and lets them use that signal without requiring you to copy-paste output back and forth.
For PHP developers who are already heavy PhpStorm users and are adopting AI agents into their workflow, this is a straightforward improvement. You are not learning a new tool. You are connecting tools you already have.
Getting Started
To set this up: update PhpStorm to 2026.1 or later, open Settings → Tools → MCP Server, enable the server, and use the auto-configure option for your agent of choice. If you are on Claude Code, install the PhpStorm Claude plugin from the JetBrains marketplace. Run a quick test with an inspection query to confirm the connection is live, and then start working it into your normal refactoring and code review workflow.
The official PhpStorm MCP documentation covers the full configuration options and the current list of exposed tools. As JetBrains continues expanding the toolset in subsequent releases, the range of things an agent can do through this channel will only grow.