AdGuard Home MCP Server

io.github.Samik081由 GitHub 账号 Samik081 发布v0.11.0更新于 Nov 12, 2026

Manage AdGuard Home through AI assistants

概览

AI 生成的概览

让助手管理自建的 AdGuard Home:DNS 过滤、查询日志、统计、客户端、DHCP、重写规则与 TLS 设置。

可以做什么
  • 读取服务器状态、用户资料、版本与更新情况,并开关全局 DNS 防护或启动软件更新
  • 查看和修改 DNS 配置、测试上游服务器、清空解析缓存
  • 搜索和清空查询日志,读取和重置统计,并调整其配置
  • 管理过滤列表与自定义规则、检测某域名是否会被拦截,并开关安全浏览、家长过滤和安全搜索
  • 列出、新增、修改和删除客户端、DHCP 设置与静态租约、DNS 重写、被封锁服务及访问控制列表
  • 校验 TLS 设置,并生成 Apple 的 DNS-over-HTTPS 或 DNS-over-TLS 描述文件
适用场景
适合在自己网络中运行 AdGuard Home 的用户:想向助手询问拦截情况、调整过滤规则或重写规则,或查看 DHCP 与 DNS 设置而不必操作网页界面。只读层级适合仅做监控的场景。
运行要求
通过 npx 在本地运行,需要 Node.js 22 或更高版本,也可使用 Docker 镜像。需要 ADGUARD_URL 指向 AdGuard Home 实例;若该实例未启用认证,还需 ADGUARD_USERNAME 与 ADGUARD_PASSWORD,服务器启动时会校验连接。可选变量用于设置访问层级、类别与工具过滤以及 HTTP 传输。
安装前请注意
默认的完整层级包含破坏性工具,会更改配置、增删过滤列表、删除客户端与租约、清空日志和统计,并应用初始安装设置。凭据以环境变量传入,避免写入共享配置文件。可选的 HTTP 传输没有认证,任何能访问该端口的人都能调用所有已启用的工具;请限制在本机回环或置于带认证的反向代理之后,并设置 MCP_ALLOWED_HOSTS。

安装

在 SourceWeft 中

  1. 打开 控制台中的 AdGuard Home MCP Server,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

[npm version] [Docker image] [License: MIT] [Node.js Version]

MCP AdGuard Home

MCP server for AdGuard Home. Manage DNS filtering, clients, DHCP, rewrites, and more through natural language in Cursor, Claude Code, and Claude Desktop.

Features

  • 65 tools across 16 categories covering the complete AdGuard Home API
  • Read-only mode via ADGUARD_ACCESS_TIER=read-only for safe monitoring
  • Category filtering via ADGUARD_CATEGORIES to expose only the tools you need
  • Zero HTTP dependencies -- uses native fetch (Node.js 22+)
  • Docker images for linux/amd64 and linux/arm64 on GHCR
  • Remote MCP via HTTP transport (MCP_TRANSPORT=http) using the Streamable HTTP protocol
  • TypeScript/ESM with full type safety

API Compatibility

Tested with AdGuard Home v0.107.76.

Quick Start

Run the server directly with npx:

bash
ADGUARD_URL="http://your-adguard-ip:3000" \ADGUARD_USERNAME="your-username" \ADGUARD_PASSWORD="your-password" \npx -y @samik081/mcp-adguard-home

The server validates your AdGuard Home connection on startup and fails immediately with a clear error if credentials are missing or invalid.

Docker

Run with Docker (stdio transport, same as npx):

bash
docker run --rm -i \  -e ADGUARD_URL=http://your-adguard-ip:3000 \  -e ADGUARD_USERNAME=your-username \  -e ADGUARD_PASSWORD=your-password \  ghcr.io/samik081/mcp-adguard-home

To run as a remote MCP server with HTTP transport:

bash
docker run -d -p 127.0.0.1:3000:3000 \  -e MCP_TRANSPORT=http \  -e MCP_ALLOWED_HOSTS=localhost,127.0.0.1 \  -e ADGUARD_URL=http://your-adguard-ip:3000 \  -e ADGUARD_USERNAME=your-username \  -e ADGUARD_PASSWORD=your-password \  ghcr.io/samik081/mcp-adguard-home

The MCP endpoint is available at http://localhost:3000 and a health check at http://localhost:3000/health.

Security: the HTTP transport has no authentication -- anyone who can reach the port can call every enabled tool. Keep it on loopback or a trusted network, or put it behind an authenticating reverse proxy. Outside Docker the server binds to 127.0.0.1 by default and only accepts requests whose Host/Origin is a loopback name (DNS rebinding protection). The Docker image binds to 0.0.0.0, where that check is off unless you set MCP_ALLOWED_HOSTS to the hostnames clients use to reach it.

Configuration

Claude Code CLI (recommended):

bash
# Using npxclaude mcp add --transport stdio adguard-home \  --env ADGUARD_URL=http://your-adguard-ip:3000 \  --env ADGUARD_USERNAME=your-username \  --env ADGUARD_PASSWORD=your-password \  -- npx -y @samik081/mcp-adguard-home
# Using Dockerclaude mcp add --transport stdio adguard-home \  --env ADGUARD_URL=http://your-adguard-ip:3000 \  --env ADGUARD_USERNAME=your-username \  --env ADGUARD_PASSWORD=your-password \  -- docker run --rm -i ghcr.io/samik081/mcp-adguard-home
# Using remote HTTP (connect to a running Docker container or HTTP server)claude mcp add --transport http adguard-home http://localhost:3000

JSON config (works with Claude Code .mcp.json, Claude Desktop claude_desktop_config.json, Cursor .cursor/mcp.json):

json
{  "mcpServers": {    "adguard-home": {      "command": "npx",      "args": ["-y", "@samik081/mcp-adguard-home"],      "env": {        "ADGUARD_URL": "http://your-adguard-ip:3000",        "ADGUARD_USERNAME": "your-username",        "ADGUARD_PASSWORD": "your-password"      }    }  }}

Docker (stdio):

json
{  "mcpServers": {    "adguard-home": {      "command": "docker",      "args": ["run", "--rm", "-i",        "-e", "ADGUARD_URL=http://your-adguard-ip:3000",        "-e", "ADGUARD_USERNAME=your-username",        "-e", "ADGUARD_PASSWORD=your-password",        "ghcr.io/samik081/mcp-adguard-home"      ]    }  }}

Remote MCP (connect to a running Docker container or HTTP server):

json
{  "mcpServers": {    "adguard-home": {      "type": "streamable-http",      "url": "http://localhost:3000"    }  }}

Access Tiers

Control which tools are available using the ADGUARD_ACCESS_TIER environment variable:

TierToolsDescription
full (default)65Read and write -- full control
read-only29Read only -- safe for monitoring, no state changes
  • full: All 65 tools. Includes configuration changes, adding/removing filters, clearing logs, and all destructive operations.
  • read-only: 29 tools. Status, configuration viewing, and query log reading only. No state changes.

Tools that are not available in your tier are not registered with the MCP server. They will not appear in your AI tool's tool list, keeping the context clean.

Environment Variables

