pihole-mcp
pihole-mcp
Servidor MCP unificado para Pi-hole v6. Consolida las herramientas útiles de tres MCPs ascendentes (aplaceforallmystuff/mcp-pihole, sbarbett/pihole-mcp-server, cwdcwd/mcp-server-pihole) en un único servidor Python que coincide con la pila chris2ao-unifi-mcp (FastMCP + httpx + Pydantic v2).
Herramientas (28)
Estadísticas (8): get_stats, get_top_blocked, get_top_permitted, get_top_clients, get_query_types, get_forward_destinations, get_recent_blocked, get_history
Consultas (2): get_query_log (filtros avanzados: rango de tiempo, dominio, cliente, upstream, cursor), get_query_suggestions
Bloqueo (3): get_blocking_status, enable_blocking, disable_blocking (con temporizador opcional)
Listas de dominios (6): get_whitelist, get_blacklist, add_to_whitelist, add_to_blacklist, remove_from_whitelist, remove_from_blacklist
DNS local (5): list_local_dns, add_local_a_record, remove_local_a_record, add_local_cname_record, remove_local_cname_record
Mantenimiento (4): update_gravity, flush_cache, flush_logs, get_tail_log
Además de server_info.
Consulte docs/plans/consolidated-tool-map.md para ver el mapeo de endpoints por herramienta.
Related MCP server: Pi-hole MCP Server
Autenticación
Pi-hole v6 utiliza autenticación basada en sesiones. Este servidor la gestiona automáticamente:
POST /api/authcon{"password": "<app-password>"}devuelve un SID de sesión.Todas las llamadas posteriores incluyen
X-FTL-SID: <sid>.En caso de error 401 o proximidad de caducidad, el cliente se vuelve a autenticar y reintenta una vez.
Al apagarse,
DELETE /api/authlibera la sesión.
La contraseña de la aplicación se crea en la interfaz web de Pi-hole: Ajustes > Interfaz web > "Application password" > Generar. Esta es distinta de la contraseña principal de administración web y es la credencial correcta para los clientes de la API.
Instalación
cd /Users/chris2ao/GitProjects/chris2ao-pihole-mcp
uv sync
cp .env.example .env # fill in PIHOLE_URL and PIHOLE_PASSWORD
uv run pytestO mediante el envoltorio (uso en producción con Claude Code):
~/.claude/scripts/pihole-wrapper.shRegistrar en Claude Code
En ~/.claude.json, añada a mcpServers:
"pihole": {
"command": "/Users/chris2ao/.claude/scripts/pihole-wrapper.sh",
"args": []
}El envoltorio obtiene PIHOLE_URL y PIHOLE_PASSWORD de ~/.claude/secrets/secrets.env y luego invoca uv run.
Desarrollo
Ejecutar pruebas:
uv run pytestCobertura:
uv run pytest --cov --cov-report=termPython: 3.12+
Relación con chris2ao-unifi-mcp
Misma pila (FastMCP, httpx, Pydantic-settings, hatchling, uv). Más sencillo que unifi-mcp porque Pi-hole es un producto único (sin carga dinámica de productos ni descubrimiento). Si amplía esto para múltiples Pi-hole o para los elementos faltantes (CRUD de adlist/gravity, grupos, DHCP, Teleporter), siga el patrón de módulo por capacidad de unifi-mcp.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceAn MCP server for managing Cloudron instances that enables monitoring and controlling self-hosted applications, backups, and infrastructure. It provides tools for listing installed apps, retrieving system status, and performing administrative tasks through the Model Context Protocol.19121MIT
- Flicense-qualityDmaintenanceEnables control of Pi-hole v6 ad blocking, allowing users to toggle DNS blocking status and retrieve real-time statistics like query counts and blocked domains. It provides a structured interface for monitoring and managing network-level ad filtering through the Pi-hole REST API.
- AlicenseBqualityDmaintenanceAn MCP server for managing and operating Minecraft servers through multiple backend protocols including MCSManager API, RCON, and MSMP. It provides tools for instance lifecycle management, file operations, console commands, player administration, and server configuration with built-in security controls.712MIT
- AlicenseBqualityDmaintenanceA local MCP server for managing WHM and cPanel servers through AI clients, supporting server health, account, DNS, email, database, SSL, bandwidth, disk, cron, and service-management tools across multiple WHM accounts.31MIT
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personal…
MCP server for Blockscout
MCP server for Google Veo AI video generation
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/chris2ao/pihole-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server