Model Context Protocol (MCP)
AI Assistant can interact with external tools and data sources through the Model Context Protocol (MCP). By connecting to MCP servers, AI Assistant gains access to a range of tools that significantly extend its capabilities.
- Supported transport mechanisms
AI Assistant supports the following transport mechanisms for connecting to MCP servers:
Standard input/output (STDIO) – AI Assistant launches the MCP server as a subprocess and exchanges data through standard input and output. This transport is typically used for local MCP servers.
Streamable HTTP – AI Assistant connects to an MCP server over HTTP using the Streamable HTTP transport defined in the Model Context Protocol specification. This transport allows communication with local or remote MCP servers through a single HTTP endpoint and supports both request/response and streaming interactions.
- Where to get an MCP server
There are many MCP-compatible servers available, depending on your use case and setup. As a starting point, you can explore the reference servers provided in the official MCP repository, which includes examples, usage instructions, and configuration details.
- What is needed to connect to an MCP server
To connect AI Assistant to an MCP server, you need a JSON configuration that defines the command and arguments for starting the server. The exact configuration depends on the specific MCP server. In most cases, the server's developers will provide a recommended configuration you can get and use.
Connect to an MCP server
To connect to an MCP server:
Go to .
Alternatively, you can open the screen with the MCP settings by typing
/in the chat and selecting the Add Command option.
On the Model Context Protocol (MCP) settings page, click
Add to add a new MCP server configuration.
In the New MCP Server dialog, select how you want to connect to the MCP server and provide a JSON configuration:

JSON configuration – provide a JSON snippet with the parameters required to start the MCP server. The configuration needs to follow this format:
{ "mcpServers": { "yourServerName": { "command": "path-or-command-to-start-server", "args": [ "optional-arguments-passed-to-server" ] } } }Working directory – specify the path to the folder from which the server is launched. This allows you to use relative paths in arguments instead of absolute paths.
Server level – specify whether the configured server should be available globally or only in the current project.

JSON configuration – provide a JSON snippet with the parameters required to start the MCP server. The configuration needs to follow this format:
{ "mcpServers": { "yourServerName": { "url": "https://example.com/mcp" } } }Server level – specify whether the configured server should be available globally or only in the current project.
Click OK. The MCP server will appear in the list.
Click Apply. This will start the configured server and establish a connection to it. You can monitor the status of your connection in the Status column.
As a result, the tools provided by the MCP server become available to AI Assistant. It can trigger them automatically when processing your request, or you can invoke them manually by typing the appropriate / command in the chat:

Review available tools
Once the connection to the MCP server is successfully established, you can review the list of available tools by clicking the icon in the Status column.

Change the server level
If you want to change the level at which the MCP server is available, click the buton in the Level column, and select whether the setup should be available globally or only in the current project.

Stop the MCP server
To stop the MCP server:
Deselect the checkbox for the MCP server you want to stop.

Click Apply.
Reconnect to the MCP server
To reconnect to the MCP server:
Select the server you want to reconnect to.
Click the
Reconnect button.
Get MCP server logs
For debugging purposes, you might want to review the logs of the spawned MCP server. To do this:
In the main menu, go to and select Show Log in Explorer on Windows or Show Log in Finder on macOS. This opens the logs directory.
Locate the mcp folder and open it. This folder contains the logs for each configured MCP server.
JSON configuration examples
This section provides example configurations for connecting AI Assistant to an MCP server, depending on how the server is hosted. It covers locally installed servers, NPX-based setups, Docker-based environments, and remote servers.
- Local installation
If the MCP server is installed on your machine, you can connect to it by running the server executable along with any required arguments. A template for such a configuration would look like this:
{ "mcpServers": { "yourServerName": { "command": "command-to-run-server", "args": [ "path-to-server-executable-or-script", "optional-arguments-for-server" ] } } }The
commandis the executable or script that launches the MCP server. This could benode, a direct path to an executable file, or another command appropriate for launching the server.The
argslist contains arguments passed to the server on startup, such as the path to the server script or configuration options.
For example, if you use the Filesystem MCP server, your configuration may look like this:
{ "mcpServers": { "filesystem": { "command": "node", "args": [ "/Users/JohnDoe/IdeaProjects/servers/src/filesystem/dist/index.js", "/Users/JohnDoe/Desktop" ] } } }Here, the
nodecommand runs the server script. The first argument specifies the path to the server script, and the second argument tells the server which directory it is allowed to operate in.- Using NPX
If the MCP server is not installed locally, you can use
npxto download and run it on demand. A template for such a configuration would look like this:{ "mcpServers": { "yourServerName": { "command": "npx", "args": [ "-y", "npm-package-name", "optional-arguments-for-server" ] } } }The
commandis set tonpx, which runs a package from the npm registry without installing it globally.The
argslist includes:-y– to automatically confirm prompts that may appear when running the package for the first time,the name of the npm package that provides the MCP server,
any additional arguments passed to the server, such as file paths or configuration options.
For example, if you use the Filesystem MCP server, your configuration may look like this:
{ "mcpServers": { "filesystem": { "command": "npx", "args": [ "-y", "@modelcontextprotocol/server-filesystem", "/Users/JohnDoe/Desktop" ] } } }Here, the
npxcommand runs the@modelcontextprotocol/server-filesystempackage. The path provided in the arguments tells the server which directory it is allowed to operate in.- Using Docker
You can run the MCP server in an isolated environment using Docker. This starts the server inside a container and mounts local folders into it so the server can access them. A template for such a configuration would look like this:
{ "mcpServers": { "yourServerName": { "command": "docker", "args": [ "run", "-i", "--rm", "--mount", "type=bind,src=/local/path,dst=/container/path", "docker-image-name", "/container/path" ] } } }The
commandis set todocker, which starts the MCP server inside a container based on the specified Docker image.The
argslist includes:run– to start a new container,-i– to keep the container interactive so the IDE can communicate with it,--rm– to automatically remove the container after use,one or more
--mountoptions – to bind local folders (src) to container paths (dst),the Docker image name that provides the MCP server,
the final argument that tells the server the directory where it is allowed to operate inside the container.
For example, if you use the Filesystem MCP server, your configuration may look like this:
{ "mcpServers": { "filesystem": { "command": "docker", "args": [ "run", "-i", "--rm", "--mount", "type=bind,src=/Users/JohnDoe/Desktop,dst=/projects/Desktop", "--mount", "type=bind,src=/Users/JohnDoe/Documents,dst=/projects/Documents,ro", "mcp/filesystem", "/projects" ] } } }Here, the
dockercommand runs themcp/filesystemimage. The local folders /Users/JohnDoe/Desktop and /Users/JohnDoe/Documents are mounted into the container, and the /projects argument tells the server where to operate inside the container.- Remote servers
If the MCP server is hosted remotely and accessible over HTTP, you can connect to it by specifying its URL in the configuration. A template for such a configuration would look like this:
{ "mcpServers": { "yourServerName": { "url": "http://remote-server-address/mcp" } } }The
urlparameter represents the HTTP endpoint of the MCP server. This should point to the base URL that implements the Streamable HTTP transport for the server.
For example, to connect to a remote MCP server, your configuration may look like this:
{ "mcpServers": { "microsoftdocs": { "url": "https://learn.microsoft.com/api/mcp" } } }Here, AI Assistant connects to the MCP server over HTTP using the Streamable HTTP transport. The server is managed remotely, and AI Assistant communicates directly with it through the specified URL.
Use your IDE as an MCP server
Starting with version 2025.2, JetBrains IDEs come with an integrated MCP Server, allowing external clients such as Claude Code, Codex, VS Code, and others to access tools provided by the IDE. This gives users the ability to control and interact with JetBrains IDEs without leaving their application of choice.
Enable the MCP Server plugin
This functionality relies on the MCP Server plugin, which is bundled and enabled in JetBrains IDEs by default. If the relevant features are not available, make sure that you did not disable the plugin.
Press Ctrl+Alt+S to open settings and then select .
Open the Installed tab, find the MCP Server plugin, and select the checkbox next to the plugin name.
Enable MCP Server
To enable the MCP server, do the following:
Go to .
Select the Enable MCP Server checkbox.

