
AdGuard Home MCP Server
io.github.Samik081由 GitHub 账号 Samik081 发布v0.11.0更新于 Nov 12, 2026
Manage AdGuard Home through AI assistants
概览
让助手管理自建的 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 传输。
安装
在 SourceWeft 中
- 打开 控制台中的 AdGuard Home MCP Server,将其添加到工作区。
- 为需要使用其工具的对话启用该服务。
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-onlyfor safe monitoring - Category filtering via
ADGUARD_CATEGORIESto expose only the tools you need - Zero HTTP dependencies -- uses native
fetch(Node.js 22+) - Docker images for
linux/amd64andlinux/arm64on 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:
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):
To run as a remote MCP server with HTTP transport:
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.1by default and only accepts requests whoseHost/Originis a loopback name (DNS rebinding protection). The Docker image binds to0.0.0.0, where that check is off unless you setMCP_ALLOWED_HOSTSto the hostnames clients use to reach it.
Configuration
Claude Code CLI (recommended):
JSON config (works with Claude Code .mcp.json, Claude Desktop claude_desktop_config.json, Cursor .cursor/mcp.json):
Docker (stdio):
Remote MCP (connect to a running Docker container or HTTP server):
Access Tiers
Control which tools are available using the ADGUARD_ACCESS_TIER environment variable:
- 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
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)
DNS (4 tools)
Query Log (4 tools)
Statistics (4 tools)
Filtering (8 tools)
Safe Browsing (2 tools)
Parental (2 tools)
Safe Search (2 tools)
Clients (5 tools)
DHCP (9 tools)
Rewrites (6 tools)
TLS (3 tools)
Blocked Services (3 tools)
Access (2 tools)
Install (3 tools)
Mobile Config (2 tools)
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_statusto show version, addresses, and protection state. - "Show me all DNS rewrite rules" -- calls
rewrites_listto display all configured DNS rewrites. - "Add a DNS rewrite for local.example.com pointing to 192.168.1.100" -- calls
rewrites_addto create a new rewrite rule.
Troubleshooting
Connection errors
- Verify
ADGUARD_URLis 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_USERNAMEandADGUARD_PASSWORDare 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_TIERsetting --read-onlymode 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
License
来源:README.md,提交 749d4dd
工具
0版本历史
4- v0.11.0最新Nov 12, 2026
- v0.10.1Oct 5, 2026
- v0.10.0Sep 29, 2026
- v0.9.2Sep 16, 2026
评分
已满足适用检查项的 50%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通25 分
请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。
- 已声明认证方式10 分
请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分