Skip to main content
Glama

言語: English | 简体中文

Alibaba Arthas を Claude Code、Cursor、Codex、その他の MCP 対応 AI アシスタントに橋渡しする MCP サーバーです。ローカル JVM を 15秒ごとにスキャンし、IDE/ビルドデーモンを除外して、Arthas を自動的にアタッチし、すぐ使える診断ツールを公開します。エージェントに 「注文サービスが遅いのはなぜ?」 と質問するだけで、実行中のプロセスに対して threadtracewatchognl を実行できます。

AI agent ──stdio/HTTP──> arthas-mcp ──auto-attach──> Arthas agent ──> your JVM
                             ▲
                    jps discovery every 15s

他のツールとの比較

arthas-mcp (this project)

Official arthas-mcp-server

Community wrappers

Setup

Zero config — just start it

Java module running inside the target JVM

Start Arthas WebConsole manually, then point a URL

Target discovery

Automatic (jps scan + blacklist)

None (it is the app)

Manual

Language

Node (no Java code to maintain)

Java

varies

Best for

Debugging any local service from your editor

In-process, production-hosted diagnostics

Quick one-offs

Related MCP server: Arthas MCP Server

特徴

  • ゼロ設定の検出jps でビジネス JVM を検出し、組み込みブラックリストで IntelliJ / Gradle / Maven / language-server のデーモンを除外します

  • 自動アタッチ&再アタッチ — 管理されたポートプールでプロセスごとに arthas-boot を起動し、エージェントが切断されたら再アタッチします

  • 同期+非同期のコマンド実行 — 短時間のコマンド(versionscsmognl)は直接返し、長時間実行のもの(tracewatchmonitor)は pull_results でストリーミングし、中断できます

  • stdio と HTTP モード — クライアントセッションごとに1インスタンス(stdio)、または共有の常駐サービス(--http)で /mcp + /healthz を提供

  • わかりやすい出力 — Arthas のジョブ結果を、LLM が直接読めるクリーンなテキストにまとめます

  • クロスプラットフォーム — macOS、Linux、Windows(OSごとのプロセス検査: /procps、PowerShell CIM)

対応プラットフォーム

Platform

Status

macOS

Linux

Windows

✅ (requires JDK jps/java on PATH)

必要条件: Node ≥ 18JDKjpsjava 用)、および Arthas~/.arthas/lib から自動検出されます(つまり、以前に arthas-boot を実行したことがあればすでにインストールされています)。または ARTHAS_BOOT_JARarthas-boot.jar を指定します。依存関係はすべて無料のオープンソースです。

インストール

インストールせずに実行(推奨)

npx -y github:x0c/arthas-mcp --version

グローバルインストール

npm install -g github:x0c/arthas-mcp
arthas-mcp --version

macOS、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-mcp

Cursor / mcpServers JSON ブロックを読み取る任意のクライアント:

{
  "mcpServers": {
    "arthas": {
      "command": "npx",
      "args": ["-y", "github:x0c/arthas-mcp"]
    }
  }
}

共有デーモンモード(全クライアントで1つのインスタンス):

{
  "mcpServers": {
    "arthas": {
      "command": "npx",
      "args": ["-y", "github:x0c/arthas-mcp", "--http"],
      "url": "http://127.0.0.1:8580/mcp"
    }
  }
}

使い方

Java サービスを起動し、数秒待ってからエージェントに質問するか、自分でツールを呼び出します:

Tool

Purpose

list_agents

検出したサービスとそのオンライン状態を一覧表示 — 最初に呼び出してください

exec

短時間の Arthas コマンドを同期的に実行(versionscsmognl …)

async_exec

長時間実行のコマンド(tracewatchmonitor)を送信し、sessionId / consumerId を返す

pull_results

async_exec の結果をポーリング

interrupt_job

実行中の 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

設定

優先順位: CLI 引数 > 環境変数 > ~/.config/arthas-mcp/config.json > デフォルト。

Source

What

config.json

hostportscanIntervalattachTimeoutrequestTimeoutportMin/portMaxstripPrefixes(導出されたサービス ID から除去されるプレフィックスのリスト)

aliases.json

検出されたサービス名を、より親しみやすいエージェント ID にマップする

ARTHAS_MCP_PORT / ARTHAS_MCP_HOST

HTTP モードのバインドアドレス

ARTHAS_MCP_CONFIG_DIR

設定ディレクトリ全体を移動

ARTHAS_BOOT_JAR

arthas-boot.jar の明示的なパス

--scan-interval <ms>

JVM スキャン間隔(デフォルト 15000)

FAQ

公式の arthas-mcp-server ではなく、なぜこれを使うのか? これらは異なる問題を解決します。公式版は本番ホストでの診断用のインプロセス Java モジュールであり、このプロジェクトはアプリに触れずに 任意の JVM を検出してアタッチするローカルサイドのラッパーです。両者は共存できます。

アプリケーションを変更しますか? 実行中の JVM に Arthas エージェントをアタッチするだけです(手動で arthas-boot を実行するのと同じ)。再起動もコード変更もありません。ツールを停止するか stop を実行するとデタッチします。

本番環境に LLM を向けても安全ですか? エージェントに Arthas と同じ能力(バイトコードレベルの watch を含む)を与えます。ローカル/開発 JVM に向けて、本番では読み取り専用の判断を使用してください。

ライセンス

MIT

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
1Releases (12mo)
Commit activity

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

  • A
    license
    B
    quality
    C
    maintenance
    С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.
    28
    1
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables LLMs to debug Java applications using JDB, supporting breakpoints, stepping, expression evaluation, thread analysis, and more.
    3
    Apache 2.0
  • F
    license
    Not graded
    quality
    A
    maintenance
    Bridges 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

View all related MCP servers

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.

View all MCP Connectors

Latest Blog Posts

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