In the Enable MCP Server? dialog, review what access third-party applications will get to the projects opened in the IDE, and click Enable to continue.
Click Apply.
Once the MCP server is enabled, you can proceed to configure external clients.
External client setup
For detected external clients like Junie, VS Code, Claude Code, Codex, Air, and GitHub Copilot CLI, configuration can be performed automatically. Setting up a client means adding the address of the IDE MCP server to that client's configuration file.
To do this:
Go to .
In the Clients Auto-Configuration section, click Auto-Configure for each client you want to set up for use with the MCP server. This updates the client's configuration file automatically. The set of configured transports depends on the client.

To configure a specific transport yourself, click
next to Auto-Configure and select the required option from the list.

Restart your client for the configuration to take effect.
Project-level client setup
Some clients also read a configuration file from the project's working directory. For these clients, the IDE can write the connection settings directly to the configuration file in the currently opened project, so the MCP server is available only while you work on that project.
Use this option if you work with several projects and do not want the MCP server registered for every client session.
Go to .
In the Project Clients Auto-Configuration section, click Auto-Configure for each client you want to set up. This updates the client's project-level configuration file automatically.

If you want to configure a specific transport mechanism, click
next to Auto-Configure and select the required option from the list.
Restart your client for the configuration to take effect.
Manual client setup
If the client you want to connect is not on the list, configure it manually.
In the Manual Client Configuration section, click either Copy SSE Config, Copy Stdio Config, or Copy HTTP Stream Config depending on the connection type.

Paste the copied configuration into your client's settings or configuration file.
Restart your client for the configuration to take effect.
Execute actions without confirmation
The MCP server allows connected external clients to execute terminal commands or run configurations in the IDE without prompting for user confirmation each time.
To enable this mode:
Go to .
In the Command execution section, enable the Run shell commands or run configurations without confirmation (brave mode) setting.
Click Apply.
Show setup suggestions in terminal sessions
When Codex or Claude starts in a terminal session without a matching MCP server setup, the IDE can show a banner that suggests configuring the connection.

To control this behavior:
Go to .
In the Terminal Sessions section, select or clear the Show setup suggestions for Codex and Claude terminal sessions checkbox.
Click Apply.
Supported tools
The MCP Server exposes a set of tools that allow external clients to interact with your IDE and project – for example, to analyze code, modify files, run configurations, or execute terminal commands.
You can view and manage the full list of available tools in . For each tool, select or clear the Enabled checkbox to control whether the tool is exposed to external clients.

You can also select the Router-only checkbox for a tool. Router-only tools are hidden from the direct MCP tool list and remain available only through the dedicated router tool. This keeps unnecessary tool descriptions out of the tool list and saves context. Use the Enable router-only mode for setting to specify when router-only mode applies, for example, for All agents, or ACP agents only.
Below you can find the list of tools provided by the MCP server.
Analysis tools
- analyze_calls
Builds the IDE Call Hierarchy tree for a method, function, constructor, or supported type target. Use it to see who calls a symbol (
INCOMING_CALLS) or what the symbol calls (OUTGOING_CALLS).Prefer this tool over usage search, text search, or regex search when evaluating dependencies by actual calls. It uses IDE call hierarchy data, so it provides more precise call relationships with less noise and fewer follow-up calls than primitive searches.
Pass
symbolFqnas a fully qualified name, for examplecom.example.Service.run. If the name is ambiguous, the tool returns exact signatures; pass one of them back assymbolFqn. If you only know a short name or fragment, usesearch_symbolfirst to find the target.The result is an expandable text tree. Each node includes
filePathandtreePath;filePathis project-relative when possible. PasstreePathback to render the subtree. UsechildOffsetto continue after a truncated … and n more line.depth,maxChildren, andmaxNodesbound the rendered tree. Symbols can come from project sources, source jars, or decompiled binary jar dependencies when the IDE can resolve them.Parameters:
symbolFqn(required): Plain fully qualified symbol name, or an exact signature returned by an ambiguity error or copied from a rendered child node. If you only know a short name or fragment, usesearch_symbolfirst and pass the best fully qualified callable name here. Examples:com.example.Service.run,com.example.Service.run(String), ororg.assertj.core.api.Assertions.assertThat(String). Do not pass a file path, line, column, or a separate target signature.analysisKind(required): Call analysis direction. UseINCOMING_CALLSto show callers ofsymbolFqn, orOUTGOING_CALLSto show symbols called fromsymbolFqn.depth: Maximum number of call levels to render below the requested subtree root. Defaults to 5. Use 0 to render only the subtree root.maxChildren: Maximum number of direct children rendered for each node. Defaults to 50.maxNodes: Maximum total number of rendered call nodes. Defaults to 1000.treePath: Optional path to a subtree root, copied exactly from a previousanalyze_callsresult. Null or omitted means the root path[]. Each component is an exact signature, not a display name.childOffset: Offset for paging direct children of the node addressed bytreePath. Defaults to 0.timeout: Timeout in milliseconds.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- build_project
Triggers building of the project or specified files, waits for completion, and returns build errors. Use this tool to build the project or compile files and get detailed information about compilation errors and warnings.
You have to use this tool after performing edits to validate if the edits are valid.
Parameters:
rebuild: Whether to perform a full rebuild of the project. Defaults to false. Effective only whenfilesToRebuildis not specified.filesToRebuild: If specified, only compile files with the specified paths. Paths are relative to the project root.timeout: Timeout in milliseconds.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- get_file_problems
Analyzes the specified file for errors and warnings using IntelliJ inspections. Use this tool to identify coding issues, syntax errors, and other problems in a specific file.
Returns a list of problems, including severity, description, and location information.
Parameters:
filePath: Path relative to the project root.errorsOnly: Whether to include only errors or both errors and warnings.timeout: Timeout in milliseconds.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- get_project_dependencies
Returns a list of all dependencies defined in the project. Provides structured information about library names.
Parameters:
projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- get_project_modules
Returns a list of all modules in the project with their types. Provides structured information about each module, including its name and type.
Parameters:
projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- lint_files
Analyzes the specified files for errors and warnings using IntelliJ inspections. Use this tool to lint several files after editing them. Returns per-file problems with severity, description, and location information.
Batch responses may include file entries with
timedOut: trueand emptyproblemswhen individual files exceed the available budget. File entries with anotAnalyzedReasonindicate files that could not be analyzed, for example files outside project content roots, excluded files, or unsupported file types. A top-levelmore: truemeans the batch is incomplete.Parameters:
files(required): List of project-relative files to analyze. Duplicate paths are ignored after normalization.min_severity: Minimum severity to include:warningorerror. Defaults towarning.timeout: Timeout in milliseconds.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Code Insight tools
- get_symbol_info
Retrieves information about the symbol at the specified position in the specified file. Provides the same information as IntelliJ IDEA's Quick Documentation feature. The information may include the symbol's name, signature, type, documentation, and other details, depending on the programming language.
If the position references a symbol, the tool will return a code snippet with the symbol's declaration, if available. Use this tool to understand a symbol's declaration, semantics, and location.
Parameters:
filePath: Path relative to the project root.line: 1-based line number.column: 1-based column number.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Database-specific tools
Available in: DataGrip and IDEs with Database Tools and SQL plugin
To guarantee strictly read-only access for an AI agent, use a database user with properly restricted (read-only) privileges and configure the data source to use that user.
- cancel_sql_query
Cancel a running query using its unique ID.
Parameters:
sessionId: Query session ID.
- create_database_connection
Creates a new database connection (data source) by name, DBMS (
dbms), JDBC URL (url), and a flag to check the connection (needToCheckDs). All parameters are required. Returns connection diagnostic information.Parameters:
name(required): Unique name of the database connection.dbms: Name of the database management system (DBMS).url: Fully formed JDBC URL of the database connection, for examplejdbc:postgresql://<host>:<port>/<database>.needToCheckDs: Whether to test the connection right after the data source is created or edited. Set tofalsewhen configuring multiple connections in a batch — the per-connection probe is expensive, andtest_database_connectioncan be called explicitly for the connections that matter.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- edit_database_connection
Edits an existing database connection (data source) identified by
connectionId. Updates the connection's DBMS driver and JDBC URL; the connectionnameis preserved. Returns connection diagnostic information.Parameters:
connectionId: Unique connection ID.dbms: Name of the database management system (DBMS).url: Fully formed JDBC URL of the database connection, for examplejdbc:postgresql://<host>:<port>/<database>.needToCheckDs: Whether to test the connection right after the data source is created or edited. Set tofalsewhen configuring multiple connections in a batch — the per-connection probe is expensive, andtest_database_connectioncan be called explicitly for the connections that matter.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- execute_sql_query
Execute a SQL query against the given database connection.
The tool reports execution status: success or error. For errors, it also provides an error description.
If the query returns data, it is appended to the tool response in CSV format.
Parameters:
connectionId: Unique connection ID.queryText: SQL query to be executed.
- fetch_query_result
Fetches rows from an already executed query by its ID, starting at the given row offset. Returns the same shape as
execute_sql_query: theresultSetIdand the rendered result in CSV format.Use this tool to paginate over a
resultSetIdpreviously returned byexecute_sql_queryorpreview_table_data.Parameters:
resultSetId(required): The opaque result-set ID returned by a previousexecute_sql_queryorpreview_table_datacall.offset(required): Row offset to start fetching from. Defaults to 0.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- get_database_object_description
Retrieves the structure of a database object (columns, types, keys, indexes) within a particular schema as a hierarchical text representation.
In case of ambiguity returns definitions of all applicable objects.
Parameters:
connectionId: Unique connection ID.databaseName: Name of the database the schema belongs to. Can be empty if the DBMS has no databases but only schemas.schemaName: Name of the schema.kind: Set this parameter to a particular object kind code to list only objects of that kind. Set it to null to retrieve all objects in the schema.objectName: Object name of the specified kind (e.g., table or view name). May not be empty.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- introspect_schema
Introspects a database schema, loading its metadata (tables, columns, and indexes) into the local model. Use this when a schema's
isIntrospectedflag is false and you need to investigate the schema's structure, or to refresh stale metadata. Returns the schema identifier with the updated introspection status.Parameters:
connectionId: Unique connection ID.databaseName: Name of the database the schema belongs to. Can be empty if the DBMS has no databases but only schemas.schemaName: Name of the schema.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- list_database_connections
Retrieves a list of configured database connections or data sources in the project. For each connection returns its unique ID, name, DBMS, and driver name.
- list_database_schemas
Retrieves a list of database schemas in the specified database connection.
For each schema, the tool returns the schema's own name as well as the database name (empty if not applicable).
Parameters:
connectionId: Unique connection ID.selectedOnly: True if only the schemas selected in the database tree should be listed; false if all schemas should be listed.
- list_recent_sql_queries
This feature is not available in free subscription plans.
Retrieves a list of recent, including currently running, queries for the given database connection.
For each query returns:
Unique ID of a query session.
Time spent on running the query (in milliseconds).
The current state of the query. For example, running, cancelling, finished, and so on.
Completion status of the query. For example, success, finished with error, cancelled, and so on.
Text of the query.
Parameters:
connectionId: Unique connection ID.
- list_schema_object_kinds
Retrieves a list of supported schema object kinds for the given database connection. For each object kind, returns the object kind unique code and human-readable name.
Parameters:
connectionId: Unique connection ID.
- list_schema_objects
Retrieves a list of database objects within the given schema. For each object, returns the object name within the schema and its kind.
Parameters:
connectionId: Unique connection ID.schemaName: Name of the schema.databaseName: Name of the database the schema belongs to. Can be empty if the DBMS has no databases but only schemas.kind: Set this parameter to a particular object kind code to list only objects of that kind. Set it to null to retrieve all objects in the schema.
- preview_table_data
Returns preview data of the table, view, materialized view, or other table-like object using a given database connection.
The tool returns table content in CSV format.
Parameters:
connectionId: Unique connection ID.schemaName: Name of the schema.databaseName: Name of the database the schema belongs to. Can be empty if the DBMS has no databases but only schemas.tableName: Name of the table.maxRowCount: Maximum number of rows to return. Default is100.
- test_database_connection
Returns connection diagnostic info:
Flag indicating if the connection is problematic: yes, no, or unknown.
Detailed information about the database connection such as DBMS type, version, and JDBC driver.
Summary of the connection attempt result. In case of a failure, contains a DBMS-provided error description.
Parameters:
id: Unique connection ID.
Debugger tools
Available in: IntelliJ IDEA Ultimate, CLion, RubyMine
These tools give an external client control over the IDE's debugger: it can set, list, and remove breakpoints, start a debug session and step through it, and inspect the call stack, threads, and variable values at runtime.
To improve how external clients use the IDE's debugger tools, you can install a specific skill for them. This skill comes bundled with the IDE and guides an external client on when to apply the debugger tools.
To install the skill for an external client:
Go to .
Navigate to the Bundled skills section and locate the corresponding skill. It is enabled by default, but is available only to the agents inside the IDE.

