javaperf 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,9 @@
1
- name: Publish to npm
1
+ name: Publish to npm and MCP Registry
2
2
 
3
3
  on:
4
4
  push:
5
5
  branches: [main]
6
- paths: ["package.json"]
6
+ paths: ["package.json", "server.json"]
7
7
  workflow_dispatch:
8
8
 
9
9
  jobs:
@@ -11,7 +11,7 @@ jobs:
11
11
  runs-on: ubuntu-latest
12
12
  permissions:
13
13
  contents: read
14
- id-token: write # Required for npm provenance
14
+ id-token: write # Required for npm provenance and MCP Registry OIDC
15
15
  steps:
16
16
  - uses: actions/checkout@v4
17
17
 
@@ -25,6 +25,19 @@ jobs:
25
25
  - run: npm run build
26
26
  - run: npm run lint
27
27
 
28
- - run: npm publish --provenance
28
+ - name: Publish to npm
29
+ id: npm
30
+ run: npm publish --provenance
29
31
  env:
30
32
  NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
33
+ continue-on-error: true
34
+
35
+ - name: Install mcp-publisher
36
+ run: |
37
+ curl -sL "https://github.com/modelcontextprotocol/registry/releases/latest/download/mcp-publisher_$(uname -s | tr '[:upper:]' '[:lower:]')_$(uname -m | sed 's/x86_64/amd64/;s/aarch64/arm64/').tar.gz" | tar xz mcp-publisher
38
+
39
+ - name: Authenticate to MCP Registry
40
+ run: ./mcp-publisher login github-oidc
41
+
42
+ - name: Publish to MCP Registry
43
+ run: ./mcp-publisher publish
package/AGENTS.md ADDED
@@ -0,0 +1,36 @@
1
+ # AGENTS.md
2
+
3
+ ## Cursor Cloud specific instructions
4
+
5
+ ### Overview
6
+
7
+ This is `javaperf` — a stdio-based MCP (Model Context Protocol) server for profiling Java applications via JDK utilities (`jcmd`, `jfr`, `jps`). It is a single-package TypeScript project (not a monorepo).
8
+
9
+ ### Development commands
10
+
11
+ See `package.json` scripts. Key commands:
12
+
13
+ - **Lint:** `npm run lint` (ESLint on `src/`)
14
+ - **Build:** `npm run build` (TypeScript compiler → `dist/`)
15
+ - **Dev mode:** `npm run dev` (runs via `tsx`)
16
+ - **Production:** `npm start` (runs built `dist/index.js`)
17
+ - **MCP Inspector:** `npm run inspector` (interactive debugging UI)
18
+
19
+ ### Testing the MCP server
20
+
21
+ The server uses stdio transport (no HTTP port). To test it, pipe JSON-RPC messages via stdin:
22
+
23
+ ```bash
24
+ printf '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"test","version":"1.0.0"}}}\n{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}\n' | node dist/index.js
25
+ ```
26
+
27
+ There are no automated tests in this codebase. The CI pipeline only runs `lint` and `build`.
28
+
29
+ ### Runtime dependency
30
+
31
+ JDK 8u262+ or 11+ must be installed for the profiling tools (`jps`, `jcmd`, `jfr`) to work at runtime. JDK is auto-detected via `JAVA_HOME` or `PATH`. The Cloud VM has OpenJDK 21 pre-installed at `/usr/bin/java`.
32
+
33
+ ### Gotchas
34
+
35
+ - `npm run dev` blocks on stdin (it's a stdio server) — use piped input or `timeout` for non-interactive testing.
36
+ - The `recordings/` directory is created at runtime by the server when profiling; it does not exist in the repo.
package/README.md CHANGED
@@ -9,6 +9,27 @@ Enables AI assistants to diagnose performance, analyze threads, and inspect JFR
9
9
  📦 **Install**: `npm install -g javaperf` or use via npx
10
10
  🌐 **npm**: https://www.npmjs.com/package/javaperf
11
11
 
12
+ ## How to connect to Claude Desktop / IDE
13
+
14
+ Add the server to your MCP config. Example for **claude_desktop_config.json**:
15
+
16
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
17
+ **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
18
+ **Linux:** `~/.config/Claude/claude_desktop_config.json`
19
+
20
+ ```json
21
+ {
22
+ "mcpServers": {
23
+ "javaperf": {
24
+ "command": "npx",
25
+ "args": ["-y", "javaperf"]
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ For **Cursor IDE**: Settings → Features → Model Context Protocol → Edit Config, then add the same block inside `mcpServers`. See the [Integration](#integration) section for more options (local dev, custom `JAVA_HOME`, etc.).
32
+
12
33
  ## Requirements
13
34
 
14
35
  - **Node.js** v18+
package/README_RU.md CHANGED
@@ -9,6 +9,27 @@
9
9
  📦 **Установка**: `npm install -g javaperf` или через npx
10
10
  🌐 **npm**: https://www.npmjs.com/package/javaperf
11
11
 
12
+ ## Как подключить к Claude Desktop / IDE
13
+
14
+ Добавьте сервер в конфиг MCP. Пример для **claude_desktop_config.json**:
15
+
16
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
17
+ **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
18
+ **Linux:** `~/.config/Claude/claude_desktop_config.json`
19
+
20
+ ```json
21
+ {
22
+ "mcpServers": {
23
+ "javaperf": {
24
+ "command": "npx",
25
+ "args": ["-y", "javaperf"]
26
+ }
27
+ }
28
+ }
29
+ ```
30
+
31
+ Для **Cursor IDE**: Settings → Features → Model Context Protocol → Edit Config, затем добавьте тот же блок в `mcpServers`. Подробнее в разделе [Интеграция](#интеграция).
32
+
12
33
  ## Требования
13
34
 
14
35
  - **Node.js** v18+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "javaperf",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/theSharque/mcp-jperf.git"
@@ -31,5 +31,12 @@
31
31
  "tsx": "^4.0.0",
32
32
  "typescript": "^5.0.0",
33
33
  "typescript-eslint": "^8.56.1"
34
- }
35
- }
34
+ },
35
+ "mcpName": "io.github.theSharque/javaperf",
36
+ "keywords": [
37
+ "mcp",
38
+ "java",
39
+ "performance",
40
+ "profiling"
41
+ ]
42
+ }
package/server.json ADDED
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
3
+ "name": "io.github.theSharque/javaperf",
4
+ "description": "Java profiling MCP via jcmd/jfr/jps. Diagnose performance, analyze threads, inspect JFR recordings.",
5
+ "title": "javaperf",
6
+ "repository": {
7
+ "url": "https://github.com/theSharque/mcp-jperf",
8
+ "source": "github"
9
+ },
10
+ "version": "1.0.4",
11
+ "packages": [
12
+ {
13
+ "registryType": "npm",
14
+ "identifier": "javaperf",
15
+ "version": "1.0.4",
16
+ "transport": {
17
+ "type": "stdio"
18
+ }
19
+ }
20
+ ]
21
+ }