Skip to content

Hotswap MCP

The DebugTools IDEA plugin provides three MCP tools in DebugToolsHotswapToolset. They list IDEA run configurations, start a run configuration through DebugTools Hotswap, and trigger compilation and hot reload through IDEA Java Debugger.

This page is a tool reference and covers only each tool's purpose, input parameters, and return values. The Hotswap Skill defines how an AI should select run configurations, handle auto-attach, and decide when to trigger hot reload.

Tool Overview

ToolPurpose
list_debug_tools_run_configurationsLists run configurations in the current IDEA project, with optional module, main class, and configuration type filters.
execute_debug_tools_run_configurationStarts a specified IDEA run configuration with the DebugTools Hotswap executor.
compile_and_reload_modified_filesTriggers Compile and Reload Modified Files for an attached Java Debugger session.

Common Conventions

All three tools support an optional projectPath parameter:

ParameterRequiredTypeDescription
projectPathNostringAn IDEA project directory or a file path inside the project. Use it to identify the target when the MCP context is ambiguous or IDEA has multiple projects open.

When projectPath is omitted, the plugin resolves the target from the IDEA MCP call context and open projects. If it cannot identify a project, the tool returns an MCP error.

Normal results are returned as JSON text. Missing parameters, nonexistent projects, or unexpected execution failures may return an MCP error directly. Expected business failures are represented by success=false and message in the result object.

1. List IDEA Run Configurations

Tool name: list_debug_tools_run_configurations

Purpose

Reads run configurations from the current IDEA project's RunManager and returns their names, types, main classes, and modules. It only queries configurations and does not start an application.

The result matches IDEA's native run configuration list. It does not prefilter configurations that do not support the DebugTools Hotswap executor. Support is checked when execute_debug_tools_run_configuration runs.

Parameters

There are no tool-specific required parameters.

ParameterRequiredTypeDescription
projectPathNostringTarget IDEA project path; see Common Conventions.
moduleNameNostringModule name filter. It must exactly match moduleName in the result.
mainClassNameContainsNostringMain class substring filter. Checks whether mainClassName contains the supplied text.
typeDisplayNameNostringExact run configuration type display name, such as Spring Boot or Application.

When multiple filters are supplied, a configuration must satisfy all of them. Empty strings are treated as omitted.

Return Value

FieldTypeDescription
countintegerNumber of run configurations after filtering.
configurationsarrayRun configuration summaries.
configurations[].namestringIDEA run configuration name. Pass this value to execute_debug_tools_run_configuration.configurationName.
configurations[].typeNamestringRun configuration type name.
configurations[].typeDisplayNamestringConfiguration type name displayed by IDEA.
configurations[].mainClassNamestring | nullFully qualified Java main class name, when available.
configurations[].moduleNamestring | nullAssociated IDEA module name.

Request example:

json
{
  "moduleName": "demo-service",
  "mainClassNameContains": "DemoApplication",
  "typeDisplayName": "Spring Boot"
}

Response example:

json
{
  "count": 1,
  "configurations": [
    {
      "name": "DemoApplication",
      "typeName": "Spring Boot",
      "typeDisplayName": "Spring Boot",
      "mainClassName": "com.example.DemoApplication",
      "moduleName": "demo-service"
    }
  ]
}

2. Start a Run Configuration

Tool name: execute_debug_tools_run_configuration

Purpose

Finds an IDEA run configuration by name and requests startup with the DebugTools Hotswap executor. This is equivalent to selecting the configuration in IDEA and running Hotswap '<configuration>' with DebugTools.

Parameters

ParameterRequiredTypeDescription
configurationNameYesstringExact full name of the IDEA run configuration to start.
projectPathNostringTarget IDEA project path; see Common Conventions.

Return Value

FieldTypeDescription
successbooleanWhether the startup request was successfully submitted to IDEA's execution system.
configurationNamestringRequested run configuration name.
executorIdstringDebugTools executor ID used for the request, currently DebugTools Debug Executor.
autoAttachEnabledbooleanWhether the global DebugTools auto-attach option is enabled.
requiresManualAttachbooleanWhether the DebugTools agent must be attached manually after startup.
nextActionstring | nullSuggested next action for the MCP client; null when startup fails.
expectedMainClassNamestring | nullExpected main class read from the run configuration.
expectedModuleNamestring | nullExpected module read from the run configuration.
messagestringStartup status or failure description.
availableConfigurationNamesstring[]Available configuration names when the requested configuration is not found; normally empty for other results.

