This commit is contained in:
jokob-sk
2026-02-24 07:08:43 +11:00
6 changed files with 145 additions and 3 deletions

1
.env
View File

@@ -6,7 +6,6 @@ LOGS_LOCATION=/path/to/docker_logs
#ENVIRONMENT VARIABLES
TZ=Europe/Paris
PORT=20211
#DEVELOPMENT VARIABLES

48
front/llms.txt Normal file
View File

@@ -0,0 +1,48 @@
# For Humans
To set up MCP access for your AI Agent:
1. Tell it to "Please go here and set up MCP using HOST:BACKEND_PORT <link to this page>"
-or-
2. Copy and paste the contents of this page and let it know your HOST and API token.
---
# For AI Agents: NetAlertX MCP Setup
NetAlertX is a network monitoring system. Connect to its **MCP (Model Context Protocol) server** for live access to devices, scans, and events.
## 1. Gather Connection Details
Ask the user for the following if not provided:
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.
2. **MCP URL:** Typically `http://<HOST>:20212/mcp/sse`. (The UI is usually on port `20211`, and the MCP/GraphQL backend is on `20212`).
*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.*
## 2. Configure MCP Client
Use the gathered details to configure your MCP connection:
```json
{
"mcpServers": {
"netalertx": {
"url": "http://<HOST>:<GRAPHQL_PORT>/mcp/sse",
"headers": {
"Authorization": "Bearer <API_TOKEN>"
}
}
}
}
```
## 3. Capabilities
Once connected, you can:
- Query and manage devices (search, filter, MAC details, Wake-on-LAN).
- Trigger network scans (ARP, NMAP, Avahi).
- Manage events, sessions, and notifications.
## 4. Important Notes
- **UI Refresh:** When you modify data, tell the user to click the in-app refresh button (🔄) to see changes.
- **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.
- **Authentication:** The API token is distinct from the UI login password and must be obtained/changed in the frontend /settings.php

View File

@@ -24,11 +24,10 @@
<!-- NetAlertX footer with url -->
<a href="https://github.com/jokob-sk/NetAlertX" target="_blank">Net<b>Alert</b><sup>x</sup></a>
<!-- To the right -->
<div class="pull-right no-hidden-xs">
| <a href="https://gurubase.io/g/netalertx" class="pointer" target="_blank" title="Ask AI"><i class="fa fa-comment-dots fa-flip-horizontal"></i></a>
| <a href="/llms.txt" class="pointer" target="_blank" data-agent-role="mcp-setup" aria-label="Agentic MCP instructions" title="Agent MCP Instructions"><i class="fa fa-robot"></i></a>
| <a href="https://docs.netalertx.com/" class="pointer" target="_blank" title="Documentation"><i class="fa fa-book"></i></a>
| <a href="https://github.com/jokob-sk/NetAlertX/issues" class="pointer" target="_blank"><i class="fa fa-bug" title="Report a bug"></i></a>
| <a href="https://discord.com/invite/NczTUTWyRr" class="pointer" target="_blank"><i class="fa-brands fa-discord" title="Join Discord"></i></a>

8
install/docker/README.md Normal file
View File

@@ -0,0 +1,8 @@
# 🐳 Docker Compose Installation
For complete and up-to-date instructions on how to install NetAlertX using Docker, including volumes, networking, and environment variables, please refer to the official documentation:
👉 **[NetAlertX Docker Installation Guide](https://docs.netalertx.com/DOCKER_INSTALLATION/)**
---
[⬅️ Back to Main Repo](../../README.md)

View File

@@ -0,0 +1,44 @@
services:
netalertx:
network_mode: host # Use host networking for ARP scanning and other services
image: ghcr.io/netalertx/netalertx-dev:latest
container_name: netalertx
read_only: true
cap_drop:
- ALL
cap_add:
- NET_ADMIN
- NET_RAW
- NET_BIND_SERVICE
- CHOWN
- SETUID
- SETGID
volumes:
- type: volume
source: netalertx_data
target: /data
read_only: false
- type: bind
source: /etc/localtime
target: /etc/localtime
read_only: true
tmpfs:
- "/tmp:mode=1777,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
environment:
PUID: ${NETALERTX_UID:-20211}
PGID: ${NETALERTX_GID:-20211}
LISTEN_ADDR: ${LISTEN_ADDR:-0.0.0.0}
PORT: ${PORT:-20211}
GRAPHQL_PORT: ${GRAPHQL_PORT:-20212}
mem_limit: 2048m
mem_reservation: 1024m
cpu_shares: 512
pids_limit: 512
logging:
options:
max-size: "10m"
max-file: "3"
restart: unless-stopped
volumes:
netalertx_data:

View File

@@ -0,0 +1,44 @@
services:
netalertx:
network_mode: host # Use host networking for ARP scanning and other services
image: ghcr.io/netalertx/netalertx:latest
container_name: netalertx
read_only: true
cap_drop:
- ALL
cap_add:
- NET_ADMIN
- NET_RAW
- NET_BIND_SERVICE
- CHOWN
- SETUID
- SETGID
volumes:
- type: volume
source: netalertx_data
target: /data
read_only: false
- type: bind
source: /etc/localtime
target: /etc/localtime
read_only: true
tmpfs:
- "/tmp:mode=1777,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
environment:
PUID: ${NETALERTX_UID:-20211}
PGID: ${NETALERTX_GID:-20211}
LISTEN_ADDR: ${LISTEN_ADDR:-0.0.0.0}
PORT: ${PORT:-20211}
GRAPHQL_PORT: ${GRAPHQL_PORT:-20212}
mem_limit: 2048m
mem_reservation: 1024m
cpu_shares: 512
pids_limit: 512
logging:
options:
max-size: "10m"
max-file: "3"
restart: unless-stopped
volumes:
netalertx_data: