pihole-mcp
MCP server for Pi-hole v6 — DNS blocking, query analysis, and multi-instance management for AI assistants
Install / Use
claude mcp add hexamatic -- npx -y github:hexamatic/pihole-mcpIf the server publishes to npm under a different name, use that package instead — check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
AI & Machine LearningSupported Platforms
Our assessment of pihole-mcp
pihole-mcp scores 81/100 on our quality scale, 720th of 939 AI & Machine Learning skills we index.
Its MCP Server is 37 KB long, well organised into 60 sections with 28 code examples: a thorough specification that gives an agent plenty to work with.
It has 10 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated 11 days ago, so pihole-mcp is actively maintained.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 97/100, with no cautions. These come from repository metadata, not a code audit — read the skill file before letting an agent act on it.
pihole-mcp compared with similar skills
All 4 of these similar skills score higher than pihole-mcp; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| pihole-mcp (this skill)by hexamatic | 81 | 10 | 11d ago | MCP Server |
| Agent-Reachby Panniantong | 100 | 106.6k | 5d ago | CLAUDE.md |
| claude-memby thedotmack | 100 | 105.3k | today | CLAUDE.md |
| Understand-Anythingby Egonex-AI | 100 | 89.0k | 4d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 78.3k | today | CLAUDE.md |
Frequently asked questions
- How do I install pihole-mcp?
- Run
claude mcp add hexamatic -- npx -y github:hexamatic/pihole-mcp. The install tabs above show the steps for each supported agent. - Which AI agents does pihole-mcp work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is pihole-mcp safe to use?
- It is MIT-licensed and scores 97/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is pihole-mcp still maintained?
- The repository was last updated 11 days ago, so pihole-mcp is actively maintained.
Skill content
View source on GitHubpihole-mcp
A production-grade MCP server for Pi-hole v6.
82 tools (84 with a second instance) | 9 prompts | 5 resources | Multi-instance + sync | Read-only mode + toolsets | Single Go binary
</div>Gives AI assistants full control over your Pi-hole instance: DNS blocking, domain management, query analysis, statistics, network devices, DHCP, and system administration. Compatible with the Pi-hole v6 REST API.
Why this one
- Run it locked down.
PIHOLE_READ_ONLY=trueexposes only the tools that cannot change anything, enforced on every call, not just the tool list a client happens to cache.PIHOLE_TOOLSETSnarrows further to just the families you need, so a client asking "what can I use" gets a smaller, cheaper answer. - 82 tools (84 once a second Pi-hole is configured) covering roughly 95% of the Pi-hole v6 REST API, including domains, lists, groups, clients, DHCP, network, the query log, configuration, local DNS records, teleporter backup and restore, and session management.
- Multi-instance diff and sync. Compare two Pi-holes and see exactly what differs, or reconcile one onto the other with a dry-run plan and a confirm token before anything is written.
- Releases are signed and attested, not just built. Every archive and container image carries a keyless cosign signature, an SPDX SBOM and SLSA build provenance, and SECURITY.md has the one-line command to check each.
- Listed in the official MCP Registry as
io.github.hexamatic/pihole-mcp, installable by name from any client that supports registry install. - Shipped nine releases in five months since launch, each with real release notes describing what changed and why, not a commit-hash dump.
Quick Start
Most MCP clients use the same configuration format. Add this to your client's config:
{
"mcpServers": {
"pihole": {
"command": "pihole-mcp",
"env": {
"PIHOLE_URL": "http://192.168.1.2",
"PIHOLE_PASSWORD": "your-password"
}
}
}
}
Then install the binary via one of the methods below.
What you can ask
The whole point is natural language, not tool names. A few examples of what to actually type:
| You ask | What runs |
|---|---|
| "Is Pi-hole blocking right now, and for how long?" | pihole_dns_get_blocking |
| "Pause blocking for 10 minutes, I need to test something." | pihole_dns_set_blocking |
| "Why is reddit.com blocked? Check every list it could be on." | pihole_search_domains |
| "What are the top blocked domains today, and does anything look like a false positive?" | pihole_stats_recent_blocked, the review_top_blocked prompt |
| "Point nas.home at 192.168.1.50." | pihole_local_dns_add |
| "Which of my blocklists haven't updated in 30+ days?" | pihole_lists_list |
| "Show me devices on the network Pi-hole doesn't recognise." | pihole_network_devices, the audit_network prompt |
| "Compare my two Pi-holes and tell me what's different." | pihole_instance_diff |
| "Back up my configuration before I change anything." | pihole_teleporter_export |
| "Which upstream resolver is slowest, and is it worth switching?" | pihole_stats_upstreams, the upstream_health prompt |
Set PIHOLE_READ_ONLY=true first if you want to ask questions without any risk of something being
changed. See Scoping the tool surface.
Installation
MCP Registry
pihole-mcp is listed in the official MCP Registry as:
io.github.hexamatic/pihole-mcp
Clients that support registry install can add it by that name and will prompt for
PIHOLE_URL and PIHOLE_PASSWORD. The listing points at the ghcr.io image, so the
client needs a working Docker.
Homebrew
brew install hexamatic/tap/pihole-mcp
Installs on both macOS and Linux (Homebrew on Linux). On macOS the cask clears the quarantine attribute during install, so the binary runs without a Gatekeeper prompt.
Scoop (Windows)
scoop bucket add hexamatic https://github.com/hexamatic/scoop-bucket
scoop install pihole-mcp
Go Install
go install github.com/hexamatic/pihole-mcp/cmd/pihole-mcp@latest
Docker
docker pull ghcr.io/hexamatic/pihole-mcp:latest
Linux Packages
.deb and .rpm packages for Debian-based (Ubuntu, Raspberry Pi OS) and RPM-based (Fedora, RHEL) distributions are available on the Releases page.
# Debian / Ubuntu / Raspberry Pi OS
sudo dpkg -i pihole-mcp_X.Y.Z_linux_amd64.deb
# Fedora / RHEL / CentOS
sudo rpm -i pihole-mcp_X.Y.Z_linux_amd64.rpm
Binary Download
Pre-built binaries for Linux, macOS, and Windows (amd64 and arm64) are available on the Releases page.
Releases are checksummed, signed with keyless cosign, and ship SPDX SBOMs and SLSA build provenance. See SECURITY.md for the verification commands.
Check your setup
Once installed and configured, run the server directly with -check. It loads the configuration, contacts every Pi-hole you have configured, and reports each one by name:
PIHOLE_URL=http://192.168.1.2 PIHOLE_PASSWORD=your-password pihole-mcp -check
pihole-mcp 0.9.0
PASS primary (http://192.168.1.2) core v6.1.4, FTL v6.7
All 1 instance(s) reachable and authenticated.
It exits non-zero if any instance fails, and prints what to change. Worth running before you wire the server into a client: most clients hide the server's output, so a bad URL or password looks the same as a server that never started.
Configuration
| Variable | Required | Default | Description |
|----------|----------|---------|-------------|
| PIHOLE_URL | Yes | - | Pi-hole base URL (e.g. http://192.168.1.2) |
| PIHOLE_PASSWORD | Yes | - | Admin password or application password |
| PIHOLE_READ_ONLY | No | false | Expose only tools that cannot change Pi-hole. See Scoping the tool surface. |
| PIHOLE_TOOLSETS | No | all | Comma-separated toolset names to expose, e.g. dashboard,domains. Unset or all exposes everything. |
| PIHOLE_REQUEST_TIMEOUT | No | 30s | HTTP request timeout |
| PIHOLE_MAX_RETRIES | No | 3 | Retries after a failed Pi-hole API call. 0 disables. |
| PIHOLE_RETRY_MAX_DELAY | No | 8s | Upper bound on a single backoff wait. |
| PIHOLE_HTTP_AUTH_TOKEN | No | - | Shared bearer token required on every HTTP/SSE request. Minimum 16 characters. Unset means no authentication. |
| PIHOLE_HTTP_AUTH_TOKEN_FILE | No | - | Path to a file holding the bearer token, so it stays out of ps. Mutually exclusive with PIHOLE_HTTP_AUTH_TOKEN. |
| PIHOLE_RATE_LIMIT | No | 120 | Per-session requests-per-minute cap on the HTTP/SSE transports, under a per-address ceiling of four times that. 0 disables. |
| PIHOLE_ALLOWED_ORIGINS | No | localhost,127.0.0.1,[::1] | Comma-separated Origin/Host allowlist for HTTP/SSE transports. The literal * disables enforcement (unsafe). Not authentication. |
| PIHOLE_TRUSTED_PROXIES | No | - | Comma-separated IPs or CIDR blocks whose X-Forwarded-For the rate limiter believes. Unset means the header is ignored. |
| PIHOLE_TLS_SKIP_VERIFY | No | false | Disable TLS certificate verification for Pi-hole connections. Only for instances serving self-signed certificates. A trusted certificate is preferable where possible. |
| TZ | No | System timezone (UTC in Docker) | IANA timezone for rendered timestamps (e.g. Australia/Adelaide). Timezone data is embedded in the binary, so this works in the Docker image out of the box. |
| OTEL_EXPORTER_OTLP_ENDPOINT | No | - | OpenTelemetry collector endpoint. Setting it enables tracing; ignored in slim builds. |
Application passwords are recommended for automation: they bypass TOTP 2FA and can be revoked independently.
PIHOLE_HTTP_AUTH_TOKEN, PIHOLE_HTTP_AUTH_TOKEN_FILE, PIHOLE_RATE_LIMIT, PIHOLE_ALLOWED_ORIGINS and PIHOLE_TRUSTED_PROXIES only apply to the http and sse transports; stdio is a single-process, single-user channel by definition and isn't gated. See Security before exposing either transport beyond loopback.
Scoping the tool surface
By default the server offers every tool, including 34 that change Pi-hole and 27 that are destructive. Two variables narrow that.
PIHOLE_READ_ONLY=true exposes only tools that cannot change anything. Write tools are absent from
tools/list and rejected if called anyway, so a client working from a cached listing cannot
reach one either.
PIHOLE_READ_ONLY=true # 49 tools instead of 82
PIHOLE_TOOLSETS selects which families of tools exist at all, which is worth doing on its own
because tools/list is a cost paid in every conversation:
PIHOLE_TOOLSETS=dashboard,domains,lists # blocklist curation, and nothing else
PIHOLE_TOOLSETS=all # the default, stated explicitly
The two intersect, and read-only always wins. PIHOLE_READ_ONLY=true with
PIHOLE_TOOLSETS=dns,stats gives the 14 tools that are in those toolsets and read-only.
The toolset names, what each contains and how many tools it holds are in
docs/TOOLS.md, generated from the same table the server filters with. An
unknown name fails at startup and lists every valid one; run pihole-mcp -check to see it, along
with how many tools your configuration actually exposes:
scope: read-only=true, toolsets=dns,stats 14 of 82 tools exposed
A published toolset name is never removed, renamed or narrowed. See CONTRIBUTING.md for the full promise.
Multiple instances
To manage more than one Pi-hole, configure numbered instances instead of PIHOLE_URL/PIHOLE_PASSWORD:
| Variable | Required | Description |
|----------|----------|-------------|
| PIHOLE_1_URL, PIHOLE_2_URL, … | Yes | Base URL of each instance (contiguous from 1) |
| PIHOLE_1_PASSWORD, PIHOLE_2_PASSWORD, … | Yes | Password for the matching instance |
| PIHOLE_1_NAME, PIHOLE_2_NAME, … | No | Friendly name (default instance-1, instance-2, …) |
{
"mcpServers": {
"pihole": {
"command": "pihole-mcp",
"env": {
"PIHOLE_1_URL": "http://192.168.1.2",
"PIHOLE_1_PASSWORD": "prim…[redacted]",
"PIHOLE_1_NAME": "downstairs",
"PIHOLE_2_URL": "http://192.168.1.3",
"PIHOLE_2_PASSWORD": "seco…[redacted]",
"PIHOLE_2_NAME": "upstairs"
}
}
}
}
Every tool then accepts an optional instance argument, and every result is labelled with the instance it came from. Omit the argument to target the first instance; pass a name to target a specific one; pass instance=all on a read-only tool (e.g. pihole_padd, pihole_stats_summary) to query every instance concurrently and get back a single structured aggregate (per-instance results plus a success/failure summar
Truncated for display — read the full file on GitHub.
Related Skills
Agent-Reach
106.6kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu — one CLI, zero API fees.
claude-mem
105.3kPersistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More
Understand-Anything
89.0kGraphs that teach > graphs that impress. Turn any code into an interactive knowledge graph you can explore, search, and ask questions about. Works with Claude Code, Codex, Cursor, Copilot, Gemini CLI, and more.
headroom
78.3kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit — see the Safety scan above for what the skill file itself contains.
