local-only server
The server can only run on the client’s local machine because it depends on local resources.
Integrations
Exposes Pi-hole functionality through tools for listing local DNS settings and retrieving recent DNS query history from a Pi-hole instance.
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.
Features
- ListLocalDNS: Returns all local DNS settings from Pi-hole
- ListQueries: Returns recent DNS query history from Pi-hole
- Multiple Pi-hole Support: Manage up to 4 Pi-holes from a single MCP server
- ...more to come...
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:
Docker Deployment
Run the Pi-hole MCP server in Docker.
Using Docker Compose
- Pull and start the container:Copy
- The server will be available at
http://localhost:8383
Manual Docker Build
Alternatively, you can build and run the Docker container manually:
Run Locally
The Docker deployment uses SSE mode for two-way communication between the host and container. You could (theoretically) use STDIO mode with Docker exec. If you want to run it locally, though, you can simply run it with uv
. This is particularly useful for quickly inspecting tools and resources with the inbuilt mcp
dev utilities. For example:
Then in your web browser navigate to http://localhost:6274
.
API
This MCP server exposes the following resources and tools:
Resources
piholes://
: Returns information about all configured Pi-holes
Tools
list_local_dns
: Lists all local DNS settings from Pi-hole(s)list_queries
: Fetches the recent DNS query history from Pi-hole(s)
Each tool call returns results as a list of dictionaries with the following structure:
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 configure
to 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.
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.
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:
Afterwards, completely restart the application and try it out.
License
This server cannot be installed
A server that exposes Pi-hole functionality as tools for AI assistants, allowing them to retrieve local DNS settings and query history through natural language.