|
| 1 | +# For Humans |
| 2 | +To set up MCP access for your AI Agent: |
| 3 | + |
| 4 | +1. Tell it to "Please go here and set up MCP using HOST:BACKEND_PORT <link to this page>" |
| 5 | +-or- |
| 6 | +2. Copy and paste the contents of this page and let it know your HOST and API token. |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | +--- |
| 11 | + |
| 12 | +# For AI Agents: NetAlertX MCP Setup |
| 13 | + |
| 14 | +NetAlertX is a network monitoring system. Connect to its **MCP (Model Context Protocol) server** for live access to devices, scans, and events. |
| 15 | + |
| 16 | +## 1. Gather Connection Details |
| 17 | +Ask the user for the following if not provided: |
| 18 | +1. **API Token:** Found in **`/settings.php`** under **System / API**. If you were directed to this server, try to browse to /settings.php on your own. |
| 19 | +2. **MCP URL:** Typically `http://<HOST>:20212/mcp/sse`. (The UI is usually on port `20211`, and the MCP/GraphQL backend is on `20212`). |
| 20 | + |
| 21 | +*Note: Test HTTP connectivity. If port `20212` fails, ask the user if the `GRAPHQL_PORT` was changed in settings or if a reverse proxy is used.* |
| 22 | + |
| 23 | +## 2. Configure MCP Client |
| 24 | +Use the gathered details to configure your MCP connection: |
| 25 | + |
| 26 | +```json |
| 27 | +{ |
| 28 | + "mcpServers": { |
| 29 | + "netalertx": { |
| 30 | + "url": "http://<HOST>:<GRAPHQL_PORT>/mcp/sse", |
| 31 | + "headers": { |
| 32 | + "Authorization": "Bearer <API_TOKEN>" |
| 33 | + } |
| 34 | + } |
| 35 | + } |
| 36 | +} |
| 37 | +``` |
| 38 | + |
| 39 | +## 3. Capabilities |
| 40 | +Once connected, you can: |
| 41 | +- Query and manage devices (search, filter, MAC details, Wake-on-LAN). |
| 42 | +- Trigger network scans (ARP, NMAP, Avahi). |
| 43 | +- Manage events, sessions, and notifications. |
| 44 | + |
| 45 | +## 4. Important Notes |
| 46 | +- **UI Refresh:** When you modify data, tell the user to click the in-app refresh button (🔄) to see changes. |
| 47 | +- **REST API Fallback:** If MCP is unavailable, retrieve the OpenAPI spec from `http://<HOST>:<GRAPHQL_PORT>/openapi.json` to discover available endpoints, then call those endpoints with `Authorization: Bearer <API_TOKEN>`. This approach is context-heavy and manual, so use it as a last resort. |
| 48 | +- **Authentication:** The API token is distinct from the UI login password and must be obtained/changed in the frontend /settings.php |
0 commit comments