经 AI Skill Hub 精选评估,MCP Java调试工具 获评「推荐使用」。这款MCP工具在功能完整性、社区活跃度和易用性方面表现出色,AI 评分 7.5 分,适合有一定技术背景的用户使用。
MCP Java调试工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
MCP Java调试工具 是一款遵循 MCP(Model Context Protocol)标准协议的 AI 工具扩展。通过 MCP 协议,它可以让 Claude、Cursor 等主流 AI 客户端直接访问和操作外部工具、数据源和服务,实现 AI 能力的无缝扩展。无论是文件操作、数据库查询还是 API 调用,都可以通过自然语言在 AI 对话中直接触发,极大提升生产效率。
# 方式一:通过 Claude Code CLI 一键安装
claude skill install https://github.com/FgForrest/mcp-jdwp-java
# 方式二:手动配置 claude_desktop_config.json
{
"mcpServers": {
"mcp-java----": {
"command": "npx",
"args": ["-y", "mcp-jdwp-java"]
}
}
}
# 配置文件位置
# macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
# Windows: %APPDATA%/Claude/claude_desktop_config.json
# 安装后在 Claude 对话中直接使用 # 示例: 用户: 请帮我用 MCP Java调试工具 执行以下任务... Claude: [自动调用 MCP Java调试工具 MCP 工具处理请求] # 查看可用工具列表 # 在 Claude 中输入:"列出所有可用的 MCP 工具"
// claude_desktop_config.json 配置示例
{
"mcpServers": {
"mcp_java____": {
"command": "npx",
"args": ["-y", "mcp-jdwp-java"],
"env": {
// "API_KEY": "your-api-key-here"
}
}
}
}
// 保存后重启 Claude Desktop 生效
MCP server that gives AI agents full debugger control over running Java applications — inspect state, set breakpoints, evaluate expressions, and mutate values at runtime via JDWP/JDI.
Release notes — seeCHANGELOG.md. 2.0.0 is a breaking release: severaljdwp_clear_*tools were unified, and field watchpoints are new.
Built on the foundations of mcp-jdwp-java by Nicolas Vautrin — the original project that provided core JDI connectivity, thread/stack/variable inspection, stepping, and basic breakpoint management. Everything described below as "beyond standard JDWP" was built on top of that base.
These are the capabilities this server adds on top of raw JDI — the reason to use it instead of writing JDI calls directly.
jdk.jdi)No separate Maven install is required — the repository ships with the Maven Wrapper (./mvnw), which downloads a pinned Maven 3.9.x into ~/.m2/wrapper/ on first use. The SessionStart hook and every build command in this README use the wrapper.
jdk.jdi module) — Java Debug InterfaceOption A: Plugin marketplace (recommended)
Installs the MCP server, the java-debug skill (debugging workflows, recipes, gotchas), and the .mcp.json configuration in one step:
/plugin marketplace add https://github.com/FgForrest/mcp-jdwp-java.git
/plugin install jdwp-debugging@mcp-jdwp-java
The server JAR is built automatically on first session start via the bundled ./mvnw wrapper (requires JDK 17+ on PATH — no Maven install needed). Restart Claude Code to pick up the plugin.
<details> <summary><strong>Alternative: manual MCP registration (without plugin)</strong></summary>
If you prefer to register the MCP server directly without the plugin (no skill, no auto-build):
1. Build the JAR:
git clone https://github.com/FgForrest/mcp-jdwp-java.git
cd mcp-jdwp-java
./mvnw clean package -DskipTests # use mvnw.cmd on Windows
2. Register with Claude Code:
claude mcp add jdwp-inspector -s user \
-e MCP_TIMEOUT=30000 \
-e MCP_TOOL_TIMEOUT=120000 \
-- java --add-modules jdk.jdi,jdk.attach -jar /path/to/mcp-jdwp-java.jar
To change the JDWP port (default 5005), add -DJVM_JDWP_PORT=12345 before -jar.
The MCP_TIMEOUT and MCP_TOOL_TIMEOUT environment variables are important — JVM startup is not instant (class loading, Spring context initialization), so the default MCP timeouts will cause Claude Code to give up before the server is ready. MCP_TIMEOUT=30000 gives the server 30 seconds to start, and MCP_TOOL_TIMEOUT=120000 allows up to 2 minutes for long-running tools like first-time expression evaluation (which discovers the target's classpath and compiles bytecode).
Re-installing requires removing first: claude mcp remove jdwp-inspector -s user
Drop -s user to scope to the current project only.
.mcp.json:
{
"mcpServers": {
"jdwp-inspector": {
"command": "java",
"args": [
"--add-modules", "jdk.jdi,jdk.attach",
"-jar", "/path/to/mcp-jdwp-java.jar"
],
"env": {
"MCP_TIMEOUT": "30000",
"MCP_TOOL_TIMEOUT": "120000"
}
}
}
}
</details>
The fastest path for fresh plugin users is a self-contained zip — no clone, no reactor build:
curl -L -o jdwp-sandbox.zip \
https://github.com/FgForrest/mcp-jdwp-java/releases/latest/download/jdwp-sandbox.zip
unzip jdwp-sandbox.zip && cd jdwp-sandbox
Inside, you get a parentless Maven project with src/, a pom.xml, a flight-game README.md, and a CLAUDE.md that briefs the agent on the game's house rules. Open the folder in Claude Code and ask it to play flight #1 — the bundled CLAUDE.md keeps it honest (no peeking at source, no spoiler-fetching). Continue with the workflow below.
Difficulty: Hard | Test: ConfigurationProviderTest | Package: config
Symptom: expected timeout=5000 but was 0 — the configuration exists but its timeout field is still at the default value.
Hint: The config object is assigned to the shared field before it's fully initialized. A reader thread sees the reference but reads a half-constructed object.
<details> <summary><strong>Reveal root cause</strong></summary>
ConfigurationProvider.getConfig() assigns instance = new Configuration(...) and then signals a latch — but calls instance.init() (which sets timeout=5000) after the latch release. A reader thread waiting on that latch sees instance != null and returns the un-initialized object with timeout=0.
Debug path: Set breakpoints in both the initializer and reader paths of getConfig(). Use jdwp_get_threads() to see both threads, then inspect the Configuration object from each thread's perspective. The initializer hasn't called init() yet when the reader returns.
</details>
---
| Component | Role |
|---|---|
| **JDWPTools** | 44 @McpTool methods — the MCP surface. Thin orchestration over services below. |
| **JDIConnectionService** | Singleton VirtualMachine connection. Object cache (ConcurrentHashMap<Long, ObjectReference>), smart collection rendering, classpath discovery. |
| **BreakpointTracker** | Breakpoint registry with synthetic IDs. Tracks pending/deferred state, conditions, logpoint expressions, exception breakpoints, and chain dependencies (with cycle detection and trigger-fire memory across pending → active promotion). |
| **JdiEventListener** | Daemon thread consuming the JDI event queue. Routes events, evaluates conditions/logpoints, handles recursive suppression. |
| **EvaluationGuard** | Per-thread reentrancy guard preventing deadlocks during expression evaluation. |
| **EventHistory** | Ring buffer of the last 100 JDWP events (including suppressed). |
ClassLoader.defineClass() and invokes it.| Problem | Solution |
|---|---|
tools.jar not found / jdk.jdi not available | Ensure JAVA_HOME points to a JDK, not a JRE. Launch with --add-modules jdk.jdi. |
| Connection refused | Verify target JVM has -agentlib:jdwp=...address=*:5005. Check port matches -DJVM_JDWP_PORT. |
| MCP server doesn't respond | Rebuild: ./mvnw clean package -DskipTests. Check jar path. Restart Claude Code. |
| MCP server times out on startup | JVM startup takes several seconds. Ensure MCP_TIMEOUT=30000 (or higher) is set in the MCP registration — the default is too short for a Spring Boot Java process. |
| "Thread is not suspended" | The thread must be stopped at a breakpoint for stack/locals/expression tools. |
| Expression evaluation timeout | First evaluation is slow (classpath discovery). Increase MCP_TOOL_TIMEOUT. Subsequent evaluations use cache. |
该工具提供了Java应用程序调试的新方法,通过AI代理的控制权提高了调试精度和开发效率,但需要进一步优化和完善。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ MIT 协议 — 最宽松的开源协议之一,可自由商用、修改、分发,仅需保留版权声明。
AI Skill Hub 点评:MCP Java调试工具 的核心功能完整,质量良好。对于Claude Desktop / Claude Code 用户来说,这是一个值得纳入个人工具库的选择。建议先在非生产环境试用,再逐步推广。
| 原始名称 | mcp-jdwp-java |
| 原始描述 | 开源MCP工具:MCP server giving AI agents full debugger control over running Java applications。⭐13 · Java |
| Topics | mcpai-agentjavadebugger |
| GitHub | https://github.com/FgForrest/mcp-jdwp-java |
| License | MIT |
| 语言 | Java |
收录时间:2026-05-23 · 更新时间:2026-05-23 · License:MIT · AI Skill Hub 不对第三方内容的准确性作法律背书。
选择 Agent 类型,复制安装指令后粘贴到对应客户端