Current nextAction values:

ValueMeaning
LIST_DEBUG_TOOLS_CONNECTIONSAuto-attach is enabled; the client should check DebugTools connections next.
LIST_ATTACHABLE_JVMSAuto-attach is disabled; the client should list attachable JVMs next.
nullStartup failed, so no next action is suggested.

WARNING

success=true only means IDEA accepted the startup request. It does not mean the JVM has finished starting or that a DebugTools connection has been established.

Request example:

json
{
  "configurationName": "DemoApplication"
}

Successful response example:

json
{
  "success": true,
  "configurationName": "DemoApplication",
  "executorId": "DebugTools Debug Executor",
  "autoAttachEnabled": true,
  "requiresManualAttach": false,
  "nextAction": "LIST_DEBUG_TOOLS_CONNECTIONS",
  "expectedMainClassName": "com.example.DemoApplication",
  "expectedModuleName": "demo-service",
  "message": "DebugTools run configuration start requested",
  "availableConfigurationNames": []
}

Response when the configuration is not found:

json
{
  "success": false,
  "configurationName": "UnknownApplication",
  "executorId": "DebugTools Debug Executor",
  "autoAttachEnabled": false,
  "requiresManualAttach": false,
  "nextAction": null,
  "expectedMainClassName": null,
  "expectedModuleName": null,
  "message": "Run configuration not found: UnknownApplication",
  "availableConfigurationNames": ["DemoApplication", "DemoTests"]
}

If the configuration exists but its runner does not support the DebugTools Hotswap executor, or the executor is unavailable in the current IDEA instance, the tool also returns success=false with the reason in message.

3. Compile and Hot Reload Modified Classes

Tool name: compile_and_reload_modified_files

Purpose

Selects an attached IDEA Java Debugger session in the current project and invokes Java Debugger's Compile and Reload Modified Files capability.

Here, modified files are files and classes tracked by Java Debugger since the session started or since the previous reload. They are not the modified files in the Git workspace.

Parameters

There are no unconditionally required tool-specific parameters.

ParameterRequiredTypeDescription
projectPathNostringTarget IDEA project path; see Common Conventions.
sessionNameConditionalstringJava Debugger session name. It can be omitted when only one session is available, but is required when multiple sessions exist.
compileBeforeReloadNobooleanWhether to compile before hot reload. When omitted, uses the current IDEA Java Debugger COMPILE_BEFORE_HOTSWAP setting.

Return Value

FieldTypeDescription
successbooleanWhether the compile-and-reload request was successfully submitted to IDEA Java Debugger.
sessionNamestring | nullSelected debugger session name. If selection fails, it may contain the requested name or be null.
compileBeforeReloadbooleanEffective compile-before-reload setting for this request.
messagestringRequest result or failure reason.
availableSessionNamesstring[]Candidate session names when multiple sessions exist without a selection, the requested session does not exist, or a similar selection error occurs.

WARNING

success=true only means the request was submitted to IDEA Java Debugger. Compilation progress, HotSwap results, and failure details are still shown by IDEA's native UI or notifications.

Request example:

json
{
  "sessionName": "DemoApplication",
  "compileBeforeReload": true
}

Successful response example:

json
{
  "success": true,
  "sessionName": "DemoApplication",
  "compileBeforeReload": true,
  "message": "Compile and reload modified files requested",
  "availableSessionNames": []
}

Response when multiple debugger sessions exist and sessionName is omitted:

json
{
  "success": false,
  "sessionName": null,
  "compileBeforeReload": true,
  "message": "Multiple attached Java debugger sessions are available; pass sessionName to choose one",
  "availableSessionNames": ["DemoApplication", "WorkerApplication"]
}

If the current project has no attached Java Debugger session, the tool returns success=false with message set to No attached Java debugger session is available for hotswap.