A Model Context Protocol (MCP) server for Pi-hole
Config is the same across clients — only the file and path differ.
{
"mcpServers": {
"pihole-mcp-server": {
"command": "<see-readme>",
"args": []
}
}
}Are you the author?
Add this badge to your README to show your security score and help users find safe servers.
A Model Context Protocol (MCP) server for Pi-hole. This server exposes Pi-hole functionality as tools that can be used by AI assistants.
No automated test available for this server. Check the GitHub README for setup instructions.
Five weighted categories — click any category to see the underlying evidence.
No known CVEs.
No package registry to scan.
Be the first to review
Have you used this server?
Share your experience — it helps other developers decide.
Sign in to write a review.
Others in security / devops
MCP server for using the GitLab API
An evil MCP server used for redteam testing
AI-powered reverse engineering assistant that bridges IDA Pro with language models through MCP.
Enhanced MCP server for GitLab: group projects listing and activity tracking
MCP Security Weekly
Get CVE alerts and security updates for Pihole Mcp Server and similar servers.
Start a conversation
Ask a question, share a tip, or report an issue.
Sign in to join the discussion.
A Model Context Protocol (MCP) server for Pi-hole. This server exposes Pi-hole functionality as tools that can be used by AI assistants.
uv (Optional, for Development)If you want to run the application locally, use uv. Install it with your package manager of choice.
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=...
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.
There are several ways to run the Pi-hole MCP server:
# Standard deployment
docker-compose up -d
The server will be available at http://localhost:8383
For development, use the dev compose file which builds locally:
docker-compose -f docker-compose.dev.yml up
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.
This MCP server exposes the following resources and tools:
piholes://: Returns information about all configured Pi-holesversion://: Returns the MCP server versionlist-tools://: Returns a list of tool categories
list-tools://{category}: Returns a list of tools within a specific categoryEach tool call returns results as a list of dictionaries with the following structure:
[
{
"pihole": "Pi-hole Name",
"data": [...] # Result data from this Pi-hole
},
...
]
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.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 timegooseGoose 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.
goose configure to open the configuration menu.