pihole-mcp
pihole-mcp
Einheitlicher Pi-hole v6 MCP-Server. Fasst die nützlichen Tools aus drei Upstream-MCPs (aplaceforallmystuff/mcp-pihole, sbarbett/pihole-mcp-server, cwdcwd/mcp-server-pihole) in einem Python-Server zusammen, der dem chris2ao-unifi-mcp-Stack (FastMCP + httpx + Pydantic v2) entspricht.
Tools (28)
Statistiken (8): get_stats, get_top_blocked, get_top_permitted, get_top_clients, get_query_types, get_forward_destinations, get_recent_blocked, get_history
Abfragen (2): get_query_log (umfangreiche Filter: Zeitbereich, Domain, Client, Upstream, Cursor), get_query_suggestions
Blockierung (3): get_blocking_status, enable_blocking, disable_blocking (mit optionalem Timer)
Domain-Listen (6): get_whitelist, get_blacklist, add_to_whitelist, add_to_blacklist, remove_from_whitelist, remove_from_blacklist
Lokales DNS (5): list_local_dns, add_local_a_record, remove_local_a_record, add_local_cname_record, remove_local_cname_record
Wartung (4): update_gravity, flush_cache, flush_logs, get_tail_log
Plus server_info.
Siehe docs/plans/consolidated-tool-map.md für die Tool-zu-Endpunkt-Zuordnung.
Related MCP server: Pi-hole MCP Server
Authentifizierung
Pi-hole v6 verwendet eine sitzungsbasierte Authentifizierung. Dieser Server handhabt dies automatisch:
POST /api/authmit{"password": "<app-password>"}gibt eine Sitzungs-SID zurück.Alle nachfolgenden Aufrufe enthalten
X-FTL-SID: <sid>.Bei einem 401-Fehler oder kurz vor Ablauf der Gültigkeit authentifiziert sich der Client erneut und versucht es einmal erneut.
Beim Herunterfahren gibt
DELETE /api/authdie Sitzung frei.
Das App-Passwort wird in der Pi-hole Web-UI erstellt: Einstellungen > Web-Oberfläche > "Anwendungspasswort" > Generieren. Dies ist getrennt vom Haupt-Admin-Web-Passwort und ist das korrekte Anmeldeinformations-Format für API-Clients.
Installation
cd /Users/chris2ao/GitProjects/chris2ao-pihole-mcp
uv sync
cp .env.example .env # fill in PIHOLE_URL and PIHOLE_PASSWORD
uv run pytestOder über den Wrapper (Produktionseinsatz mit Claude Code):
~/.claude/scripts/pihole-wrapper.shRegistrierung bei Claude Code
Fügen Sie in ~/.claude.json Folgendes zu mcpServers hinzu:
"pihole": {
"command": "/Users/chris2ao/.claude/scripts/pihole-wrapper.sh",
"args": []
}Der Wrapper lädt ~/.claude/secrets/secrets.env für PIHOLE_URL und PIHOLE_PASSWORD und ruft dann uv run auf.
Entwicklung
Tests ausführen:
uv run pytestAbdeckung:
uv run pytest --cov --cov-report=termPython: 3.12+
Beziehung zu chris2ao-unifi-mcp
Gleicher Stack (FastMCP, httpx, Pydantic-settings, hatchling, uv). Einfacher als unifi-mcp, da Pi-hole ein einzelnes Produkt ist (kein dynamisches Laden oder Erkennen von Produkten). Wenn Sie dies für mehrere Pi-holes oder für die fehlenden Punkte (Adlist/Gravity CRUD, Gruppen, DHCP, Teleporter) erweitern, folgen Sie dem Modul-pro-Fähigkeit-Muster von 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