Arthas MCP Server
This skill connects to a fixed Arthas MCP endpoint:
http://localhost:8563/mcp
Use it when the user wants Arthas-based JVM diagnostics, including:
- Java process and runtime inspection
- Thread blocking, CPU spikes, and deadlock triage
- Method tracing and call-path analysis
- Class, bytecode, and classloader inspection
- Exception-path observation
- Online troubleshooting with Arthas commands exposed as MCP tools
What To Load
- Start here for the workflow and command discipline.
- Read references/arthas-workflows.md when the task is about:
- high CPU, blocking, deadlock, request latency, or hotspots
- method entry/exit observation with
watch
- call stack or call path investigation with
stack or trace
- class decompilation / code inspection with
jad
- ongoing metrics with
monitor
Operating Rules
- Treat the endpoint as fixed. Do not ask the user to provide a host or port unless they explicitly ask to change the skill itself.
- Prefer low-risk diagnostics first. Start from broad observation before attaching high-cardinality tracing.
- If the user has not identified the application/process yet, use the Arthas MCP tools to discover the available JVM targets before deeper diagnostics.
- Explain performance risk before using commands that can add noticeable overhead, especially wide
trace, frequent watch, or long-running monitor.
- Keep probes narrow:
- target one class or method at a time
- add conditions where possible
- limit sample counts and duration when the tool supports it
- When the task is ambiguous, use this sequence:
- inspect available processes / sessions
- inspect runtime overview
- inspect threads or hotspots
- narrow to classes and methods
- trace or watch the smallest useful scope
Tool Discovery
List the available Arthas MCP tools:
cd $SKILL_DIR
python executor.py --list
Inspect one tool's schema:
cd $SKILL_DIR
python executor.py --describe TOOL_NAME
Call a tool:
cd $SKILL_DIR
python executor.py --call '{"tool":"TOOL_NAME","arguments":{"key":"value"}}'
Recommended Diagnostic Flow
1. Confirm target scope
- Find the available JVM / target-selection tools first.
- If multiple applications are present, select the target before deeper analysis.
2. Start broad
Prefer tools that map to Arthas commands such as:
dashboard
thread
sysprop
sysenv
jvm
Use these to determine whether the problem looks like CPU saturation, blocked threads, GC pressure, classloader issues, or slow business methods.
3. Narrow to code paths
For code-level diagnosis, look for tools that map to:
jad
sc
sm
trace
stack
watch
monitor
Recommended progression:
- Use
jad / sc / sm to identify the exact class and method.
- Use
stack when you need who-called-this visibility.
- Use
trace when you need per-invocation timing along a call path.
- Use
watch when you need parameters, return values, or thrown exceptions.
- Use
monitor when you need a lightweight rolling view over time.
4. Summarize carefully
- Separate facts from inference.
- Include the exact class, method, condition, and sampling scope used.
- Mention if the MCP endpoint itself failed, timed out, or did not expose the expected tool.
Failure Handling
If a call fails, first distinguish which layer failed:
- Skill/runtime issue:
python or mcp package problem
- MCP transport issue:
http://localhost:8563/mcp unreachable or returns protocol errors
- Arthas-side issue: target JVM not attached, command unsupported, or selection incomplete
- Input issue: wrong tool name or missing arguments
The current environment may expose the Arthas Console web UI on http://localhost:8563/ even if /mcp is not enabled. If --list or --describe fails with session or protocol errors, report that the fixed endpoint exists in skill config but the MCP route may not be active yet.
Response Style
- Keep operational summaries concise and evidence-based.
- For production-like troubleshooting, call out risky probes before using them.
- When possible, propose the next safest narrowing step instead of jumping straight to a broad trace.
1---2name: arthas-skills3description: Use this skill when diagnosing Java applications with Arthas through the arthas-mcp-server, including thread analysis, hot methods, exceptions, class inspection, method tracing, watch/stack/monitor workflows, or when the user asks to use Arthas or Arthas MCP. This skill connects to a fixed streamable HTTP MCP endpoint at http://localhost:8563/mcp.4---56# Arthas MCP Server78This skill connects to a fixed Arthas MCP endpoint:910- `http://localhost:8563/mcp`1112Use it when the user wants Arthas-based JVM diagnostics, including:1314- Java process and runtime inspection15- Thread blocking, CPU spikes, and deadlock triage16- Method tracing and call-path analysis17- Class, bytecode, and classloader inspection18- Exception-path observation19- Online troubleshooting with Arthas commands exposed as MCP tools2021## What To Load2223- Start here for the workflow and command discipline.24- Read [references/arthas-workflows.md](references/arthas-workflows.md) when the task is about:25 - high CPU, blocking, deadlock, request latency, or hotspots26 - method entry/exit observation with `watch`27 - call stack or call path investigation with `stack` or `trace`28 - class decompilation / code inspection with `jad`29 - ongoing metrics with `monitor`3031## Operating Rules3233- Treat the endpoint as fixed. Do not ask the user to provide a host or port unless they explicitly ask to change the skill itself.34- Prefer low-risk diagnostics first. Start from broad observation before attaching high-cardinality tracing.35- If the user has not identified the application/process yet, use the Arthas MCP tools to discover the available JVM targets before deeper diagnostics.36- Explain performance risk before using commands that can add noticeable overhead, especially wide `trace`, frequent `watch`, or long-running `monitor`.37- Keep probes narrow:38 - target one class or method at a time39 - add conditions where possible40 - limit sample counts and duration when the tool supports it41- When the task is ambiguous, use this sequence:42 1. inspect available processes / sessions43 2. inspect runtime overview44 3. inspect threads or hotspots45 4. narrow to classes and methods46 5. trace or watch the smallest useful scope4748## Tool Discovery4950List the available Arthas MCP tools:5152```bash53cd $SKILL_DIR54python executor.py --list55```5657Inspect one tool's schema:5859```bash60cd $SKILL_DIR61python executor.py --describe TOOL_NAME62```6364Call a tool:6566```bash67cd $SKILL_DIR68python executor.py --call '{"tool":"TOOL_NAME","arguments":{"key":"value"}}'69```7071## Recommended Diagnostic Flow7273### 1. Confirm target scope7475- Find the available JVM / target-selection tools first.76- If multiple applications are present, select the target before deeper analysis.7778### 2. Start broad7980Prefer tools that map to Arthas commands such as:8182- `dashboard`83- `thread`84- `sysprop`85- `sysenv`86- `jvm`8788Use these to determine whether the problem looks like CPU saturation, blocked threads, GC pressure, classloader issues, or slow business methods.8990### 3. Narrow to code paths9192For code-level diagnosis, look for tools that map to:9394- `jad`95- `sc`96- `sm`97- `trace`98- `stack`99- `watch`100- `monitor`101102Recommended progression:103104- Use `jad` / `sc` / `sm` to identify the exact class and method.105- Use `stack` when you need who-called-this visibility.106- Use `trace` when you need per-invocation timing along a call path.107- Use `watch` when you need parameters, return values, or thrown exceptions.108- Use `monitor` when you need a lightweight rolling view over time.109110### 4. Summarize carefully111112- Separate facts from inference.113- Include the exact class, method, condition, and sampling scope used.114- Mention if the MCP endpoint itself failed, timed out, or did not expose the expected tool.115116## Failure Handling117118If a call fails, first distinguish which layer failed:119120- Skill/runtime issue: `python` or `mcp` package problem121- MCP transport issue: `http://localhost:8563/mcp` unreachable or returns protocol errors122- Arthas-side issue: target JVM not attached, command unsupported, or selection incomplete123- Input issue: wrong tool name or missing arguments124125The current environment may expose the Arthas Console web UI on `http://localhost:8563/` even if `/mcp` is not enabled. If `--list` or `--describe` fails with session or protocol errors, report that the fixed endpoint exists in skill config but the MCP route may not be active yet.126127## Response Style128129- Keep operational summaries concise and evidence-based.130- For production-like troubleshooting, call out risky probes before using them.131- When possible, propose the next safest narrowing step instead of jumping straight to a broad trace.