pihole-mcp-server
A Model Context Protocol (MCP) server for Pi-hole
Install / Use
claude mcp add sbarbett -- npx -y github:sbarbett/pihole-mcp-serverIf the server publishes to npm under a different name, use that package instead ā check the repo README.
MCP Server
Model Context Protocol server
Quality Score
Category
OperationsSupported Platforms
Our assessment of pihole-mcp-server
pihole-mcp-server scores 63/100 on our quality scale, 698th of 746 Operations skills we index.
Its MCP Server is 5.4 KB long, well organised into 24 sections with 9 code examples: a solid amount of guidance for an agent.
It has 10 GitHub stars, so there is little community track record yet; judge it on its content.
Maintenance, license and trust
- The repository was last updated about 15 months ago. Expect some instructions to reference tool versions or APIs that have since changed.
- It is released under the MIT license, a permissive license that allows use, modification and commercial use with attribution.
- Its trust signals score 80/100, with 2 cautions from licensing, adoption, age or documentation. These come from repository metadata, not a code audit ā read the skill file before letting an agent act on it.
pihole-mcp-server compared with similar skills
All 4 of these similar skills score higher than pihole-mcp-server; compare them before choosing.
| Skill | Score | Stars | Updated | Format |
|---|---|---|---|---|
| pihole-mcp-server (this skill)by sbarbett | 63 | 10 | 15mo ago | MCP Server |
| Agent-Reachby Panniantong | 100 | 94.8k | 1d ago | CLAUDE.md |
| headroomby headroomlabs-ai | 100 | 74.8k | today | CLAUDE.md |
| CowAgentby zhayujie | 100 | 47.3k | today | CLAUDE.md |
| Scraplingby D4Vinci | 100 | 86.5k | 1d ago | MCP Server |
Frequently asked questions
- How do I install pihole-mcp-server?
- Run
claude mcp add sbarbett -- npx -y github:sbarbett/pihole-mcp-server. The install tabs above show the steps for each supported agent. - Which AI agents does pihole-mcp-server work with?
- It is written for Claude Code and Claude Desktop, as a MCP Server file. Other agents that read the same format can often use it too.
- Is pihole-mcp-server safe to use?
- It is MIT-licensed and scores 80/100 on trust signals. Skills are instructions an agent will follow, so read the file before installing it and do not approve commands you do not understand.
- Is pihole-mcp-server still maintained?
- The repository was last updated about 15 months ago. Expect some instructions to reference tool versions or APIs that have since changed.
Skill content
View source on GitHubš pihole-mcp-serer
A Model Context Protocol (MCP) server for Pi-hole. This server exposes Pi-hole functionality as tools that can be used by AI assistants.
Dependencies
Docker
uv (Optional, for Development)
If you want to run the application locally, use uv. Install it with your package manager of choice.
Environment
Create a .env file in the project root with your Pi-hole credentials:
# Primary Pi-hole (required)
PIHOLE_URL=https://your-pihole.local/
PIHOLE_PASSWORD=your-admin-password
#PIHOLE_NAME=Primary # optional, defaults to URL if unset
# Secondary Pi-hole (optional)
#PIHOLE2_URL=https://secondary-pihole.local/
#PIHOLE2_PASSWORD=password2
#PIHOLE2_NAME=Secondary # optional
# Up to 4 Pi-holes:
#PIHOLE3_URL=...
#PIHOLE3_PASSWORD=...
#PIHOLE3_NAME=...
#PIHOLE4_URL=...
#PIHOLE4_PASSWORD=...
#PIHOLE4_NAME=...
Project Structure
The project follows a modular organization for better maintainability:
/
āāā main.py # Main application entry point
āāā tools/ # Pi-hole tools organized by functionality
ā āāā __init__.py
ā āāā config.py # Configuration-related tools (DNS settings)
ā āāā metrics.py # Metrics and query-related tools
āāā resources/ # MCP resources
ā āāā __init__.py
ā āāā common.py # Common resources (piholes://, version://)
āāā docker-compose.yml # Docker Compose configuration for production
āāā docker-compose.dev.yml # Docker Compose for development with volume mounts
āāā Dockerfile # Docker build configuration
This structure separates the code into logical components while maintaining compatibility with all run modes.
Running the Server
There are several ways to run the Pi-hole MCP server:
Using Docker (Recommended for Production)
# Standard deployment
docker-compose up -d
The server will be available at http://localhost:8383
Development Mode with Docker
For development, use the dev compose file which builds locally:
docker-compose -f docker-compose.dev.yml up
MCP Inspector
You can run the MCP inspector using uv and the mcp CLI:
uv run mcp dev main.py
This will start an interactive interface at http://localhost:6274 where you can test tools and resources.
API
This MCP server exposes the following resources and tools:
Resources
piholes://: Returns information about all configured Pi-holesversion://: Returns the MCP server versionlist-tools://: Returns a list of tool categorieslist-tools://{category}: Returns a list of tools within a specific category
Tools
Each tool call returns results as a list of dictionaries with the following structure:
[
{
"pihole": "Pi-hole Name",
"data": [...] # Result data from this Pi-hole
},
...
]
Configuration
list_local_dns: Lists all local DNS settings from Pi-hole(s)add_local_a_record: Adds a local A record to Pi-hole(s).add_local_cname_record: Adds a local CNAME record to Pi-hole(s).remove_local_a_record: Removes all A records for a hostname.remove_local_cname_record: Removes all CNAME records for a hostname.
Metrics
list_queries: Fetches the recent DNS query history from Pi-hole(s)list_query_suggestions: Get query filter suggestionslist_query_history: Get activity graph data for queries over time
Testing in goose
Goose is a CLI LLM client that's useful for testing and development. Follow their install instructions here.
The following assumes you've completed the initial setup with goose configure.
Configure Extension
- Type
goose configureto open the configuration menu. - Select Add Extension
- Select Remote Extension
- It will ask for a name. It doesn't matter what you name it. I called mine
pihole-mcp. - When it asks "What is the SSE endpoint URI?" enter
http://localhost:8383/sse. - Enter a timeout.
- Add a description if you'd like.
- Select No when it asks about environment variables.

Start a Session
Once the server is installed, start a chat session.
goose session
Try asking it: "What are my local DNS records?"

...or telling it: "Show me my recent DNS queries."

Claude Desktop
Claude's desktop client currently only support's the STDIO protocol, however you can use a proxy to communicate with the SSE endpoint.
Add the following to your claude_desktop_config.json file.
{
"mcpServers": {
"pihole": {
"command": "npx",
"args": [
"mcp-remote",
"http://localhost:8383/sse"
]
}
}
}
If you're connecting to a different host on your local network and using an unsecured connection, you'll need to explicitly allow it with the --allow-http argument. For example:
{
"mcpServers": {
"pihole": {
"command": "npx",
"args": [
"mcp-remote",
"http://192.168.1.255:8383/sse",
"--allow-http"
]
}
}
}
Afterwards, completely restart the application and try it out.


License
Related Skills
Agent-Reach
94.8kGive your AI agent eyes to see the entire internet. Read & search Twitter, Reddit, YouTube, GitHub, Bilibili, XiaoHongShu ā one CLI, zero API fees.
headroom
74.8kCompress tool outputs, logs, files, and RAG chunks before they reach the LLM. 20% fewer tokens for coding agents, 60-95% fewer tokens for JSON, same answers. Library, proxy, MCP server.
CowAgent
47.3kOpen-source personal AI assistant & Agent Harness. Plans tasks, runs tools and skills, self-evolves with memory and knowledge. Multi-agent, multi-model, multi-channel. Lightweight, extensible, one-line install.
Scrapling
86.5kš·ļø An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
Languages
Trust signals
From repository metadata: license, adoption, age and documentation. Not a code audit ā see the Safety scan above for what the skill file itself contains.
