/ Каталог / Песочница / tda
● Сообщество irockel ⚡ Сразу

tda

автор irockel · irockel/tda

Give Claude the power to read Java thread dumps — deadlocks, long-running threads, virtual-thread pinning, native-method blockers.

TDA (Thread Dump Analyzer) ships both a GUI and an MCP mode. In headless JAR mode, it exposes 6+ tools for parsing dump logs, summarizing state, detecting deadlocks, locating long-running threads, and analyzing virtual-thread carrier pinning.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

tda.replay ▶ готово
0/0

Установка

Выберите клиент

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "tda": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/irockel/tda"
      ],
      "_inferred": true
    }
  }
}

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "tda": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/irockel/tda"
      ],
      "_inferred": true
    }
  }
}

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "tda": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/irockel/tda"
      ],
      "_inferred": true
    }
  }
}

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "tda": {
      "command": "TODO",
      "args": [
        "See README: https://github.com/irockel/tda"
      ],
      "_inferred": true
    }
  }
}

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "tda",
      "command": "TODO",
      "args": [
        "See README: https://github.com/irockel/tda"
      ]
    }
  ]
}

Continue использует массив объектов серверов, а не map.

~/.config/zed/settings.json
{
  "context_servers": {
    "tda": {
      "command": {
        "path": "TODO",
        "args": [
          "See README: https://github.com/irockel/tda"
        ]
      }
    }
  }
}

Добавьте в context_servers. Zed перезагружается автоматически.

claude mcp add tda -- TODO 'See README: https://github.com/irockel/tda'

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: tda

Diagnose a JVM hang from thread dumps with TDA

👤 Java backend engineers ⏱ ~20 min advanced

Когда использовать: Production JVM went unresponsive; you have a series of kill -3 dumps.

Предварительные требования
  • tda.jar downloaded — github.com/irockel/tda releases
  • Java 21+ installed — For Project Loom analysis features
Поток
  1. Parse the log
    parse_log on /tmp/threaddumps.log. Summarize: how many dumps, threads per dump.✓ Скопировано
    → Dump overview
  2. Check for deadlocks
    check_deadlocks across all dumps. Which threads, which locks?✓ Скопировано
    → Deadlock cycles if any
  3. Find long-running threads
    find_long_running threads persisting across all dumps. What are they doing?✓ Скопировано
    → List with stack heads

Итог: A specific thread + lock + code path responsible for the hang.

Подводные камни
  • Scripts printing to stdout corrupt the JSON-RPC stream — Use java -Djava.awt.headless=true -jar tda.jar --mcp without wrapping in any script that also prints

Hunt virtual-thread carrier pinning in a Loom app

👤 Teams adopting Project Loom ⏱ ~30 min advanced

Когда использовать: Virtual threads aren't giving the concurrency you expected — suspect pinning.

Поток
  1. Capture dumps during load
    Collect thread dumps at peak load; parse_log them in TDA.✓ Скопировано
    → Dumps loaded
  2. Analyze
    analyze_virtual_threads. Show carrier pinning hotspots and the Java code pinning them (typically synchronized blocks or native methods).✓ Скопировано
    → Pinning list with source hints

Итог: Targeted fixes (ReentrantLock instead of synchronized, etc.) backed by evidence.

Identify threads stuck in native methods

👤 Performance engineers on JNI-heavy apps ⏱ ~15 min advanced

Когда использовать: Your app integrates with native libs and you suspect blocking native calls.

Поток
  1. List native-blocked threads
    get_native_threads for dump #3. Which native methods are they stuck in?✓ Скопировано
    → Thread + native frame list

Итог: Targeted review of specific JNI call sites.

Комбинации

Сочетайте с другими MCP — эффект x10

Correlate thread-level findings with JVM metrics

TDA says lock X is contended — show JVM thread_blocked_seconds for the same window from Prometheus.✓ Скопировано
tda + github

Turn findings into issues with code pointers

For the top 3 TDA findings, open a GitHub issue linking the suspect Java source lines.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
parse_log path: str First step, always local CPU
get_summary Overview before digging 0
check_deadlocks Hang diagnosis 0
find_long_running min_dumps?: int Persistent threads 0
analyze_virtual_threads Loom diagnostics 0
get_native_threads dump_index?: int JNI suspicion 0
get_zombie_threads Unresolved memory relocations 0
clear Reset before parsing a new log 0

Стоимость и лимиты

Во что обходится

Квота API
None
Токенов на вызов
Thread dumps are huge — 20k+ tokens per full dump. Summarize before dumping to chat
Деньги
Free
Совет
Use get_summary/find_long_running narrowing before asking for full stacks

Безопасность

Права, секреты, радиус поражения

Хранение учётных данных: None
Исходящий трафик: None — entirely local file parsing

Устранение неполадок

Частые ошибки и исправления

MCP handshake corrupts

Run JAR exactly per README (headless + --mcp, no wrapper scripts printing to stdout)

parse_log fails on custom dump formats

Ensure dumps are standard HotSpot format; some APMs add prefixes TDA can't parse

Memory blows up on huge logs

Increase JVM heap for tda.jar: -Xmx4g or split the log into chunks

Альтернативы

tda в сравнении

АльтернативаКогда использоватьКомпромисс
FastThread / other online analyzersYou're okay uploading dumps to a third partyData leaves your network
async-profiler + flame graphsYou have live control and want sampling profiler not dumpsDifferent artifact; needs agent attach

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills