Skip to main content
Glama
README.md
# ntop-ai-helper-mcp

MCP server that helps troubleshoot nTop issues with:

- AI diagnosis (`diagnose_ntop_error`)
- 20-agent parallel swarm mode (`swarm_diagnose_ntop`)
- Screen capture (`capture_screen`)
- Macro automation (`save_macro`, `list_macros`, `run_macro`)
- Optional direct terminal execution (`run_terminal_command`)

## Quick Start

```powershell
cd "$HOME\Documents\ntop-ai-helper-mcp"
npm install
npm run build
```

Run directly:

```powershell
npm start
```

Run in dev mode:

```powershell
npm run dev
```

## Environment Variables

Copy `.env.example` to `.env` and set values:

- `OPENAI_API_KEY` (required for real AI diagnosis/swarm)
- `OPENAI_MODEL` (default: `gpt-5.2`)
- `ENABLE_COMMAND_TOOL` (`false` by default; set to `true` to allow shell command tool)

## MCP Client Config Example

Use the built server file as the MCP command target:

```json
{
  "mcpServers": {
    "ntop-ai-helper": {
      "command": "node",
      "args": [
        "C:\\Users\\sohum\\Documents\\ntop-ai-helper-mcp\\dist\\server.js"
      ],
      "env": {
        "OPENAI_API_KEY": "YOUR_KEY_HERE",
        "OPENAI_MODEL": "gpt-5.2",
        "ENABLE_COMMAND_TOOL": "false"
      }
    }
  }
}
```

## Tools

- `capture_screen`
  - Inputs: `label?`
  - Output: file path to PNG in `captures/`

- `list_macros`
  - Inputs: none
  - Output: all macros from `data/macros.json`

- `save_macro`
  - Inputs: `name`, `description?`, `steps[]`
  - Step types:
    - `sleep`: `{ "type": "sleep", "ms": 500 }`
    - `sendKeys`: `{ "type": "sendKeys", "keys": "^l" }`
    - `command`: `{ "type": "command", "command": "dir" }`

- `run_macro`
  - Inputs: `name`, `dryRun?`
  - Executes macro step-by-step and returns a run report

- `diagnose_ntop_error`
  - Inputs: `errorText`, `context?`, `goal?`
  - Uses OpenAI if available; otherwise local fallback heuristics

- `swarm_diagnose_ntop`
  - Inputs: `errorText`, `context?`, `goal?`, `agentCount?`
  - Runs up to 40 agents in parallel (default 20), plus final synthesis

- `run_terminal_command`
  - Inputs: `command`, `cwd?`, `timeoutMs?`
  - Disabled by default for safety

## Notes

- Screen capture and `sendKeys` are Windows-oriented.
- Macro steps are intentionally explicit for predictable automation.
- If you want stricter safety, keep `ENABLE_COMMAND_TOOL=false`.

TDQS

A3.5/5.0

Scored across 7 tools

Disambiguation4/5

Most tools have clearly distinct purposes (screen capture, macro management, terminal command). The only overlap is between diagnose_ntop_error and swarm_diagnose_ntop, both for diagnosing nTop errors, but their descriptions clarify different approaches (single vs. multi-agent).

Naming Consistency4/5

Tool names generally follow a verb_noun pattern (capture_screen, list_macros, save_macro, run_macro, diagnose_ntop_error). The name swarm_diagnose_ntop deviates by using a noun prefix, and run_terminal_command also fits the pattern, but overall the convention is consistent.

Tool Count5/5

With 7 tools, the set is well-scoped for an nTop automation and diagnostics helper. Each tool serves a distinct need without redundancy or bloat, fitting comfortably in the ideal 3-15 range.

Completeness4/5

Macro lifecycle is well covered (list, save/update, run), and diagnosis has two options. Minor gaps exist, such as no delete macro or ability to stop a running macro, but the core workflows for automation and error handling are present.

Maintenance

ActivityInactive
ResponsivenessSyncing