Skip to content

Commit a309f99

Browse files
committed
2 parents 54e9d52 + 123f715 commit a309f99

6 files changed

Lines changed: 145 additions & 3 deletions

File tree

.env

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ LOGS_LOCATION=/path/to/docker_logs
66

77
#ENVIRONMENT VARIABLES
88

9-
TZ=Europe/Paris
109
PORT=20211
1110

1211
#DEVELOPMENT VARIABLES

front/llms.txt

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
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

front/php/templates/footer.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,10 @@
2424

2525
<!-- NetAlertX footer with url -->
2626
<a href="https://github.com/jokob-sk/NetAlertX" target="_blank">Net<b>Alert</b><sup>x</sup></a>
27-
28-
2927
<!-- To the right -->
3028
<div class="pull-right no-hidden-xs">
3129
| <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>
30+
| <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>
3231
| <a href="https://docs.netalertx.com/" class="pointer" target="_blank" title="Documentation"><i class="fa fa-book"></i></a>
3332
| <a href="https://github.com/jokob-sk/NetAlertX/issues" class="pointer" target="_blank"><i class="fa fa-bug" title="Report a bug"></i></a>
3433
| <a href="https://discord.com/invite/NczTUTWyRr" class="pointer" target="_blank"><i class="fa-brands fa-discord" title="Join Discord"></i></a>

install/docker/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 🐳 Docker Compose Installation
2+
3+
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:
4+
5+
👉 **[NetAlertX Docker Installation Guide](https://docs.netalertx.com/DOCKER_INSTALLATION/)**
6+
7+
---
8+
[⬅️ Back to Main Repo](../../README.md)
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
services:
2+
netalertx:
3+
network_mode: host # Use host networking for ARP scanning and other services
4+
image: ghcr.io/netalertx/netalertx-dev:latest
5+
container_name: netalertx
6+
read_only: true
7+
cap_drop:
8+
- ALL
9+
cap_add:
10+
- NET_ADMIN
11+
- NET_RAW
12+
- NET_BIND_SERVICE
13+
- CHOWN
14+
- SETUID
15+
- SETGID
16+
volumes:
17+
- type: volume
18+
source: netalertx_data
19+
target: /data
20+
read_only: false
21+
- type: bind
22+
source: /etc/localtime
23+
target: /etc/localtime
24+
read_only: true
25+
tmpfs:
26+
- "/tmp:mode=1777,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
27+
environment:
28+
PUID: ${NETALERTX_UID:-20211}
29+
PGID: ${NETALERTX_GID:-20211}
30+
LISTEN_ADDR: ${LISTEN_ADDR:-0.0.0.0}
31+
PORT: ${PORT:-20211}
32+
GRAPHQL_PORT: ${GRAPHQL_PORT:-20212}
33+
mem_limit: 2048m
34+
mem_reservation: 1024m
35+
cpu_shares: 512
36+
pids_limit: 512
37+
logging:
38+
options:
39+
max-size: "10m"
40+
max-file: "3"
41+
restart: unless-stopped
42+
43+
volumes:
44+
netalertx_data:

install/docker/docker-compose.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
services:
2+
netalertx:
3+
network_mode: host # Use host networking for ARP scanning and other services
4+
image: ghcr.io/netalertx/netalertx:latest
5+
container_name: netalertx
6+
read_only: true
7+
cap_drop:
8+
- ALL
9+
cap_add:
10+
- NET_ADMIN
11+
- NET_RAW
12+
- NET_BIND_SERVICE
13+
- CHOWN
14+
- SETUID
15+
- SETGID
16+
volumes:
17+
- type: volume
18+
source: netalertx_data
19+
target: /data
20+
read_only: false
21+
- type: bind
22+
source: /etc/localtime
23+
target: /etc/localtime
24+
read_only: true
25+
tmpfs:
26+
- "/tmp:mode=1777,rw,noexec,nosuid,nodev,async,noatime,nodiratime"
27+
environment:
28+
PUID: ${NETALERTX_UID:-20211}
29+
PGID: ${NETALERTX_GID:-20211}
30+
LISTEN_ADDR: ${LISTEN_ADDR:-0.0.0.0}
31+
PORT: ${PORT:-20211}
32+
GRAPHQL_PORT: ${GRAPHQL_PORT:-20212}
33+
mem_limit: 2048m
34+
mem_reservation: 1024m
35+
cpu_shares: 512
36+
pids_limit: 512
37+
logging:
38+
options:
39+
max-size: "10m"
40+
max-file: "3"
41+
restart: unless-stopped
42+
43+
volumes:
44+
netalertx_data:

0 commit comments

Comments
 (0)