@solomonneas/adguard-mcp 0.3.1 → 0.4.0
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.
- package/README.md +232 -30
- package/dist/cli.js +2496 -681
- package/dist/index.js +1555 -489
- package/dist/mcp-bin.js +2936 -745
- package/dist/mcp-server.js +2904 -724
- package/openclaw.plugin.json +1 -1
- package/package.json +26 -10
package/README.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
<img src="docs/assets/adguardctrl-social-preview.jpg" alt="adguardctrl banner" width="900">
|
|
4
4
|
</p>
|
|
5
5
|
|
|
6
|
+
<p align="center">
|
|
7
|
+
<a href="https://lidless.dev"><img src="docs/assets/marks/adguardctrl-circle.png" width="48" alt="Lidless Labs"></a>
|
|
8
|
+
</p>
|
|
9
|
+
|
|
6
10
|
<h1 align="center">adguardctrl</h1>
|
|
7
11
|
|
|
8
12
|
<p align="center">
|
|
@@ -25,7 +29,7 @@
|
|
|
25
29
|
|
|
26
30
|
## What it does
|
|
27
31
|
|
|
28
|
-
`adguardctrl` speaks the AdGuard Home API across one or more instances, plus optional AdGuardHome Sync status and control. The direct CLI is read-only today, covering server status, stats, the DNS query log, filter lists, named clients, DNS rewrites, DNS and TLS config, DHCP status, and a `check-host` lookup that shows exactly what AdGuard would do with a hostname.
|
|
32
|
+
`adguardctrl` speaks the AdGuard Home API across one or more instances, plus optional AdGuardHome Sync status and control. The direct CLI is read-only today, covering server status, stats, the DNS query log, filter lists, SafeBrowsing and parental filtering status, named clients, DNS rewrites, DNS and TLS config, DHCP status, and a `check-host` lookup that shows exactly what AdGuard would do with a hostname.
|
|
29
33
|
|
|
30
34
|
For assistant clients, `adguardctrl mcp` starts the stdio MCP adapter used by Claude Desktop, Claude Code, Codex CLI, OpenClaw, Hermes, and other Model Context Protocol clients. That adapter keeps the original `adguard-mcp` tool surface and safety model: reads are open, writes require an explicit `confirm: true`, and destructive operations additionally require `destructive: true`, so an agent cannot disable filtering or wipe rules on a hallucinated call.
|
|
31
35
|
|
|
@@ -65,50 +69,70 @@ Once connected, ask your client to call `adguard_status` to confirm it can reach
|
|
|
65
69
|
|
|
66
70
|
## Tools
|
|
67
71
|
|
|
68
|
-
**Reads (
|
|
72
|
+
**Reads (24):** `adguard_status`, `adguard_stats`, `adguard_query_log`, `adguard_list_filter_lists`, `adguard_get_filtering_toggles`, `adguard_list_user_rules`, `adguard_list_clients`, `adguard_find_clients`, `adguard_list_blocked_services_catalog`, `adguard_check_host`, `adguard_get_blocked_services`, `adguard_get_dns_config`, `adguard_get_safesearch_settings`, `adguard_list_rewrites`, `adguard_get_rewrite_settings`, `adguard_get_access_list`, `adguard_get_querylog_config`, `adguard_get_stats_config`, `adguard_dhcp_status`, `adguard_dhcp_interfaces`, `adguard_tls_status`, `adguard_sync_status`, `adguard_sync_health`, `adguard_sync_logs`.
|
|
69
73
|
|
|
70
74
|
| Tool | Description |
|
|
71
75
|
|---|---|
|
|
72
|
-
| `adguard_status` | Server
|
|
73
|
-
| `adguard_stats` |
|
|
74
|
-
| `adguard_query_log` | DNS
|
|
75
|
-
| `adguard_list_filter_lists` | Subscribed
|
|
76
|
+
| `adguard_status` | Server version, protection state, DNS port, and running state (`GET /control/status`). |
|
|
77
|
+
| `adguard_stats` | 24-hour DNS totals, blocked percentage, top blocked domains, and top clients (`GET /control/stats`). |
|
|
78
|
+
| `adguard_query_log` | Recent DNS queries with client, domain, blocked-only, or response-reason filters (`GET /control/querylog`). Pass `next_older_than` from a full page as `older_than` on the next call with the same filters. The upstream `oldest` field is preserved. `next_older_than` is `null` when there is no usable cursor. Combined client and domain filters search by client on the server and filter domains locally, including IDN forms, with up to 500 entries fetched. This mode reports when the full fetch batch is returned and does not support pagination. |
|
|
79
|
+
| `adguard_list_filter_lists` | Subscribed filter lists with enabled state and rule counts (`GET /control/filtering/status`). |
|
|
80
|
+
| `adguard_get_filtering_toggles` | Global SafeBrowsing and parental filtering states (`GET /control/safebrowsing/status` and `GET /control/parental/status`). Missing or invalid states return `{ "enabled": false, "unknown": true }` for the affected feature. |
|
|
76
81
|
| `adguard_list_user_rules` | Custom user rules (`GET /control/filtering/status`). |
|
|
77
|
-
| `adguard_list_clients` | Configured
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
82
|
+
| `adguard_list_clients` | Configured clients with per-client blocked services and tags (`GET /control/clients`). |
|
|
83
|
+
| `adguard_find_clients` | Exact lookup of client information by IP address, CIDR, MAC address, or ClientID. Pass 1 to 50 identifiers in `ids`. The read-only `POST /control/clients/search` returns entries keyed by identifier. A valid unknown IP can return an entry without a client name. |
|
|
84
|
+
| `adguard_list_blocked_services_catalog` | Services available for per-client blocking (`GET /control/blocked_services/all`). |
|
|
85
|
+
| `adguard_check_host` | Filter decision, matched rules, CNAME chain, and IPs for a hostname (`GET /control/filtering/check_host`). |
|
|
86
|
+
| `adguard_get_blocked_services` | Global blocked-services list and weekly schedule (`GET /control/blocked_services/get`). |
|
|
87
|
+
| `adguard_get_dns_config` | DNS upstreams, bootstrap, cache, parallel resolution, and blocking mode (`GET /control/dns_info`). |
|
|
88
|
+
| `adguard_get_safesearch_settings` | SafeSearch enabled state and per-engine flags (`GET /control/safesearch/status`). |
|
|
89
|
+
| `adguard_list_rewrites` | DNS rewrite rules (`GET /control/rewrite/list`). |
|
|
90
|
+
| `adguard_get_rewrite_settings` | DNS rewrite enabled state (`GET /control/rewrite/settings`). |
|
|
91
|
+
| `adguard_get_access_list` | Allowed clients, disallowed clients, and blocked hosts (`GET /control/access/list`). |
|
|
92
|
+
| `adguard_get_querylog_config` | Query log settings (`GET /control/querylog/config`). |
|
|
93
|
+
| `adguard_get_stats_config` | Statistics settings (`GET /control/stats/config`). |
|
|
94
|
+
| `adguard_dhcp_status` | DHCP server settings, leases, and status (`GET /control/dhcp/status`). |
|
|
95
|
+
| `adguard_dhcp_interfaces` | Network interfaces available to the DHCP server (`GET /control/dhcp/interfaces`). |
|
|
96
|
+
| `adguard_tls_status` | TLS configuration and validation status, with private keys redacted (`GET /control/tls/status`). |
|
|
97
|
+
| `adguard_sync_status` | AdGuardHome Sync origin and replica status (`GET /api/v1/status`). |
|
|
98
|
+
| `adguard_sync_health` | Sync health, returning success only when origin and replicas are healthy (`HEAD /healthz`). |
|
|
85
99
|
| `adguard_sync_logs` | AdGuardHome Sync in-memory logs (`GET /api/v1/logs`). |
|
|
86
100
|
|
|
87
|
-
**Safe writes (
|
|
101
|
+
**Safe writes (23, require `confirm: true`):** `adguard_add_user_rule`, `adguard_remove_user_rule`, `adguard_add_filter_list`, `adguard_remove_filter_list`, `adguard_toggle_filter_list`, `adguard_set_client_blocked_services`, `adguard_refresh_filter_lists`, `adguard_add_client`, `adguard_update_client`, `adguard_set_blocked_services`, `adguard_toggle_safesearch`, `adguard_toggle_safebrowsing`, `adguard_toggle_parental`, `adguard_add_rewrite`, `adguard_update_rewrite`, `adguard_delete_rewrite`, `adguard_toggle_rewrites`, `adguard_set_access_list`, `adguard_update_querylog_config`, `adguard_update_stats_config`, `adguard_validate_tls_config`, `adguard_test_upstream_dns`, `adguard_sync_run`.
|
|
88
102
|
|
|
89
103
|
| Tool | Description |
|
|
90
104
|
|---|---|
|
|
91
|
-
| `adguard_add_user_rule` | Append a
|
|
92
|
-
| `adguard_remove_user_rule` | Remove
|
|
93
|
-
| `adguard_add_filter_list` | Subscribe to a
|
|
94
|
-
| `adguard_remove_filter_list` | Unsubscribe
|
|
105
|
+
| `adguard_add_user_rule` | Append a custom rule to the user-rules block (`POST /control/filtering/set_rules`). |
|
|
106
|
+
| `adguard_remove_user_rule` | Remove an exact-match rule from the user-rules block (`POST /control/filtering/set_rules`). |
|
|
107
|
+
| `adguard_add_filter_list` | Subscribe to a filter list URL (`POST /control/filtering/add_url`). |
|
|
108
|
+
| `adguard_remove_filter_list` | Unsubscribe a filter list by URL (`POST /control/filtering/remove_url`). |
|
|
95
109
|
| `adguard_toggle_filter_list` | Enable or disable a subscribed filter list (`POST /control/filtering/set_url`). |
|
|
96
|
-
| `adguard_set_client_blocked_services` | Set
|
|
97
|
-
| `adguard_refresh_filter_lists` |
|
|
98
|
-
| `adguard_add_client` | Register a
|
|
99
|
-
| `adguard_update_client` |
|
|
100
|
-
| `adguard_set_blocked_services` | Set
|
|
101
|
-
| `adguard_toggle_safesearch` | Enable or disable SafeSearch globally with per-engine flags (`PUT /control/safesearch/settings`). |
|
|
102
|
-
| `adguard_toggle_safebrowsing` | Enable or disable
|
|
110
|
+
| `adguard_set_client_blocked_services` | Set blocked services for a named client (`POST /control/clients/update`). |
|
|
111
|
+
| `adguard_refresh_filter_lists` | Refresh subscribed blocklists or allowlists (`POST /control/filtering/refresh`). |
|
|
112
|
+
| `adguard_add_client` | Register a named client (`POST /control/clients/add`). |
|
|
113
|
+
| `adguard_update_client` | Update a named client using the nested `{name, data}` body (`POST /control/clients/update`). |
|
|
114
|
+
| `adguard_set_blocked_services` | Set global blocked services and an optional weekly schedule (`PUT /control/blocked_services/update`). |
|
|
115
|
+
| `adguard_toggle_safesearch` | Enable or disable SafeSearch globally with optional per-engine flags (`PUT /control/safesearch/settings`). |
|
|
116
|
+
| `adguard_toggle_safebrowsing` | Enable or disable SafeBrowsing (`POST /control/safebrowsing/enable` or `/disable`). |
|
|
117
|
+
| `adguard_toggle_parental` | Enable or disable global parental filtering (`POST /control/parental/enable` or `/disable`). |
|
|
118
|
+
| `adguard_add_rewrite` | Add a DNS rewrite rule (`POST /control/rewrite/add`). |
|
|
119
|
+
| `adguard_update_rewrite` | Update a DNS rewrite rule (`PUT /control/rewrite/update`). |
|
|
120
|
+
| `adguard_delete_rewrite` | Delete a DNS rewrite rule (`POST /control/rewrite/delete`). |
|
|
121
|
+
| `adguard_toggle_rewrites` | Enable or disable DNS rewrites (`PUT /control/rewrite/settings/update`). |
|
|
122
|
+
| `adguard_set_access_list` | Replace allowed clients, disallowed clients, and blocked hosts (`POST /control/access/set`). |
|
|
123
|
+
| `adguard_update_querylog_config` | Update query log settings (`PUT /control/querylog/config/update`). |
|
|
124
|
+
| `adguard_update_stats_config` | Update statistics settings (`PUT /control/stats/config/update`). |
|
|
125
|
+
| `adguard_validate_tls_config` | Validate a TLS configuration without applying it (`POST /control/tls/validate`). |
|
|
126
|
+
| `adguard_test_upstream_dns` | Ask AdGuard Home to test upstream DNS configuration (`POST /control/test_upstream_dns`). |
|
|
103
127
|
| `adguard_sync_run` | Trigger AdGuardHome Sync immediately (`POST /api/v1/sync`). |
|
|
104
128
|
|
|
105
129
|
**Destructive (6, require `confirm: true` + `destructive: true`):** `adguard_replace_user_rules`, `adguard_toggle_protection`, `adguard_delete_client`, `adguard_clear_query_log`, `adguard_reset_stats`, `adguard_sync_clear_logs`.
|
|
106
130
|
|
|
107
131
|
| Tool | Description |
|
|
108
132
|
|---|---|
|
|
109
|
-
| `adguard_replace_user_rules` |
|
|
110
|
-
| `adguard_toggle_protection` | Enable or disable global filtering
|
|
111
|
-
| `adguard_delete_client` | Remove a
|
|
133
|
+
| `adguard_replace_user_rules` | Replace the entire user-rules block, deleting rules not in the new set (`POST /control/filtering/set_rules`). |
|
|
134
|
+
| `adguard_toggle_protection` | Enable or disable global filtering. Disabling stops all blocking (`POST /control/protection`). |
|
|
135
|
+
| `adguard_delete_client` | Remove a named client and its per-client rules and settings (`POST /control/clients/delete`). |
|
|
112
136
|
| `adguard_clear_query_log` | Wipe the DNS query log (`POST /control/querylog_clear`). |
|
|
113
137
|
| `adguard_reset_stats` | Zero the stats window (`POST /control/stats_reset`). |
|
|
114
138
|
| `adguard_sync_clear_logs` | Clear AdGuardHome Sync in-memory logs (`POST /api/v1/clear-logs`). |
|
|
@@ -129,6 +153,9 @@ ADGUARD_SECONDARY_PASSWORD=<password>
|
|
|
129
153
|
|
|
130
154
|
# Optional: which instance is default when a tool omits the `instance` arg:
|
|
131
155
|
ADGUARD_DEFAULT_INSTANCE=primary
|
|
156
|
+
|
|
157
|
+
# Optional: per-request HTTP timeout in milliseconds (default 30000; minimum 1000):
|
|
158
|
+
ADGUARD_REQUEST_TIMEOUT_MS=30000
|
|
132
159
|
```
|
|
133
160
|
|
|
134
161
|
Instance names are derived from the env-var middle segment (case-insensitive). Add `ADGUARD_LIVINGROOM_URL/USERNAME/PASSWORD` and the MCP picks it up on next start.
|
|
@@ -161,7 +188,9 @@ adguardctrl stats
|
|
|
161
188
|
adguardctrl querylog --limit 20 --blocked-only
|
|
162
189
|
adguardctrl check-host youtube.com --client kid-tablet
|
|
163
190
|
adguardctrl clients list
|
|
191
|
+
adguardctrl clients find 192.0.2.10 kid-tablet --json
|
|
164
192
|
adguardctrl filters list
|
|
193
|
+
adguardctrl filtering-toggles --instance secondary --json
|
|
165
194
|
adguardctrl rewrites list
|
|
166
195
|
adguardctrl dns-config
|
|
167
196
|
adguardctrl tls status # private key is redacted
|
|
@@ -170,6 +199,14 @@ adguardctrl status --json # raw JSON for piping
|
|
|
170
199
|
adguardctrl status --instance secondary
|
|
171
200
|
```
|
|
172
201
|
|
|
202
|
+
To page backward, run `adguardctrl querylog --limit 20` and use the `--older-than` value printed on the last line. Repeat with the same filters and limit until the output says `End of query log.`
|
|
203
|
+
|
|
204
|
+
```bash
|
|
205
|
+
adguardctrl querylog --limit 20 --older-than '2026-01-01T00:00:00.123456789+02:30'
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
With `--json`, use the upstream `oldest` timestamp as the cursor when `data` contains exactly the requested number of entries and `oldest` is a valid timestamp with a timezone. If the CLI or MCP reports that the output limit truncated a page, retry with the same cursor and a smaller limit before continuing. At the minimum limit, the CLI and MCP report that the page still exceeds the output cap. Pagination is unavailable when `--client` and `--domain` are used together.
|
|
209
|
+
|
|
173
210
|
Run `adguardctrl help` for the full command and flag list. `--instance <name>` targets a non-default AdGuard Home box; `--json` emits raw JSON instead of the concise human-readable summary. Exit codes: `0` success, `1` runtime error (backend unreachable / call failed, and `sync health` when not healthy), `2` usage error (unknown command/flag or bad value).
|
|
174
211
|
|
|
175
212
|
### Starting the MCP server
|
|
@@ -258,12 +295,177 @@ ADGUARD_PRIMARY_PASSWORD = "your-password"
|
|
|
258
295
|
|
|
259
296
|
It does not:
|
|
260
297
|
|
|
261
|
-
-
|
|
298
|
+
- install or manage background services automatically
|
|
262
299
|
- store or proxy your DNS traffic
|
|
263
300
|
- make any write without an explicit `confirm: true` flag from the caller
|
|
264
301
|
- perform a destructive operation without `confirm: true` and `destructive: true` together
|
|
265
302
|
- talk to AdGuard's hosted DNS product; it targets self-hosted AdGuard Home instances you run
|
|
266
303
|
|
|
304
|
+
## HTTP mode
|
|
305
|
+
|
|
306
|
+
Run one process shared by multiple MCP clients, alongside the existing stdio mode:
|
|
307
|
+
|
|
308
|
+
```sh
|
|
309
|
+
node dist/mcp-server.js --http
|
|
310
|
+
# Also: adguardctrl mcp --http or adguard-mcp --http
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
Configure the usual `ADGUARD_<NAME>_URL`, `_USERNAME`, and `_PASSWORD` variables
|
|
314
|
+
and optional AdGuardHome Sync credentials on the server. Generate a separate
|
|
315
|
+
HTTP token with `openssl rand -hex 32`.
|
|
316
|
+
|
|
317
|
+
| Variable | Default | Purpose |
|
|
318
|
+
| --- | --- | --- |
|
|
319
|
+
| `ADGUARD_MCP_HTTP_TOKEN` | Required | Independent bearer credential, at least 32 characters |
|
|
320
|
+
| `ADGUARD_MCP_HTTP_HOST` | IPv4 loopback | Listener bind address. Wildcards (`0.0.0.0`, `::`, `[::]`) are refused |
|
|
321
|
+
| `ADGUARD_MCP_HTTP_PORT` | `3111` | TCP port, or `0` for a free port |
|
|
322
|
+
|
|
323
|
+
Startup rejects a missing or blank token, or a token equal to any configured
|
|
324
|
+
AdGuard Home or Sync username, password, credential pair, Base64 credential
|
|
325
|
+
pair, Basic authorization value, or URL userinfo credential. Sync aliases are
|
|
326
|
+
resolved using the existing `ADGUARDHOME_SYNC_*` / `ADGUARD_SYNC_*` precedence.
|
|
327
|
+
Token comparisons use SHA-256 digests and constant-time comparison. The token is
|
|
328
|
+
registered with the secret redactor.
|
|
329
|
+
|
|
330
|
+
Startup prints the listener URL to stderr with the configured host and actual
|
|
331
|
+
port. `/mcp` accepts Streamable HTTP POST, GET, and DELETE with bearer
|
|
332
|
+
authentication on every request, including loopback requests. `GET /healthz`
|
|
333
|
+
requires no token and returns only `{"status":"ok"}`. Both routes require the
|
|
334
|
+
literal request target and return 404 for a query string or trailing slash.
|
|
335
|
+
Host and Origin checks run before authentication. Host must match the configured
|
|
336
|
+
host or one of `localhost`, `127.0.0.1`, and `[::1]`. A supplied Origin must
|
|
337
|
+
be an HTTP or HTTPS origin using one of those three loopback names or addresses.
|
|
338
|
+
|
|
339
|
+
The shared transport returns JSON for HTTP errors it generates. Invalid bearer
|
|
340
|
+
authentication still returns 401 with `WWW-Authenticate: Bearer` and now has
|
|
341
|
+
the body `{"error":"Unauthorized"}`. Bearer token comparisons ignore surrounding
|
|
342
|
+
whitespace.
|
|
343
|
+
|
|
344
|
+
The listener limits bodies to 1 MiB, request receipt to 30 seconds, headers to 10 seconds,
|
|
345
|
+
and sessions to 128. Sessions idle for 30 minutes expire on a minute timer.
|
|
346
|
+
Active POST requests prevent idle expiry. An open SSE channel alone does not.
|
|
347
|
+
SIGTERM and SIGINT stop the listener and give active calls up to five seconds to
|
|
348
|
+
finish before dropping connections. Clients must initialize again after expiry
|
|
349
|
+
or restart.
|
|
350
|
+
|
|
351
|
+
Each session owns a fresh MCP server, tool objects, and request handlers. Write
|
|
352
|
+
gates have no pending approvals or process-wide write-enable flag: every call
|
|
353
|
+
requires `confirm:true`, plus `destructive:true` for destructive tools. A confirmed
|
|
354
|
+
call cannot authorize a later call or another session. There are no deferred tool
|
|
355
|
+
sets, client caches, or shared rate limiters. Only the secret masking registry is
|
|
356
|
+
shared. All clients with the token share the configured upstream privileges and
|
|
357
|
+
can modify the same upstream resources. Session IDs route connections and do not
|
|
358
|
+
identify separate users.
|
|
359
|
+
|
|
360
|
+
Keep the default loopback binding for local clients. Remote access needs a
|
|
361
|
+
trusted TLS proxy or tunnel and network access controls. This listener provides
|
|
362
|
+
no TLS, OAuth, browser CORS access, or per-client upstream accounts. Preserve the
|
|
363
|
+
allowed Host header through a proxy. A wildcard bind does not allow arbitrary
|
|
364
|
+
Host headers.
|
|
365
|
+
|
|
366
|
+
### Claude Code
|
|
367
|
+
|
|
368
|
+
Add an HTTP entry under `mcpServers` in the client configuration:
|
|
369
|
+
|
|
370
|
+
```json
|
|
371
|
+
{
|
|
372
|
+
"mcpServers": {
|
|
373
|
+
"adguard": {
|
|
374
|
+
"type": "http",
|
|
375
|
+
"url": "http://localhost:3111/mcp",
|
|
376
|
+
"headersHelper": "/path/to/helper ADGUARD_MCP_HTTP_TOKEN"
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
```
|
|
381
|
+
|
|
382
|
+
The executable helper reads the named environment variable and prints an
|
|
383
|
+
Authorization JSON object. For example:
|
|
384
|
+
|
|
385
|
+
```js
|
|
386
|
+
#!/usr/bin/env node
|
|
387
|
+
const token = process.env[process.argv[2]];
|
|
388
|
+
if (!token) process.exit(1);
|
|
389
|
+
console.log(JSON.stringify({ Authorization: `Bearer ${token}` }));
|
|
390
|
+
```
|
|
391
|
+
|
|
392
|
+
Provide `ADGUARD_MCP_HTTP_TOKEN` to the helper through the client environment.
|
|
393
|
+
Keep the token out of client configuration files and version control.
|
|
394
|
+
|
|
395
|
+
### Codex
|
|
396
|
+
|
|
397
|
+
```toml
|
|
398
|
+
[mcp_servers.adguard]
|
|
399
|
+
url = "http://localhost:3111/mcp"
|
|
400
|
+
bearer_token_env_var = "ADGUARD_MCP_HTTP_TOKEN"
|
|
401
|
+
```
|
|
402
|
+
|
|
403
|
+
Export the token in the Codex process environment. The URL selects Streamable
|
|
404
|
+
HTTP, with the bearer token supplied from the named variable.
|
|
405
|
+
|
|
406
|
+
### systemd user service
|
|
407
|
+
|
|
408
|
+
[Example unit](docs/systemd/adguard-mcp-http.service) uses an installation under
|
|
409
|
+
`/opt/adguardctrl`. Adjust its paths before installing it. Its EnvironmentFile is
|
|
410
|
+
`%h/.config/adguard-mcp/http.env`. Create that file with mode `0600`, containing
|
|
411
|
+
the server's upstream configuration and HTTP token. The unit uses
|
|
412
|
+
`NoNewPrivileges=true`, `PrivateTmp=true`, and `UMask=0077`.
|
|
413
|
+
|
|
414
|
+
## FAQ
|
|
415
|
+
|
|
416
|
+
**Can an AI agent disable AdGuard Home DNS filtering without confirmation?**
|
|
417
|
+
No. Writes are split into safe-write and destructive tiers, and destructive actions stay gated behind explicit confirm flags.
|
|
418
|
+
|
|
419
|
+
**Does `adguardctrl` require a background daemon?**
|
|
420
|
+
No. Run `adguardctrl` directly from cron or a shell, or invoke `npx -y @solomonneas/adguard-mcp` over stdio from Claude Code, Claude Desktop, Cursor, or Codex.
|
|
421
|
+
|
|
422
|
+
**How does `adguardctrl` compare to other AdGuard Home MCP servers?**
|
|
423
|
+
Unlike single-purpose MCP wrappers such as `mcp-adguard-home` or `adguardhome-mcp-rs`, `adguardctrl` ships both a typed shell CLI and a stdio MCP adapter with explicit write-tier gates and secret redaction.
|
|
424
|
+
|
|
425
|
+
## Part of Lidless Labs
|
|
426
|
+
|
|
427
|
+
`adguardctrl` is maintained by [Lidless Labs](https://lidless.dev) ([GitHub](https://github.com/lidless-labs)). Related homelab and network tools:
|
|
428
|
+
|
|
429
|
+
- [proxmox-mcp](https://github.com/lidless-labs/proxmox-mcp) - Proxmox VE MCP server and CLI with gated writes
|
|
430
|
+
- [librenmsctrl](https://github.com/lidless-labs/librenmsctrl) - LibreNMS devices, ports, and alerts over CLI and MCP
|
|
431
|
+
- [immichctrl](https://github.com/lidless-labs/immichctrl) - Immich photo library CLI and MCP server, writes off by default
|
|
432
|
+
- [jellyctrl](https://github.com/lidless-labs/jellyctrl) - Jellyfin media server CLI and MCP server with gated writes
|
|
433
|
+
- [eero-cli](https://github.com/lidless-labs/eero-cli) - Python CLI for the eero mesh Wi-Fi API
|
|
434
|
+
|
|
267
435
|
## License
|
|
268
436
|
|
|
269
437
|
MIT. See [LICENSE](LICENSE).
|
|
438
|
+
|
|
439
|
+
---
|
|
440
|
+
|
|
441
|
+
<p align="center"><a href="https://lidless.dev">Part of <strong>Lidless Labs</strong></a> · the eye does not close</p>
|
|
442
|
+
|
|
443
|
+
<p align="center"><sub><strong>Homelab:</strong> <a href="https://github.com/lidless-labs/proxmox-mcp">proxmox-mcp</a> · <a href="https://github.com/lidless-labs/immichctrl">immichctrl</a> · <a href="https://github.com/lidless-labs/jellyctrl">jellyctrl</a> · <a href="https://github.com/lidless-labs/proxguard">proxguard</a></sub></p>
|
|
444
|
+
|
|
445
|
+
<p align="center"><sub><a href="https://lidless.dev">All tools</a> · <a href="https://github.com/lidless-labs">Lidless Labs on GitHub</a></sub></p>
|
|
446
|
+
|
|
447
|
+
### Upstream response safety
|
|
448
|
+
|
|
449
|
+
Authenticated AdGuard Home and Sync requests reject redirects. Configure each
|
|
450
|
+
service's final URL. Response headers and bodies share the configured request
|
|
451
|
+
deadline. Responses are limited to 10 MiB before JSON parsing. Programmatic
|
|
452
|
+
clients can set `maxResponseBytes` to a positive safe integer for a stricter limit.
|
|
453
|
+
Only GET, HEAD, and OPTIONS can retry after a transport error, timeout, or 5xx.
|
|
454
|
+
A failed write response can mean the operation already ran. Check upstream state
|
|
455
|
+
before explicitly retrying a mutation.
|
|
456
|
+
|
|
457
|
+
Tool results preserve the JSON payload in the first text block. A second text
|
|
458
|
+
block identifies all upstream keys and values as untrusted AdGuard data. Treat
|
|
459
|
+
those fields as data, never as instructions or authorization. JSON string values
|
|
460
|
+
and keys escape boundary delimiters, including angle brackets. Oversized results
|
|
461
|
+
carry a truncation flag and marker. The provenance notice remains present, and
|
|
462
|
+
the whole serialized result stays within 90,000 bytes. Error results use the same
|
|
463
|
+
escaping, provenance, and size limit after secret redaction.
|
|
464
|
+
|
|
465
|
+
The bundled HTTP code is pinned to effect-operator-kit commit
|
|
466
|
+
`f4f674f42688bbf88af89861c8675638c91a8fce`.
|
|
467
|
+
|
|
468
|
+
CLI human-readable responses begin with the same untrusted-data notice and escape
|
|
469
|
+
terminal controls and boundary delimiters. `--json` keeps normal payload JSON on
|
|
470
|
+
stdout and prints provenance on stderr. If the response exceeds the output cap,
|
|
471
|
+
stdout contains a valid JSON truncation object instead of incomplete JSON.
|