Skip to content

Commit 8847039

Browse files
committed
Added MCP support
1 parent 2bc8b10 commit 8847039

File tree

11 files changed

+1756
-24
lines changed

11 files changed

+1756
-24
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,14 @@
11
# Changelog
22

3+
## [0.2.0] - 2026-03-20
4+
5+
### Added
6+
- MCP server for AI-assisted thread dump analysis (Claude, Copilot, Cursor, etc.)
7+
- Five MCP tools: `analyze_thread_dump`, `detect_deadlocks`, `get_hot_methods`, `get_thread_summary`, `find_threads_by_method`
8+
- Stdio and HTTP transport modes with optional Bearer token authentication
9+
- `findThreadsByMethod()` core utility — search threads by method name with substring or regex matching, returns state breakdown and stack depth info
10+
- VS Code settings for MCP transport, port, and auth configuration
11+
312
## [0.1.1] - 2026-03-17
413

514
### Security

PRIVACY.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,15 @@ Fast Java Thread does **not** collect, transmit, or store any user data.
1010
- No data is sent to any remote server or third-party service.
1111
- The extension does not use telemetry, analytics, or crash reporting.
1212

13+
## MCP Server
14+
15+
The built-in MCP server runs locally on your machine. When using stdio transport (the default), communication stays within your local process. When using HTTP transport, the server listens only on `localhost` at the port you configure. Token authentication is available for HTTP mode but disabled by default.
16+
17+
Thread dump content is passed directly to the MCP tools in-memory — nothing is logged, cached, or written to disk by the server.
18+
1319
## Network Access
1420

15-
The only external network request is loading **Chart.js** from `cdn.jsdelivr.net` for rendering pie charts in the dashboard webview. No user data is included in this request.
21+
This extension makes no external network requests. Chart.js is bundled locally.
1622

1723
## File Access
1824

README.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ VS Code extension for analyzing JVM thread dumps (`.tdump` files).
1212
- **Dashboard** — Pie chart of thread states, top 10 hot methods, deadlock alerts
1313
- **Click-to-Navigate** — Click a thread in the tree to jump to its location in the dump file
1414
- **Deadlock Detection** — Automatic cycle detection in lock wait graphs
15+
- **Method Search** — Find all threads running a specific method, with state breakdown and lock info
16+
- **MCP Server** — Expose analysis tools to AI assistants (Claude, Copilot, Cursor) via the Model Context Protocol
1517
- **Java 8 & 11+ Support** — Parses both formats (with and without `cpu=`/`elapsed=` fields)
1618

1719
## Screenshots
@@ -32,6 +34,58 @@ VS Code extension for analyzing JVM thread dumps (`.tdump` files).
3234
| `Fast Java Thread: Analyze Thread Dump` | Parse the active .tdump file and populate the tree view |
3335
| `Fast Java Thread: Show Dashboard` | Open the webview dashboard with charts and deadlock alerts |
3436

37+
## MCP Server
38+
39+
The extension includes an MCP server that lets AI assistants analyze thread dumps directly. It works with any MCP-compatible client — Claude Code, Claude Desktop, GitHub Copilot Chat, Cursor, etc.
40+
41+
### Available tools
42+
43+
| Tool | What it does |
44+
|------|-------------|
45+
| `analyze_thread_dump` | Full analysis: thread states, hot methods, and deadlock detection |
46+
| `detect_deadlocks` | Focused deadlock cycle detection with lock chain details |
47+
| `get_hot_methods` | Most frequently occurring methods across all stack traces |
48+
| `get_thread_summary` | Quick overview: thread count, state breakdown, deadlock count |
49+
| `find_threads_by_method` | Find threads running a specific method, with state and lock info |
50+
51+
### Standalone (stdio)
52+
53+
Point your MCP client at the server:
54+
55+
```bash
56+
node out/src/mcp/server.js
57+
```
58+
59+
For Claude Code, add to your `.mcp.json`:
60+
61+
```json
62+
{
63+
"mcpServers": {
64+
"fast-java-thread": {
65+
"command": "node",
66+
"args": ["path/to/FastJavaThread/out/src/mcp/server.js"]
67+
}
68+
}
69+
}
70+
```
71+
72+
### HTTP mode
73+
74+
For network access (e.g. from a Tauri app), run with HTTP transport:
75+
76+
```bash
77+
node out/src/mcp/server.js --transport http --port 3100 --auth-token mytoken
78+
```
79+
80+
### VS Code settings
81+
82+
| Setting | Default | Description |
83+
|---------|---------|-------------|
84+
| `fastJavaThread.mcp.transport` | `stdio` | Transport mode: `stdio` or `http` |
85+
| `fastJavaThread.mcp.port` | `3100` | Port for HTTP transport |
86+
| `fastJavaThread.mcp.auth.enabled` | `false` | Enable Bearer token auth (HTTP only) |
87+
| `fastJavaThread.mcp.auth.token` | `""` | Bearer token value |
88+
3589
## Development
3690

3791
```bash

0 commit comments

Comments
 (0)