Manage Pi-hole v6: DNS blocking, domains, clients, query analysis, DHCP, and multi-instance sync.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
A production-grade MCP server for Pi-hole v6.
76+ tools | 9 prompts | 5 resources | Multi-instance + sync | Single Go binary | 6.4 MB download (slim: 3.8 MB)
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.
Most MCP clients use the same configuration format. Add this to your client's config:
Then install the binary via one of the methods below.
pihole-mcp is listed in the official MCP Registry as:
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.
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.
.deb and .rpm packages for Debian-based (Ubuntu, Raspberry Pi OS) and RPM-based (Fedora, RHEL) distributions are available on the Releases page.
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.
| 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_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_RATE_LIMIT | No | 120 | Per-session requests-per-minute cap on the HTTP/SSE transports. 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). |
PIHOLE_TLS_SKIP_VERIFY | No | false | Disable TLS certificate verification for Pi-hole connections. Only for instances serving self-signed certificates β prefer a trusted certificate 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_RATE_LIMIT and PIHOLE_ALLOWED_ORIGINS only apply to the http and sse transports; stdio is a single-process, single-user channel by definition and isn't gated.
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, β¦) |
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 summary β one slow or unreachable instance no longer fails the whole call). State-changing tools require a single named instance. PIHOLE_URL and PIHOLE_1_URL are mutually exclusive.
When you run more than one Pi-hole, two extra tools appear for keeping them aligned:
pihole_instance_diff β compare two instances and see exactly what differs across adlists/allowlists, allow/deny rules (exact and regex), groups, clients, local DNS A/AAAA records, and CNAME records. It is read-only and writes nothing.pihole_instance_sync β push a source instance's configuration onto a target. It is deliberately cautious:
source of truth and the target; only the target is ever written to.confirm_token by default; nothing changes until you re-run with mode=apply and that token. If the configuration drifts between planning and applying, the token no longer matches and the apply is refused.prune=true.snapshot=false).Example: preview what the upstairs Pi-hole is missing relative to downstairs, then apply it.
The Quick Start config above works for most clients. Expand the section below for client-specific instructions.
Add to your Claude Desktop configuration file:
| OS | Path |
|---|---|
| macOS | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Windows | %APPDATA%\Claude\claude_desktop_config.json |
| Linux | ~/.config/Claude/claude_desktop_config.json |
Restart Claude Desktop after saving.
Verify with:
Add to .vscode/mcp.json in your workspace:
Or add via the command palette: MCP: Add Server.
Note: VS Code uses
"servers"as the top-level key (not"mcpServers"), and requires"type": "stdio".
Add to ~/.cursor/mcp.json:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/pi-hole-mcp-server)<a href="https://allmcps.com/mcp/pi-hole-mcp-server"><img src="https://allmcps.com/api/badge/pi-hole-mcp-server?style=directory" alt="Pi Hole MCP Server on AllMCPs" /></a>