arthas-mcp
语言: English | 简体中文
一个 MCP 服务器,将 Alibaba Arthas 桥接到 Claude Code、Cursor、Codex 及任何其他支持 MCP 的 AI 助手。它每 15 秒扫描本地 JVM,过滤掉 IDE/构建守护进程,自动挂载 Arthas,并提供开箱即用的诊断工具——所以你可以直接问 agent “订单服务为什么变慢了?”,它就能在运行中的进程上执行 thread、trace、watch 和 ognl。
AI agent ──stdio/HTTP──> arthas-mcp ──auto-attach──> Arthas agent ──> your JVM
▲
jps discovery every 15s对比
arthas-mcp(本项目) | 社区封装 | ||
安装配置 | 零配置 —— 直接启动 | 运行在目标 JVM 内部的 Java 模块 | 手动启动 Arthas WebConsole,然后指向一个 URL |
目标发现 | 自动(jps 扫描 + 黑名单) | 无(它就是应用本身) | 手动 |
语言 | Node(无需维护 Java 代码) | Java | 各有不同 |
适用场景 | 从编辑器中调试任意本地服务 | 进程内、生产环境托管的诊断 | 快速的一次性诊断 |
Related MCP server: Arthas MCP Server
特性
零配置发现 —— 通过
jps查找业务 JVM,借助内置黑名单跳过 IntelliJ / Gradle / Maven / 语言服务器守护进程自动挂载与重新挂载 —— 在受管端口池中为每个进程启动
arthas-boot,并在 agent 断开时重新挂载同步 + 异步命令执行 —— 短命令(
version、sc、sm、ognl)直接返回;长时间运行的命令(trace、watch、monitor)通过pull_results流式获取,并且可以中断stdio 与 HTTP 模式 —— 每个客户端会话一个实例(stdio),或共享的常驻服务(
--http),提供/mcp+/healthz友好的输出 —— Arthas 任务结果被整理成简洁的文本,LLM 可以直接阅读
跨平台 —— macOS、Linux 和 Windows(按操作系统进行进程内省:
/proc、ps、PowerShell CIM)
支持的平台
平台 | 状态 |
macOS | ✅ |
Linux | ✅ |
Windows | ✅(需要 |
环境要求:Node ≥ 18、JDK(用于 jps 和 java),以及 Arthas——会自动从 ~/.arthas/lib 检测(也就是说,如果你之前运行过 arthas-boot,它就已经安装好了),或者将 ARTHAS_BOOT_JAR 指向 arthas-boot.jar。所有依赖都是免费且开源的。
安装
无需安装直接运行(推荐)
npx -y github:x0c/arthas-mcp --version全局安装
npm install -g github:x0c/arthas-mcp
arthas-mcp --versionmacOS、Linux 和 Windows 上命令相同。一旦发布到 npm 仓库,两者都可简化为
npx -y arthas-mcp/npm install -g arthas-mcp。
从源码安装
git clone https://github.com/x0c/arthas-mcp.git
cd arthas-mcp && npm install
node cli/arthas-mcp.mjs --version配置你的 MCP 客户端
Claude Code:
claude mcp add arthas -- npx -y github:x0c/arthas-mcpCursor / 任何读取 mcpServers JSON 块的客户端:
{
"mcpServers": {
"arthas": {
"command": "npx",
"args": ["-y", "github:x0c/arthas-mcp"]
}
}
}共享守护进程模式(所有客户端共用一个实例):
{
"mcpServers": {
"arthas": {
"command": "npx",
"args": ["-y", "github:x0c/arthas-mcp", "--http"],
"url": "http://127.0.0.1:8580/mcp"
}
}
}使用方法
启动你的 Java 服务,等待几秒钟,然后让 agent 来处理——或者你自己调用这些工具:
工具 | 用途 |
| 列出发现的服务及其在线状态——请先调用此工具 |
| 同步运行短 Arthas 命令( |
| 提交长时间运行的命令( |
| 轮询 |
| 停止正在运行的 trace/watch/monitor 任务 |
示例会话:
You: why is the order service slow?
Agent: (list_agents) → order-service is online on port 18501
(exec order-service "thread -n 3") → hottest threads
(async_exec order-service "trace *OrderService create") → submits trace
(pull_results …) → shows the slow call chain配置
优先级:命令行参数 > 环境变量 > ~/.config/arthas-mcp/config.json > 默认值。
来源 | 说明 |
|
|
| 将检测到的服务名映射为更友好的 agent id |
| HTTP 模式绑定地址 |
| 移动整个配置目录 |
|
|
| JVM 扫描间隔(默认 15000) |
常见问题
为什么不用官方的 arthas-mcp-server? 它们解决的是不同的问题:官方版是运行在进程内的 Java 模块,用于生产环境诊断;本项目是本地侧的包装器,可以发现并挂载到任何 JVM,而无需改动应用。两者可以共存。
它会修改我的应用吗? 它会把 Arthas agent 挂载到正在运行的 JVM 上(就像手动运行 arthas-boot 一样)——无需重启,无需改代码。停止该工具或运行 stop 即可解除挂载。
让 LLM 指向生产环境安全吗? 它赋予了 agent 与 Arthas 相同的能力(包括字节码级别的 watch)。请将其指向本地/开发环境的 JVM,并在生产环境中仅做只读判断。
许可证
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseBqualityCmaintenanceСonnects to live JVMs via JDWP protocol, enabling LLM agents to autonomously debug Java applications — attach to a running process, pause threads, set breakpoints (including conditional), inspect stacks with auto-resolved object fields, evaluate methods, set variable values, and diagnose issues like deadlocks and hung queries.281MIT
- AlicenseNot gradedqualityCmaintenanceJava diagnostics MCP server for LLM integration with Alibaba Arthas, enabling analysis and diagnosis of Java applications.56MIT

karellen-jdb-mcpofficial
AlicenseNot gradedqualityDmaintenanceEnables LLMs to debug Java applications using JDB, supporting breakpoints, stepping, expression evaluation, thread analysis, and more.3Apache 2.0- FlicenseNot gradedqualityAmaintenanceBridges agentic coding tools and live Java runtime behavior through a lightweight sidecar agent. Attaches directly to a running JVM to provide bytecode-level runtime signals for probe-verified inspection and deterministic debugging.2
Related MCP Connectors
Let AI operate servers without SSH. Choose actions, approve risky changes, and audit every step.
Live browser debugging for AI assistants — DOM, console, network via MCP.
Operate Linux, macOS and Windows from your LLM. Every action runs through an auditable allowlist.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/x0c/arthas-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server