mcp-pihole
Manage Pi-hole v6 blocklists, DNS blocking, domain allow/deny lists, and query diagnostics.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-piholeadd ads.example.com to the deny list"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
mcp-pihole
MCP server for Pi-hole v6. Manage blocklists, DNS blocking, domain allow/deny lists, and query diagnostics through the Model Context Protocol.
Prerequisites
Python 3.14+
Pi-hole v6+ with the REST API enabled
Related MCP server: pihole-mcp
Setup
uv syncConfiguration
Environment Variables
Variable | Required | Description |
| Yes | Base URL of your Pi-hole instance (e.g., |
| No | Web interface password. Omit or leave empty for passwordless instances. |
Claude Code
claude mcp add pihole \
-e PIHOLE_URL=http://192.168.0.160:8080 \
-e PIHOLE_PASSWORD=yourpassword \
-- uvx mcp-piholeOr add to .claude/settings.json:
{
"mcpServers": {
"pihole": {
"command": "uvx",
"args": ["mcp-pihole"],
"env": {
"PIHOLE_URL": "http://192.168.0.160:8080",
"PIHOLE_PASSWORD": "yourpassword"
}
}
}
}Claude Desktop
Add to your Claude Desktop config:
{
"mcpServers": {
"pihole": {
"command": "uvx",
"args": ["mcp-pihole"],
"env": {
"PIHOLE_URL": "http://192.168.0.160:8080",
"PIHOLE_PASSWORD": "yourpassword"
}
}
}
}Tools
Diagnostics
Tool | Description |
| Pi-hole status summary (queries, blocked count, blocking state) |
| Top queried or blocked domains |
| Top DNS clients by query count |
| Recent DNS query log with cursor-based pagination |
| Pi-hole FTL version information |
Blocklist Management
Tool | Description |
| List all configured blocklists |
| Add a blocklist URL |
| Remove a blocklist by URL |
| Enable/disable a blocklist or update its comment |
| Rebuild gravity database (required after blocklist changes) |
Domain Management
Tool | Description |
| List allow/deny domains (exact or regex) |
| Add a domain to allow or deny list |
| Remove a domain from allow or deny list |
| Check if a domain is blocked and by which list |
DNS Control and DHCP
Tool | Description |
| Current DNS blocking status and timer |
| Enable/disable blocking, optionally with a timer |
| Current DHCP leases |
| Restart the DNS resolver |
Development
uv sync
uv run pytest tests/ -x -q
uv run ruff check src/ tests/
uv run pyright src/Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/obrien-matthew/mcp-pihole'
If you have feedback or need assistance with the MCP directory API, please join our Discord server