
Pi-hole MCP Server
io.github.ranklancerPublished by GitHub account ranklancerv0.2.0Updated Oct 26, 2026
MCP server for Pi-hole v6 API — manage multiple instances: queries, lists, groups, stats
Overview
MCP server that lets an assistant query and manage one or more Pi-hole v6 DNS ad-blockers: query logs, allow/deny lists, groups, clients and stats.
- What you can do
- Read query logs with filters and get statistics summaries across instances
- List, add, update and delete allowlist and denylist domains, with automatic exact-versus-regex routing and a check for miscategorized regex entries
- Manage groups and clients, including group assignments
- Enable or disable blocking, optionally with an auto-revert timer, and trigger a gravity reload
- List, add and delete local DNS A records and CNAME records
- Target any configured instance per call, defaulting to the first one
- When to use it
- Useful for homelab or network administrators running one or several Pi-hole v6 instances who want to inspect blocked traffic, adjust filtering rules or compare stats conversationally instead of using the admin UI or curl.
- Requirements
- Runs locally as a Node.js process (Node.js 20 or newer) or via Docker; needs network access to each Pi-hole v6 instance with API access enabled. Configuration is by environment variables: PIHOLE_INSTANCES, PIHOLE_BASE_URL and PIHOLE_PASSWORD, plus per-instance NAME_BASE_URL, NAME_PASSWORD and optional NAME_INSECURE_TLS; passwords can alternatively come from Docker secret files.
Installation
In SourceWeft
- Open Pi-hole MCP Server in the dashboard and add it to a workspace.
- Enable the server for the chats that should use its tools.
Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.
Other MCP clients
Follow the launch instructions in the repository.
README
pihole-mcp
[License: MIT] [Node.js] [Pi-hole v6] [MCP]
An MCP (Model Context Protocol) server that gives AI assistants like Claude full control over your Pi-hole v6 DNS ad-blocker - query logs, allow/deny lists, group management, gravity reload, and stats. Designed from day one for multi-instance deployments: manage one or many Pi-hole instances from a single MCP endpoint.
Why?
Pi-hole's admin API is powerful but cumbersome to script against. This MCP server turns every Pi-hole API action into a tool that any MCP-compatible AI assistant can call directly. Instead of clicking through the admin UI or writing curl commands, just ask your AI to check what's being blocked, allowlist a domain, or compare stats across instances.
Perfect for homelabbers running multiple Pi-holes (primary + secondary, or per-VLAN), network admins managing DNS filtering at scale, and anyone who wants AI-assisted DNS management.
Features
- Multi-instance support - configure 1 to N Pi-hole instances via environment variables
- Full Pi-hole v6 API coverage - query logs, allow/deny lists (full CRUD), group and client management, blocking control, local DNS (A + CNAME) records, gravity reload, stats
- Smart regex detection - automatically routes domains to exact or regex lists based on metacharacter analysis
- Regex landmine detector - finds deny-exact entries that look like they should be regex (miscategorized rules)
- Docker-ready - multi-stage Dockerfile with non-root user, health checks, and security hardening
- Streamable HTTP or stdio transport - run as a long-lived HTTP service, or let the MCP client spawn it on demand
- Docker secrets support - passwords via env vars or
/run/secrets/files
Quick Start
Docker (recommended)
Node.js
Local on demand (stdio, no Docker)
The MCP client starts the server as a child process when needed and talks to it over stdin/stdout. No port is opened and nothing keeps running in the background.
Register it with Claude Code (user scope):
Or add it manually to your MCP client config:
HOST and PORT from .env are ignored in stdio mode.
Configuration
All configuration is via environment variables. See .env.example for the full reference.
Single Instance
Multiple Instances
For each instance name in PIHOLE_INSTANCES, provide:
Docker secrets are supported as a fallback: /run/secrets/<name>_password (lowercase).
Available MCP Tools
Every tool accepts an optional instance parameter to target a specific Pi-hole. Defaults to the first configured instance.
Connecting to Your MCP Client
This section applies to the HTTP transport (Docker or npm start). For stdio, see Local on demand.
The server listens on http://HOST:PORT/mcp (default: http://localhost:3000/mcp). The HTTP endpoint has no authentication, so keep it bound to localhost or a trusted network.
Claude Desktop / Claude Code
Add to your MCP settings:
Health Check
Development
Requirements
- Node.js >= 20
- Pi-hole v6 with API access enabled
- Network connectivity to your Pi-hole instance(s)
Related Projects
- Pi-hole — Network-wide ad blocking
- Model Context Protocol — Open standard for AI tool integration
- MCP Server Registry — Directory of MCP servers
License
MIT
Source: README.md at commit 40f73e2
Tools
0Version history
1- v0.2.0LatestSep 16, 2026
Score
50% of the applicable checks met
How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.
- Reached in the last 30 days25 pts
Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.
- Auth declared10 pts
Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.
- Tools listed15 pts
Answer tools/list without a credential, or ship a package that starts in a sandbox without one.
- DescriptionRequired15 pts
- Logo10 pts
- Documentation15 pts
- License10 pts