VariableRequiredDefaultDescription
ADGUARD_URLYes--AdGuard Home base URL (e.g., http://192.168.1.1:3000)
ADGUARD_USERNAMENo--Admin username. Omit together with ADGUARD_PASSWORD if AdGuard Home has authentication disabled
ADGUARD_PASSWORDNo--Admin password. Must be set whenever ADGUARD_USERNAME is
ADGUARD_ACCESS_TIERNofullread-only for read-only tools only, full for all tools
ADGUARD_CATEGORIESNo(all)Comma-separated category allowlist (e.g., dns,filtering,stats)
ADGUARD_TOOL_BLACKLISTNo(none)Comma-separated list of tool names to exclude (e.g., dns_clear_cache,stats_reset)
ADGUARD_TOOL_WHITELISTNo(none)Comma-separated list of tool names to force-include, bypassing access tier and category filters
DEBUGNofalseEnable debug logging to stderr
MCP_TRANSPORTNostdioTransport mode: stdio (default) or http
MCP_PORTNo3000HTTP server port (only used when MCP_TRANSPORT=http)
MCP_HOSTNo127.0.0.1HTTP server bind address (only used when MCP_TRANSPORT=http). The Docker image sets 0.0.0.0
MCP_ALLOWED_HOSTSNo(none)Comma-separated hostnames accepted in the Host and Origin headers of HTTP requests, e.g. mcp.example.com,localhost (ports ignored, IPv6 in brackets). Loopback names are always accepted when MCP_HOST is a loopback address. If MCP_HOST is not loopback and this is unset, the headers are not checked
MCP_SESSION_IDLE_TIMEOUTNo1800Seconds of inactivity after which an HTTP session is closed and its memory released (sessions with a connected SSE stream are never closed). 0 disables. Only used when MCP_TRANSPORT=http
MCP_EXCLUDE_TOOL_TITLESNofalseSet true to omit tool titles from registration (saves tokens)

Available Categories

global, dns, querylog, stats, filtering, safebrowsing, parental, safesearch, clients, dhcp, rewrites, tls, blocked_services, access, install, mobile_config

Tools

mcp-adguard-home provides 65 tools organized by category. Each tool's Access column shows the minimum tier required: read-only (available in both tiers) or full (requires full tier). The Hints column shows tool behavior: read-only (no state changes), destructive (modifies existing state), idempotent (same result if called twice).

Global (6 tools)
ToolDescriptionAccessHints
global_get_statusRetrieve server status including version, DNS addresses, protection state, and portsread-onlyread-only, idempotent
global_get_profileRetrieve user profile (name, language, theme)read-onlyread-only, idempotent
global_check_versionCheck for AdGuard Home updates and compare with current versionread-onlyread-only, idempotent
global_set_protectionEnable or disable DNS protection globally, with optional duration for temporary disablefulldestructive, idempotent
global_update_profileUpdate user profile settings (name, language, theme)fulldestructive, idempotent
global_begin_updateInitiate an AdGuard Home software updatefulldestructive
DNS (4 tools)
ToolDescriptionAccessHints
dns_get_infoRetrieve full DNS configuration including upstreams, cache settings, blocking mode, and DNSSECread-onlyread-only, idempotent
dns_test_upstreamTest upstream DNS server configuration to verify servers are reachableread-onlyread-only, idempotent
dns_set_configUpdate DNS server configuration (23 optional fields for partial update, incl. rate-limit subnet lengths and allowlist)fulldestructive, idempotent
dns_clear_cacheClear the DNS resolver cachefulldestructive, idempotent
Query Log (4 tools)
ToolDescriptionAccessHints
querylog_getSearch DNS query log with optional filtering by reason or response status, search term, and cursor pagination via older_than (returns a paging hint on empty results)read-onlyread-only, idempotent
querylog_get_configRetrieve query log configuration settingsread-onlyread-only, idempotent
querylog_set_configUpdate query log configuration (enabled, interval, anonymization)fulldestructive, idempotent
querylog_clearClear the entire DNS query logfulldestructive, idempotent
Statistics (4 tools)
ToolDescriptionAccessHints
stats_getRetrieve DNS statistics including top domains, blocked counts, and client activityread-onlyread-only, idempotent
stats_get_configRetrieve statistics configuration settingsread-onlyread-only, idempotent
stats_resetReset all DNS statisticsfulldestructive, idempotent
stats_set_configUpdate statistics configuration (enabled, interval, ignored domains)fulldestructive, idempotent
Filtering (8 tools)
ToolDescriptionAccessHints
filtering_get_statusRetrieve filtering configuration including blocklists, allowlists, and user rulesread-onlyread-only, idempotent
filtering_check_hostTest whether a hostname would be blocked by current filtering rulesread-onlyread-only, idempotent
filtering_set_configUpdate global filtering configuration (enabled state and update interval)fulldestructive, idempotent
filtering_add_urlAdd a new filter URL (blocklist or allowlist)full—
filtering_remove_urlRemove a filter URL from blocklist or allowlistfulldestructive
filtering_set_urlUpdate an existing filter URL (rename, change URL, or enable/disable)fulldestructive, idempotent
filtering_refreshForce refresh of filter lists to fetch latest updatesfulldestructive, idempotent
filtering_set_rulesSet custom filtering rules (replaces all existing custom rules)fulldestructive, idempotent
Safe Browsing (2 tools)
ToolDescriptionAccessHints
safebrowsing_get_statusRetrieve safe browsing (malware/phishing protection) statusread-onlyread-only, idempotent
safebrowsing_setEnable or disable safe browsing protectionfulldestructive, idempotent
Parental (2 tools)
ToolDescriptionAccessHints
parental_get_statusRetrieve parental filtering statusread-onlyread-only, idempotent
parental_setEnable or disable parental filtering (content restrictions)fulldestructive, idempotent
Safe Search (2 tools)
ToolDescriptionAccessHints
safesearch_get_statusRetrieve safe search settings showing per-engine enforcement statusread-onlyread-only, idempotent
safesearch_set_settingsUpdate safe search settings with per-engine configuration (Bing, DuckDuckGo, Google, Pixabay, Yandex, YouTube)fulldestructive, idempotent
Clients (5 tools)
ToolDescriptionAccessHints
clients_getRetrieve all configured and auto-detected clients with their settingsread-onlyread-only, idempotent
clients_searchSearch for specific clients by their IDs (IP, MAC, CIDR, or client ID)read-onlyread-only, idempotent
clients_addAdd a new persistent client with per-client settingsfull—
clients_updateUpdate an existing persistent client by namefulldestructive, idempotent
clients_deleteDelete a persistent client by namefulldestructive
DHCP (9 tools)
ToolDescriptionAccessHints
dhcp_get_statusRetrieve DHCP server configuration, static leases, and active leasesread-onlyread-only, idempotent
dhcp_get_interfacesRetrieve available network interfaces for DHCP server bindingread-onlyread-only, idempotent
dhcp_find_activeScan for competing DHCP servers on a network interfaceread-onlyread-only, idempotent
dhcp_set_configUpdate DHCP server configuration (enabled state, interface, IPv4/IPv6 settings)fulldestructive, idempotent
dhcp_add_static_leaseAdd a static DHCP lease mapping a MAC address to an IPfull—
dhcp_remove_static_leaseRemove a static DHCP leasefulldestructive
dhcp_update_static_leaseUpdate a static DHCP lease (remove + add pattern)fulldestructive, idempotent
dhcp_resetReset DHCP configuration to defaultsfulldestructive, idempotent
dhcp_reset_leasesClear all DHCP leasesfulldestructive, idempotent
Rewrites (6 tools)
ToolDescriptionAccessHints
rewrites_listRetrieve all configured DNS rewrite rulesread-onlyread-only, idempotent
rewrites_get_settingsRetrieve DNS rewrite module enabled/disabled stateread-onlyread-only, idempotent
rewrites_addAdd a new DNS rewrite rulefull—
rewrites_updateUpdate a DNS rewrite rule (remove + add pattern)fulldestructive, idempotent
rewrites_deleteDelete a DNS rewrite rulefulldestructive
rewrites_set_settingsEnable or disable the DNS rewrite modulefulldestructive, idempotent
TLS (3 tools)
ToolDescriptionAccessHints
tls_get_statusRetrieve TLS configuration and certificate validation statusread-onlyread-only, idempotent
tls_validateValidate TLS configuration without applying changesread-onlyread-only, idempotent
tls_set_configUpdate TLS configuration including certificates and HTTPS/DoH/DoT settingsfulldestructive, idempotent
Blocked Services (3 tools)
ToolDescriptionAccessHints
blocked_services_get_allList all available services that can be blocked, organized by groupread-onlyread-only, idempotent
blocked_services_getRetrieve currently blocked services list and scheduleread-onlyread-only, idempotent
blocked_services_updateUpdate the list of blocked services and optional schedulefulldestructive, idempotent
Access (2 tools)
ToolDescriptionAccessHints
access_get_listRetrieve access control lists: allowed clients, disallowed clients, and blocked hostsread-onlyread-only, idempotent
access_set_listSet access control lists for allowed clients, disallowed clients, and blocked hostsfulldestructive, idempotent
Install (3 tools)
ToolDescriptionAccessHints
install_get_addressesRetrieve network interface details and ports for initial setupread-onlyread-only, idempotent
install_check_configValidate install configuration without applying (checks web/DNS binding, credentials)fullread-only, idempotent
install_apply_configApply initial setup configuration (web/DNS binding and admin credentials)fulldestructive
Mobile Config (2 tools)
ToolDescriptionAccessHints
mobile_config_get_dohGenerate Apple .mobileconfig profile for DNS-over-HTTPSread-onlyread-only, idempotent
mobile_config_get_dotGenerate Apple .mobileconfig profile for DNS-over-TLSread-onlyread-only, idempotent

Verify It Works

After configuring your MCP client, ask your AI assistant:

"What's my AdGuard Home server status?"

If the connection is working, the assistant will call global_get_status and return your server version, DNS addresses, protection state, and port configuration.

Usage Examples

  • "What's the current DNS protection status?" -- calls global_get_status to show version, addresses, and protection state.
  • "Show me all DNS rewrite rules" -- calls rewrites_list to display all configured DNS rewrites.
  • "Add a DNS rewrite for local.example.com pointing to 192.168.1.100" -- calls rewrites_add to create a new rewrite rule.

Troubleshooting

Connection errors

  • Verify ADGUARD_URL is reachable from the machine running the MCP server
  • Ensure the URL includes the port if non-standard (e.g., http://192.168.1.1:3000)
  • Check that AdGuard Home is running and accessible

Authentication failures

  • Verify ADGUARD_USERNAME and ADGUARD_PASSWORD are correct
  • If AdGuard Home has authentication disabled (no users configured), leave both variables unset
  • Check that the user has admin privileges in AdGuard Home

Tools not showing up

  • Check your ADGUARD_ACCESS_TIER setting -- read-only mode only exposes read tools
  • Check ADGUARD_CATEGORIES -- only tools in listed categories are registered
  • Verify the server started without errors by checking stderr output

403 Forbidden: Host header not allowed

In HTTP mode the server rejects requests whose Host or Origin header is not an allowed hostname. If you reach it through a reverse proxy or under another name, add that hostname to MCP_ALLOWED_HOSTS. To accept connections from other machines without Docker, also set MCP_HOST=0.0.0.0.

Development

bash
# Install dependenciesnpm install
# Build the projectnpm run build
# Run in development mode (auto-reload)npm run dev
# Open the MCP Inspector for interactive testingnpm run inspect

License

MIT

来源:README.md,提交 749d4dd

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

4
  1. v0.11.0最新Nov 12, 2026
  2. v0.10.1Oct 5, 2026
  3. v0.10.0Sep 29, 2026
  4. v0.9.2Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分