To use the skill in Claude Code or Codex outside the IDE, you need to install it for those clients explicitly. To do this, click
and select Claude Agent (Global) or Codex (Global), depending on which client you want to use.

Depending on the target you select, the skill is installed into the following folders:
Claude Code:
%USERPROFILE%\.claude\skills\ij-debugger\
~/.claude/skills/ij-debugger/
~/.claude/skills/ij-debugger/
Codex:
%USERPROFILE%\.codex\skills\ij-debugger\
~/.codex/skills/ij-debugger/
~/.codex/skills/ij-debugger/
To invoke the skill in the external client, use /ij-debugger, or let it activate automatically when relevant.
- xdebug_control_session
Controls the execution of a debug session. Use this tool to step through code, resume execution, pause, or stop the debug session.
Preconditions:
A debug session must exist.
STEP_*andRESUMErequire a suspended session.
Actions:
STEP_INTO: Step into the next method call
STEP_OVER: Step over the current line
STEP_OUT: Step out of the current method
RESUME: Resume program execution until the next breakpoint
PAUSE: Pause program execution
STOP: Stop the debug session
WAIT_FOR_PAUSE: Wait until the session pauses (breakpoint hit or paused manually)
DRAIN_EVENTS: Drain tracepoint outputs for the session (breakpoint errors are drained for all actions)
Important notes:
If the program is running, use WAIT_FOR_PAUSE or PAUSE before
STEP_*/RESUME.Use a current
sessionIdfromxdebug_get_debugger_statusorxdebug_start_debugger_session. If a session stops, times out, or disappears, refresh the session list before the next session-scoped call.RESUME does NOT set breakpoints. If there are no enabled breakpoints (or none will be hit next), the program may run to completion and the session may stop without pausing.
After RESUME, call WAIT_FOR_PAUSE to confirm the next suspension. If WAIT_FOR_PAUSE times out, consider PAUSE and re-check breakpoints.
DRAIN_EVENTS also requires an existing session; do not reuse a stale
sessionIdafter the session has terminated.
Next call:
After RESUME, call
xdebug_control_session(action=WAIT_FOR_PAUSE).After a paused result, call
xdebug_get_stack/xdebug_get_frame_values/xdebug_evaluate_expression.
Status values in the result:
running: Program is executing
paused: Execution is suspended (breakpoint, step, or manual pause); paused results also include
frameValues, a current-frame snapshot inxdebug_get_frame_values(depth=0)format when availablestopped: Debug session has terminated
breakpointErrorsTailis returned for any actiontracepointOutputsTailis returned only for DRAIN_EVENTS
Event support scope:
Breakpoint error and tracepoint output events are currently reported only by JVM-based debuggers (Java, Kotlin, etc.).
On other debugger backends these event tails can be empty even when breakpoints/logging are configured.
Parameters:
sessionId: Debug session ID. Use the current ID returned byxdebug_get_debugger_statusorxdebug_start_debugger_session. If a session has stopped, timed out, or disappeared, refresh the session list before reusing an old ID. Format: uses session name as ID by default; if multiple sessions share the same name, ID is<sessionName>#<executionId>. If null and exactly one active session exists, it is selected automatically. If multiple sessions are active andsessionIdis omitted, the call fails. Default: null.action: Action to perform: STEP_INTO, STEP_OVER, STEP_OUT, RESUME, PAUSE, STOP, WAIT_FOR_PAUSE, DRAIN_EVENTS. Event draining is currently populated only by JVM-based debuggers (Java, Kotlin, etc.).timeout: Timeout in milliseconds to wait for action completion. Guidance: STEP_*/PAUSE usually 5000-15000; WAIT_FOR_PAUSE usually 30000-120000 depending on workload and breakpoints. Default: 30000.eventsLimit: Maximum number of latest events to drain per event list. For DRAIN_EVENTS this limit is applied independently tobreakpointErrorsTailandtracepointOutputsTail. Default: 100.clearEventsAfterRead: Compatibility flag. Returned events are always removed from internal buffers, regardless of this value.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- xdebug_evaluate_expression
Evaluates an expression in the context of the current stack frame. Use this tool to compute values, call methods, or inspect expressions during debugging.
Preconditions:
Session must be suspended.
Evaluation must be supported for the selected frame/language.
expressionmust be a valid expression in the language of the current frame.
The result is returned as:
depth == 0: just the presentation of the evaluated expressiondepth > 0: the presentation plus a pseudo-graphics tree of its children up to the requested depth
Input rules:
Pass raw expression text exactly as the debugger evaluator should parse it.
Do not pass JSON-escaped payloads or literal escape sequences such as
\\"text\\".
Next call:
If the expression confirms hypothesis, continue with
xdebug_control_session(STEP_*|RESUME).If more detail is needed, inspect related values via
xdebug_get_frame_values/xdebug_get_value_by_path.
Parameters:
sessionId: Debug session ID. Use the current ID returned byxdebug_get_debugger_statusorxdebug_start_debugger_session. If a session has stopped, timed out, or disappeared, refresh the session list before reusing an old ID. Format: uses session name as ID by default; if multiple sessions share the same name, ID is<sessionName>#<executionId>. If null and exactly one active session exists, it is selected automatically. If multiple sessions are active andsessionIdis omitted, the call fails. Default: null.frameIndex: Stack frame index as integer (0 = top frame). Obtain this from the current pausedxdebug_get_stackresult; do not reuse a cached frame index after RESUME, STEP_*,xdebug_run_to_line, or any change in paused location. If null, uses the top frame. Default: null.expression: Expression to evaluate in the current context. Pass raw expression text in the language of the current frame; do not pass JSON-escaped payloads or literal backslash-escaped quoted text.depth: Maximum depth for expanding children of the evaluated result (0 = value only, 1 = immediate children, 2 = children + grandchildren, etc.). Default: 0.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- xdebug_get_debugger_status
Returns the current status of the debugger including all active debug sessions. Use this tool to get an overview of all running debug sessions and their states.
Preconditions:
None.
Returns explicit
sessions[]andactiveSessionId.Next call:
If no sessions are running, call
xdebug_start_debugger_session.If multiple sessions are active, use returned
idassessionIdin subsequent calls.
Parameters:
projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- xdebug_get_frame_values
Returns the values visible in the specified stack frame as a tree structure. Use this tool to inspect local variables, parameters, and fields or other values available at a specific point in the call stack.
Preconditions:
Session must be suspended.
Frame index should come from the current paused
xdebug_get_stackresult (0 = top frame).
Format:
Nodes that have children are marked with
+.
Next call:
Use
xdebug_get_value_by_pathto drill into nested fields.Use
xdebug_evaluate_expressionfor computed checks in the same frame.Do not reuse a cached
frameIndexafter RESUME, STEP_*,xdebug_run_to_line, or any change in paused location.
Parameters:
sessionId: Debug session ID. Use the current ID returned byxdebug_get_debugger_statusorxdebug_start_debugger_session. If a session has stopped, timed out, or disappeared, refresh the session list before reusing an old ID. Format: uses session name as ID by default; if multiple sessions share the same name, ID is<sessionName>#<executionId>. If null and exactly one active session exists, it is selected automatically. If multiple sessions are active andsessionIdis omitted, the call fails. Default: null.frameIndex: Stack frame index as integer (0 = top frame). Obtain this from the current pausedxdebug_get_stackresult; do not reuse a cached frame index after RESUME, STEP_*,xdebug_run_to_line, or any change in paused location. If null, uses the top frame. Default: null.depth: Maximum depth for expanding children of the evaluated result (0 = value only, 1 = immediate children, 2 = children + grandchildren, etc.). Default: 0.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- xdebug_get_stack
Returns the call stack for a thread in the debug session. Use this tool to see the sequence of method calls that led to the current execution point.
Preconditions:
Session must be suspended.
Behavior:
threadIdshould come fromxdebug_get_threadsand matches the debugger thread display name (defaults to active thread).Includes frames even when source position is missing (
file/linemay be null).
Pagination:
offset/limitare applied after collecting the full stack.
Frame fields include:
indexfilelineisCurrentpresentation
fileis reported as provided by the debugger (no path normalization).Next call:
Use frame index from the current paused result in
xdebug_get_frame_values,xdebug_get_value_by_path, orxdebug_evaluate_expression.Do not reuse a cached
frameIndexafter RESUME, STEP_*,xdebug_run_to_line, or any change in paused location.
Parameters:
sessionId: Debug session ID. Use the current ID returned byxdebug_get_debugger_statusorxdebug_start_debugger_session. If a session has stopped, timed out, or disappeared, refresh the session list before reusing an old ID. Format: uses session name as ID by default; if multiple sessions share the same name, ID is<sessionName>#<executionId>. If null and exactly one active session exists, it is selected automatically. If multiple sessions are active andsessionIdis omitted, the call fails. Default: null.threadId: Thread ID to get stack for. This value should come fromxdebug_get_threadsand matches the debugger thread display name, not an opaque numeric ID. If not specified, uses the current/active thread. Default: null.limit: Max frames to return. Default: 200.offset: Page offset. Default: 0.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- xdebug_get_threads
Returns the list of threads in the debug session. Use this tool to see all threads and their current status.
Preconditions:
Session must be suspended.
Next call:
Use
xdebug_get_stackfor the selected thread.
Pagination:
offset/limitare applied after collecting all stacks.
Ordering:
Active thread first.
Remaining threads are sorted by descending stack depth.
Schema fields include:
idnamestateisCurrentadditionalInfoadditionalInfoTooltipframeCount
additionalInfo/additionalInfoTooltipuse additional display info when available.Parameters:
sessionId: Debug session ID. Use the current ID returned byxdebug_get_debugger_statusorxdebug_start_debugger_session. If a session has stopped, timed out, or disappeared, refresh the session list before reusing an old ID. Format: uses session name as ID by default; if multiple sessions share the same name, ID is<sessionName>#<executionId>. If null and exactly one active session exists, it is selected automatically. If multiple sessions are active andsessionIdis omitted, the call fails. Default: null.limit: Page size. Default: 50, max: 200.offset: Page offset. Default: 0.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- xdebug_get_value_by_path
Gets the value of a nested object by following a path of property names. Use this tool to drill down into complex objects and inspect their nested properties.
Preconditions:
Session must be suspended.
Path must be non-empty and refer to names visible in the selected frame/object.
The result is returned as:
depth == 0: just the presentation of the value at the specified pathdepth > 0: the presentation of the value plus a pseudo-graphics tree of its children up to the requested depth
Example:
To get the value of
obj.field.subField, usepath = ["obj", "field", "subField"].For array/list indexers, pass the index token as a regular path element (child name), e.g.
items[0].name->path = ["items", "[0]", "name"].Use exact child names from the current paused
xdebug_get_frame_values/ previousxdebug_get_value_by_pathoutput because index node names may differ by language/debugger (for example,"[0]"vs"0").Refresh
pathtokens after RESUME, STEP_*,xdebug_run_to_line, or any other change in paused location.
Next call:
Use another
xdebug_get_value_by_pathcall to continue drilling deeper.Use
xdebug_evaluate_expressionwhen direct name-path navigation is insufficient.
Parameters:
sessionId: Debug session ID. Use the current ID returned byxdebug_get_debugger_statusorxdebug_start_debugger_session. If a session has stopped, timed out, or disappeared, refresh the session list before reusing an old ID. Format: uses session name as ID by default; if multiple sessions share the same name, ID is<sessionName>#<executionId>. If null and exactly one active session exists, it is selected automatically. If multiple sessions are active andsessionIdis omitted, the call fails. Default: null.frameIndex: Stack frame index as integer (0 = top frame). Obtain this from the current pausedxdebug_get_stackresult; do not reuse a cached frame index after RESUME, STEP_*,xdebug_run_to_line, or any change in paused location. If null, uses the top frame. Default: null.path: List of child names to navigate through, e.g.['myObject', 'field', 'subField']or['items', '[0]', 'name']. Use exact node names from the current pausedxdebug_get_frame_values/xdebug_get_value_by_pathoutput and refresh stale path tokens after the paused location changes.depth: Maximum depth for expanding children of the evaluated result (0 = value only, 1 = immediate children, 2 = children + grandchildren, etc.). Default: 0.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- xdebug_list_breakpoints
Lists all breakpoints in the project or in a specific file. Use this tool to see all currently set breakpoints and their properties.
Behavior:
If
filePathis provided, returns only breakpoints in that file.Returns rich attributes for each breakpoint (
id,type,file,line,enabled,owner,condition,isLogMessage,isLogStack,temporary,suspendPolicy,hitCount).
Next call:
If no suitable breakpoint exists, call
xdebug_set_breakpoint.Then continue execution with
xdebug_control_session(action=RESUME)andxdebug_control_session(action=WAIT_FOR_PAUSE).
Parameters:
filePath: Optional file path to filter breakpoints. Path to the file. Supports project-relative paths, paths with .., absolute paths, archive entries like /path/lib.jar!/pkg/Foo.class, and URLs such as file://, jar://, and jrt://. Any path returned from the other tools can be passed as is (e.g. paths fromsearch_*tools). If not specified, returns all breakpoints. Default: null.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- xdebug_remove_breakpoint
Removes breakpoints filtered by owner and optional selectors. Use this tool to remove previously set breakpoints.
Behavior:
ownerdefaults toagent.If only
owneris provided, removes all breakpoints of that owner.If
breakpointIdis provided, removes matching breakpoint(s) for the selected owner.If
filePath+lineare provided, removes matching line breakpoint(s) for the selected owner.If multiple selectors are provided, all of them are combined (logical AND).
Idempotent: removing a non-existing breakpoint returns
removed=false.To remove all breakpoints regardless of owner, call twice: once with
owner=user, once withowner=agent.
Next call:
Use
xdebug_list_breakpointsto verify the remaining set.
Parameters:
breakpointId: Canonical breakpoint ID returned byxdebug_set_breakpointorxdebug_list_breakpoints.filePath: Optional file path to filter breakpoints. Path to the file. Supports project-relative paths, paths with .., absolute paths, archive entries like /path/lib.jar!/pkg/Foo.class, and URLs such as file://, jar://, and jrt://. Any path returned from the other tools can be passed as is (e.g. paths fromsearch_*tools). If not specified, returns all breakpoints. Default: null.line: Optional input: line number (1-based) of the breakpoint to remove.owner: Breakpoint owner filter. Default: agent.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- xdebug_run_to_line
Resumes execution to a target line. Use this tool to run until a specific source position without manually stepping.
Preconditions:
Session must be suspended.
Target file/line must be valid.
Outcome:
paused: session paused at or after target.stopped: session terminated before pause.timeout: no pause/stop within timeout window.
Next call:
If paused, call
xdebug_get_stack/xdebug_get_frame_values/xdebug_evaluate_expression.If the session stopped or disappeared, refresh
sessionIdviaxdebug_get_debugger_statusbefore issuing another session-scoped call.
Parameters:
sessionId: Debug session ID. Use the current ID returned byxdebug_get_debugger_statusorxdebug_start_debugger_session. If a session has stopped, timed out, or disappeared, refresh the session list before reusing an old ID. Format: uses session name as ID by default; if multiple sessions share the same name, ID is<sessionName>#<executionId>. If null and exactly one active session exists, it is selected automatically. If multiple sessions are active andsessionIdis omitted, the call fails. Default: null.filePath: Path relative to the project root.line: Target line number (1-based).timeout: Timeout in milliseconds waiting for a paused/stopped result. Default: 30000.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- xdebug_set_breakpoint
Creates or updates a breakpoint. Use this tool to set line breakpoints, update existing breakpoints by ID, and control tracepoint/logging behavior.
Targeting modes:
By location: provide
filePath+line, and omitbreakpointId(or passnull). Do not use placeholder strings such as"","/", or"__omit__".By ID: provide an existing opaque canonical
breakpointIdreturned byxdebug_set_breakpointorxdebug_list_breakpoints(optionalfilePath/linecan relocate line breakpoints).
Validation:
In location mode, both
filePathandlineare required.In ID mode, breakpoint must exist and be uniquely identified by
breakpointId.In location mode,
filePathis relative to the project root,lineis 1-based, and the target location must be executable.
Event reporting:
Invalid
conditionexpressions are reported asynchronously viaxdebug_control_session(...).breakpointErrorsTail.Tracepoint output from breakpoints with
isLogMessageand/orisLogStackis drained viaxdebug_control_session(action=DRAIN_EVENTS).tracepointOutputsTail.Breakpoint-error and tracepoint-output reporting are currently supported only by JVM-based debuggers (Java, Kotlin, etc.).
A successful
xdebug_set_breakpointresponse does not guarantee thatconditionor tracepoint expressions are valid; check laterbreakpointErrorsTailbefore relying on them.Successful line-breakpoint responses also include
lineText, a truncated excerpt of the actual source line where the breakpoint now resides. Inspect it to confirm placement before resuming.
Apply semantics:
Provided fields are applied as the resulting state for the target breakpoint.
condition=nullclears existing condition.isLogMessage=truelogs breakpoint hit position.isLogStack=truelogs current stack trace.If both flags are true, both position and stack are logged.
With
isLogMessage/isLogStack+suspendPolicy=NONE, the breakpoint behaves as a tracepoint.In ID mode, if
filePath/lineare provided for a line breakpoint, it is relocated (recreated) at the new location.In ID mode, for non-line breakpoints,
filePath/lineare ignored and reported inmessage.Any successful operation marks breakpoint as
agentownership (mcpBreakpointMarker).
Next call:
Use returned
lineTextand/orxdebug_list_breakpointsto verify placement.Start/continue execution via
xdebug_start_debugger_sessionorxdebug_control_session(action=RESUME).
Parameters:
breakpointId: Canonical breakpoint ID returned byxdebug_set_breakpointorxdebug_list_breakpoints.filePath: Optional file path to filter breakpoints. Path to the file. Supports project-relative paths, paths with .., absolute paths, archive entries like /path/lib.jar!/pkg/Foo.class, and URLs such as file://, jar://, and jrt://. Any path returned from the other tools can be passed as is (e.g. paths fromsearch_*tools). If not specified, returns all breakpoints. Default: null.line: 1-based line number. Required only in location mode. Optional in ID mode to relocate line breakpoints.condition: Optional condition expression - breakpoint will only trigger when this evaluates to true. Validation errors are reported asynchronously viaxdebug_control_session(...).breakpointErrorsTail(JVM-based debuggers only). Default: null.isLogMessage: Whether to log breakpoint hit position (source location) when breakpoint is reached. In JVM-based debuggers output is available viaxdebug_control_session(action=DRAIN_EVENTS).tracepointOutputsTail. Default: false.isLogStack: Whether to log stack trace when breakpoint is reached. In JVM-based debuggers output is available viaxdebug_control_session(action=DRAIN_EVENTS).tracepointOutputsTail. Default: false.temporary: Temporary breakpoint (removed after first hit). Default: false.suspendPolicy: Suspend policy: ALL, THREAD, NONE. Default: ALL.enabled: Whether breakpoint is enabled. Default: true.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- xdebug_set_variable
Mutates a variable value by path in the selected stack frame. Use this tool to change state during debugging.
Preconditions:
Session must be suspended.
Value must be modifiable.
pathshould come from the current pausedxdebug_get_frame_values/xdebug_get_value_by_pathoutput.
Path format is the same as in
xdebug_get_value_by_path.newValuemust be a raw expression in the language of the current frame, and it must be assignable to the target value by the debugger/evaluator. Do not pass JSON-escaped payloads or literal escape sequences such as\\"text\\".Result:
Returns
oldValue/newValue/applied.Unsupported mutation returns an error with a textual message.
Next call:
Re-read value via
xdebug_get_value_by_pathorxdebug_get_frame_valuesto confirm.
Parameters:
sessionId: Debug session ID. Use the current ID returned byxdebug_get_debugger_statusorxdebug_start_debugger_session. If a session has stopped, timed out, or disappeared, refresh the session list before reusing an old ID. Format: uses session name as ID by default; if multiple sessions share the same name, ID is<sessionName>#<executionId>. If null and exactly one active session exists, it is selected automatically. If multiple sessions are active andsessionIdis omitted, the call fails. Default: null.frameIndex: Stack frame index as integer (0 = top frame). Obtain this from the current pausedxdebug_get_stackresult; do not reuse a cached frame index after RESUME, STEP_*,xdebug_run_to_line, or any change in paused location. If null, uses the top frame. Default: null.path: Path to target value, same format asxdebug_get_value_by_path. Use exact node names from the current pausedxdebug_get_frame_values/xdebug_get_value_by_pathoutput and refresh stale path tokens after the paused location changes.newValue: New value expression to assign. Pass raw expression text in the language of the current frame; it must be assignable to the target value by the debugger/evaluator. Do not pass JSON-escaped payloads or literal backslash-escaped quoted text.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- xdebug_start_debugger_session
Start a debugger session for either an existing run configuration by name or a code location (
filePath+line) in the current project. Use this tool to start a debugger session. Use this tool with either an existing run configuration name, or withfilePath+line. When usingfilePath+line, a line with a runnable method such asmain, a test, or another executable entry point will almost always work. If you are unsure which line to use,get_run_configurationscan help discover runnable locations in the file. The session will be started, and you can then use other debugger tools to control execution.Preconditions:
When using
configurationName, pass the exact existing run configuration name; do not pass a test method name or other derived target identifier.When using
filePath+line, point at a runnable code location such asmain, a test, or another executable entry point.Set at least one breakpoint first; otherwise the program may run to completion without pausing.
Pass either
configurationName, orfilePathtogether withline. These modes are mutually exclusive.
Behavior:
Waits for session creation up to
timeout.Applies a grace wait (
graceWaitMs) after the session starts and returns refreshed state.Optional launch overrides (
programArguments,workingDirectory,envs) are applied only for this debug launch and are not persisted.get_run_configurationsis the source of truth for override support: only pass launch overrides when the selected run configuration reportssupportsDynamicLaunchOverrides=true.Do not pass these override parameters unless you explicitly need to change the configured launch values for this debug launch.
Missing/null override parameters keep existing run configuration values unchanged.
For string overrides (
programArguments,workingDirectory), missing/null or empty string ("") keeps the existing value unchanged.Pass a whitespace-only string such as
" "to clear an existing value for this debug launch.
Next call:
xdebug_control_session(action=WAIT_FOR_PAUSE)to wait for first suspension.After pause, call
xdebug_get_stackandxdebug_get_frame_values(orxdebug_evaluate_expression) for runtime evidence.
Returns a flat result with debugger session metadata plus the execution snapshot fields from the launch:
sessionId,name,status, and optionalrunConfigurationNameoutputpreview and optionalfullOutputPathoptional
exitCodewhen process termination is already known
Parameters:
configurationName: Name of the existing run configuration to debug.filePath: File path relative to the project root. Provide together withlineto start debugging from a code location.line: 1-based line number forfilePath. Provide together withfilePathand do not combine withconfigurationName.timeout: Timeout in milliseconds to wait for the debug session to start. Default: 60000.graceWaitMs: Grace wait in milliseconds after session starts to refresh state. Default: 2000.programArguments: Optional program arguments override for this launch only. Pass this only when the selected run configuration reportssupportsDynamicLaunchOverrides=trueinget_run_configurations. Missing/null or empty string keeps the existing value; whitespace-only string clears it.workingDirectory: Optional working directory override for this launch only. Pass this only when the selected run configuration reportssupportsDynamicLaunchOverrides=trueinget_run_configurations. Missing/null or empty string keeps the existing value; whitespace-only string clears it.envs: Optional environment variable overrides for this launch only. Pass this only when the selected run configuration reportssupportsDynamicLaunchOverrides=trueinget_run_configurations. Missing/null keeps existing env unchanged; when provided, values are merged over existing env.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Execution tools
- execute_run_configuration
Run either an existing run configuration by name or a temporary run configuration created from a code location (
filePath+line) in the current project, then wait up to the specified timeout for it to finish. Use this tool with either a configuration name returned byget_run_configurations, or with a run point (filePath+line) returned byget_run_configurations(filePath = ...).Optional launch overrides (
programArguments,workingDirectory,envs) are applied only for this run and are not persisted. Do not pass these override parameters unless you explicitly need to change the configured launch values for this run. Missing/null override parameters keep existing run configuration values unchanged. For string overrides (programArguments,workingDirectory), missing/null or empty string ("") keeps the existing value unchanged. Pass a whitespace-only string such as" "to clear an existing value for this launch.Pass either
configurationName, orfilePathtogether withline. These modes are mutually exclusive.Behavior:
When
waitForExit=true, waits up totimeoutmilliseconds for process termination. If the timeout expires, the process keeps running in the background andexitCodeis omitted from the result.When
waitForExit=false, waits only for the process to start, then returns immediately without applyingtimeout.fullOutputPathpoints to a temp file with the full raw output and may continue growing while the process is alive.
Returns the execution result including current output snapshot, optional exit code, and optional
fullOutputPath.Parameters:
configurationName: Name of the existing run configuration to execute.filePath: File path relative to the project root. Provide together withlineto create and execute a temporary run configuration from code context.line: 1-based line number forfilePath. Provide together withfilePathand do not combine withconfigurationName.timeout: Timeout in milliseconds.waitForExit: Whether to wait for process termination. If false, the tool returns immediately after the process starts and ignorestimeout.programArguments: Optional program arguments override for this launch only. Missing/null or empty string keeps the existing value; whitespace-only string clears it.workingDirectory: Optional working directory override for this launch only. Missing/null or empty string keeps the existing value; whitespace-only string clears it.envs: Optional environment variable overrides for this launch only. Missing/null keeps existing env unchanged; when provided, values are merged over existing env.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- get_run_configurations
Returns either project run configurations or executable code locations, depending on the input.
Without
filePath, this tool lists the project's existing run configurations. The result includes configuration names and, when available, launch details such as program arguments, working directory, environment variables, andsupportsDynamicLaunchOverrides.supportsDynamicLaunchOverridesis the source-of-truth capability flag for one-time launch overrides (programArguments,workingDirectory,envs) inexecute_run_configurationandxdebug_start_debugger_session. Only pass those override parameters when this flag istruefor the selected configuration.With
filePath, this tool discovers executable entry points (run points) in that file, such as test methods, main methods, or other executable entry points where the IDE shows a Run gutter icon. The result containsfilePathandrunPoints; use the returned line numbers withexecute_run_configurationto run from code.Parameters:
filePath: Optional file path relative to the project root. When provided, returns run points (executable entry points) in the file instead of project-wide run configurations.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
File tools
- create_new_file
Creates a new file at the specified path within the project directory. Optionally, writes the provided text into the file.
Parameters:
pathInProject: Path where the file should be created relative to the project root.text(optional): Content to write into the new file.overwrite: Whether to overwrite an existing file. If set tofalse, an exception is thrown in case of a conflict.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- get_all_open_file_paths
Returns the paths of all files opened for editing in the active editor or any other open editors, relative to the project root. Use this tool to explore currently open editors.
Parameters:
projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- list_directory_tree
Provides a tree representation of the specified directory in the pseudo-graphic format, similar to the
treeutility. Use this tool to explore the contents of a directory or the entire project. Prefer this tool over command-line utilities likelsordirfor directory listing.Parameters:
directoryPath: Path relative to the project root.maxDepth: Maximum recursion depth.timeout: Timeout in milliseconds.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- open_file_in_editor
Opens the specified file in the JetBrains IDE editor. Requires a
filePathparameter containing the path to the file to open. The file path can be absolute or relative to the project root.Parameters:
filePath: Path relative to the project root.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Formatting tools
- reformat_file
Reformats the specified file in the JetBrains IDE. Use this tool to apply code formatting to a file identified by its path.
Parameters:
path: Path relative to the project root.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Jupyter Notebook tools
Available in: PyCharm
- notebookEdit
Edits a specific cell in a Jupyter notebook (.ipynb file).
Examples:
{"file_path": "/abs/path/demo.ipynb", "cell_id": "abc123", "new_source": "print('hello')", "edit_mode": "replace"}{"file_path": "/abs/path/demo.ipynb", "cell_id": "abc123", "new_source": "# Title", "cell_type": "markdown", "edit_mode": "insert"}{"file_path": "/abs/path/demo.ipynb", "cell_id": "abc123", "edit_mode": "delete"}
Parameters:
file_path(required): Absolute path to the .ipynb notebook.cell_id: Jupyter cell ID. Required forreplaceanddelete. Forinsert, the new cell is placed after this cell, or at the beginning if omitted.new_source: New source content for the cell. Required forreplaceandinsert.cell_type: Cell type:codeormarkdown. Required forinsert.edit_mode: Operation:replace(default),insert, ordelete.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- readNotebook
Reads a Jupyter notebook (.ipynb) and returns all cells with their contents and outputs. Returns structured text with each cell's index, ID, type, source code, and outputs.
Examples:
{"file_path": "/abs/path/demo.ipynb"}{"file_path": "/abs/path/demo.ipynb", "cell_id": "abc123"}
Parameters:
file_path(required): Absolute path to the .ipynb notebook.cell_id: Optional Jupyter cell ID. If provided, returns only that cell with full outputs. If omitted, all cells are returned.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- runNotebookCell
Execute one or all cells of a Jupyter notebook.
Examples:
{"file_path": "/abs/path/demo.ipynb", "cell_id": "13c5cec416369e19"}{"file_path": "/abs/path/demo.ipynb"}
Parameters:
file_path: Absolute path to the .ipynb notebook.cell_id: Optional Jupyter cell ID. If omitted, all cells are executed.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Inspection Generator MCP Tools
- validate_inspection_kts
Validates an inspection.kts script against specification examples. Compiles the inspection and runs it against positive/negative examples. Returns compilation status and detailed verification results.
Positive examples should trigger the inspection (problems expected). Negative examples should NOT trigger the inspection (no problems expected on forbidden lines).
Returns overall success, per-example results, and aggregation statistics.
Parameters:
inspectionKtsCode: The inspection.kts script content to compile and validate.pathToSpecification: Path to specification with examples to validate against.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Inspection KTS MCP tools
- generate_inspection_kts_api
Returns the Inspection KTS API documentation for the target language. Provides available classes and functions that can be used when writing inspection.kts files.
Parameters:
language: Target language: 'Java' or 'Kotlin'.wrapInTags: If true, wraps the API content in<API>and<api.kt>tags.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- generate_inspection_kts_examples
Returns example inspection.kts templates for the target language to guide code generation. Provides XML-wrapped examples showing how to write inspections using the InspectionKts API.
Parameters:
language: Target language: 'Java' or 'Kotlin'.includeAdditionalExamples: If true, includes additional curated examples besides templates.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- generate_psi_tree
Creates a PSI tree for the provided Java or Kotlin code and returns it as indented text. Use this tool to understand the PSI structure of code snippets when writing inspections. The output shows element types and their hierarchy, with hints about when
node.children()is needed.Parameters:
code: Source code snippet to parse.language: Target language: 'Java' or 'Kotlin'.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- run_inspection_kts
Compiles an inspection.kts script and runs it against a target file. Returns compilation errors if any, or the list of problems found by the inspection. Use this tool to test inspection.kts scripts during development.
Parameters:
inspectionKtsCode: The inspection.kts script content to compile and run.contextPath: Relative path of the target file inside project to analyze (for example, src/my/package/Example.kt).targetFileContent: The content of the target file to analyze. If not provided, the file must exist in the project.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Patch tools
- apply_patch
Applies a patch in the Codex
apply_patchformat or the unified Git diff format. Supports Add, Delete, and Update operations, with an optional move-to path for updates. Paths must stay inside the project directory.Parameters:
input: Patch text in theapply_patchformat or the unified Git diff format.patch: Alias ofinputfor compatibility with clients that send{patch: ...}.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Read tools
- read_file
Reads a file in the project directory or from any project dependency or other project source root. Can read sources inside Jar/Jrt files and decompile Java class files inside Jar/Jrt files or on disk. Returns numbered lines (1-indexed) as text.
Modes:
slicelinesline_columnsoffsetsindentation
Mode details:
sliceusesstart_lineandmax_lines.linesusesstart_line/end_line(inclusive).line_columnsusesstart_line/start_columnandend_line/end_column(endis exclusive;end_linedefaults tostart_line).offsetsusesstart_offset/end_offset(endis exclusive).indentationusesstart_linewithmax_levels/include_*.
max_linescaps the total output in all modes;context_linesapplies to range modes (per side).Parameters:
file_path: Path to the file. Supports project-relative paths, paths with '..', absolute paths, archive entries like /path/lib.jar!/pkg/Foo .class, and URLs such as file://, jar://, and jrt://. Any path returned from the other tools can be passed as is (e.g. paths fromsearch_*tools).mode: Read mode:slice,lines,line_columns,offsets, orindentation.start_line: 1-based line number to start reading from.max_lines: Maximum number of lines to return (slice uses as line count; all modes cap output).end_line: 1-based end line forlines/line_columnsmode (inclusive forlines; exclusive forline_columns).start_column: 1-based start column forline_columnsmode.end_column: 1-based end column for range read (exclusive).start_offset: 0-based start offset for offsets mode (requiresend_offset).end_offset: 0-based end offset for offsets mode (exclusive).context_lines: Number of context lines to include around the range (per side).max_levels: Indentation mode: maximum indentation levels to include (0 = only anchor block).include_siblings: Indentation mode: include sibling blocks at the same indentation level.include_header: Indentation mode: include header comments/annotations directly above anchor.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Refactoring tools
- rename_refactoring
Renames a symbol (variable, function, class, etc.) in the specified file. Use this tool to perform rename refactoring operations.
Unlike a simple text search-and-replace, the
rename_refactoringtool is a context-aware utility that understands the code's structure. It intelligently updates all references to the specified symbol throughout the project, ensuring code integrity and preventing broken references. It is always the preferred method for renaming programmatic symbols.The tool returns a success message if the rename operation was successful, or an error message if the file or symbol cannot be found, or if the rename operation fails.
Parameters:
pathInProject: Path relative to the project root.symbolName: Name of the symbol to rename.newName: New name for the symbol.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Search tools
- search_file
Searches for files by glob pattern within the project. Use this tool when you need to match file paths using glob syntax.
Glob patterns are relative to the project root.
Examples:
"**/*.kt""src/**/Foo*.java""build.gradle.kts"
Patterns without
'/'are treated as"**/pattern".pathsare optional additional glob filters relative to the project root.Parameters:
q: Glob pattern to search for.paths: Optional list of project-relative glob patterns to filter results. Supports!excludes. Trailing/expands to**. Patterns without/are treated as**/pattern. Empty strings are ignored.includeExcluded: Whether to include excluded/ignored files in results.limit: Maximum number of results to return.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- search_regex
Searches for regex matches within project files. Use this tool when you need regex search with snippet results. Results include match coordinates when available (1-based line/column, 0-based offsets).
Paths are glob patterns relative to the project root.
Examples:
["src/**", "!**/test/**"]["**/*.kt"]["foo/"]
Parameters:
q: Regex pattern to search for.paths: Optional list of project-relative glob patterns to filter results. Supports!excludes. Trailing/expands to**. Patterns without/are treated as**/pattern. Empty strings are ignored.limit: Maximum number of results to return.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- search_symbol
Searches for symbols (classes, methods, fields). Use this tool for semantic lookup by identifier fragments. Results include match coordinates when available (1-based line/column, 0-based offsets).
Paths are glob patterns relative to the project root.
By default, this searches project symbols only. If you don't find a suitable result, try again with
include_external=trueto search SDK and library symbols too.Parameters:
q: Symbol query text.paths: Optional list of project-relative glob patterns to filter results. Supports!excludes. Trailing/expands to**. Patterns without/are treated as**/pattern. Empty strings are ignored.include_external: Whether to include SDK and library symbols. Disabled by default; if nothing suitable is found, try again withinclude_external=true.limit: Maximum number of results to return.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- search_text
Searches for a text substring within project files. Use this tool for fast text search with snippet results. Results include match coordinates when available (1-based line/column, 0-based offsets).
Paths are glob patterns relative to the project root.
Examples:
["src/**", "!**/test/**"]["**/*.kt"]["foo/"]
Parameters:
q: Text to search for.paths: Optional list of project-relative glob patterns to filter results. Supports!excludes. Trailing/expands to**. Patterns without/are treated as**/pattern. Empty strings are ignored.limit: Maximum number of results to return.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Skill Search tools
- skill_search
Performs a unified project search with an explicit mode:
file: glob path search.text: literal content search.regex: regex content search.symbol: semantic symbol lookup.
Symbol search is project-focused by default. If you do not find a suitable symbol, try again with
include_external=trueto search SDK and library symbols too.Parameters:
mode(required): Search mode:file,text,regex, orsymbol.q(required): Search query. Formode=filethis is a glob pattern.paths: Optional project-relative glob filters. Supports!-excludes and a trailing/.include_external: Whether to include SDK and library symbols formode=symbol. Disabled by default; if nothing suitable is found, try again withinclude_external=true.includeExcluded: Whether to include excluded or ignored files. Supported only formode=file.limit: Maximum number of results to return.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Terminal tools
- execute_terminal_command
Executes a specified shell command in the IDE's integrated terminal. Use this tool to run terminal commands within the IDE environment.
Important features and limitations:
Checks if a process is running before collecting output.
Limits output to 2000 lines (truncates any excess).
Times out after the specified timeout, with a notification.
Requires user confirmation unless Brave Mode is enabled in the settings.
Returns possible responses:
Terminal output (truncated if over 2000 lines).
Output with an interruption notice if the command times out.
Error messages for various failure cases.
Parameters:
command: Shell command to execute.executeInShell: Whether to execute the command in the user's default shell (bash, zsh, etc.). Useful if the command is a shell script or if it is important to preserve the real environment of the user's terminal. If set tofalse, the command will be started as a process.reuseExistingTerminalWindow: Whether to reuse an existing terminal window to avoid creating multiple terminals.timeout: Timeout in milliseconds.maxLinesCount: Maximum number of lines to return.truncateMode: How to truncate the text: from the start, in the middle, at the end, or do not truncate at all.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Universal tools
- execute_tool
Universal tool executor that dynamically invokes a specific IDE MCP tool from a command-line string.
Parameters:
command(required): Command-line string with the tool name and arguments.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
VCS tools
- get_repositories
Retrieves the list of VCS roots in the project. Use this tool to identify all repositories in a multi-repository project.
Parameters:
projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
- git_status
Retrieves the Git status for one or more repositories in the current project. Returns porcelain-style index and worktree status codes and summary counters. By default, all Git repositories are returned.
Parameters:
repositoryPathRelativeToProject: Optional path relative to the project root used to select a single containing repository.includeUntracked: Whether to include untracked files.includeIgnored: Whether to include ignored files.limit: Maximum number of entries returned per repository.projectPath: The project path. Always provide this value if known to reduce ambiguous calls. If only the current working directory is known, you can use it as the project path.
Rails-specific tools
Available in: RubyMine
- get_rails_routes
Retrieves Rails routes in the project. Results are returned in a paginated list and filtered based on included/excluded paths, actions (specified by fully-qualified name, or FQN), directories, and HTTP methods.
Prefer this tool over manual code inspection as it performs deep analysis of Rails routes.
Parameters:
page: Page number for pagination.page_size: Number of items per page.included_route_path_filters: List of route path patterns to include.excluded_route_path_filters: List of route path patterns to exclude.included_action_fqn_filters: List of fully-qualified action names to include.excluded_action_fqn_filters: List of fully-qualified action names to exclude.included_action_directory_filters: List of action directories to include.excluded_action_directory_filters: List of action directories to exclude.min_action_count: Minimum number of actions a route must have.max_action_count: Maximum number of actions a route can have.included_http_method_filters: List of HTTP methods to include (GET, POST, etc.).excluded_http_method_filters: List of HTTP methods to exclude.
- get_rails_models
Retrieves Rails models in the project. Results are paginated and can be filtered by FQN
Parameters:
page: Page number for pagination.page_size: Number of items per page.included_fqn_filters: List of FQN patterns to include.excluded_fqn_filters: List of FQN patterns to exclude.included_directory_filters: List of directories to include.excluded_directory_filters: List of directories to exclude.controller_filter: Filter to include only models with or without corresponding controllers.
- get_rails_controllers
Retrieves Rails controllers in the project. Results are paginated and can be filtered by FQN, directory, views, abstract status, and corresponding model presence.
Parameters:
page: Page number for pagination.page_size: Number of items per page.included_fqn_filters: List of FQN patterns to include.excluded_fqn_filters: List of FQN patterns to exclude.included_directory_filters: List of directories to include.excluded_directory_filters: List of directories to exclude.included_view_filters: List of view filters to include.excluded_view_filters: List of view filters to exclude.abstract_filter: Filter to include only abstract, non-abstract, or all controllers.model_filter: Filter to include only controllers with or without a corresponding model.
- get_rails_helpers
Retrieves Rails helpers in the project. Results are paginated and can be filtered by FQN and directory.
Parameters:
page: Page number for pagination.page_size: Number of items per page.included_fqn_filters: List of FQN patterns to include.excluded_fqn_filters: List of FQN patterns to exclude.included_directory_filters: List of directories to include.excluded_directory_filters: List of directories to exclude.
- get_rails_views
Retrieves Rails views in the project. Results are paginated and can be filtered by partiality, layout, controller association, path, and controller directory/FQN.
Parameters:
page: Page number for pagination.page_size: Number of items per page.partiality_filter: Filter to include only partial views, non-partial views, or both.layout_filter: Filter to include only layout views, non-layout views, or both.controller_filter: Filter to include only views with associated controllers.included_path_filters: List of view paths to include.excluded_path_filters: List of view paths to exclude.included_controller_fqn_filters: List of controller FQNs to include.excluded_controller_fqn_filters: List of controller FQNs to exclude.included_controller_directory_filters: List of controller directories to include.excluded_controller_directory_filters: List of controller directories to exclude.
- get_rails_mailers
Retrieves Rails mailers in the project. Results are paginated and can be filtered by FQN and directory.
Parameters:
page: Page number for pagination.page_size: Number of items per page.included_fqn_filters: List of FQN patterns to include.excluded_fqn_filters: List of FQN patterns to exclude.included_directory_filters: List of directories to include.excluded_directory_filters: List of directories to exclude.