1. Conduid
  2. Cloud
  3. Pihole MCP Server
MCP server · Cloud

Pihole MCP Server

A Model Context Protocol (MCP) server for Pi-hole

Unclaimed MIT last commit a year ago devtools
55Fair

Scored yesterday · breakdown

About Pihole MCP Server

Pihole MCP Server is an MCP server published by sbarbett in the Cloud category: a Model Context Protocol (MCP) server for Pi-hole.

The repository has 10 stars and 10 forks, with the last commit a year ago. Six months or more without a commit doesn't mean the server is broken, but check the open issues before depending on it in production.

Install

uvx
uvx pihole-mcp-server
pip
pip install pihole-mcp-server

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Tools (8)

add_local_a_recordAdds a local A record to Pi-hole(s).

Parameters not published.

add_local_cname_recordAdds a local CNAME record to Pi-hole(s).

Parameters not published.

list_local_dnsLists all local DNS settings from Pi-hole(s)

Parameters not published.

list_queriesFetches the recent DNS query history from Pi-hole(s)

Parameters not published.

list_query_historyGet activity graph data for queries over time

Parameters not published.

list_query_suggestionsGet query filter suggestions

Parameters not published.

remove_local_a_recordRemoves all A records for a hostname.

Parameters not published.

remove_local_cname_recordRemoves all CNAME records for a hostname.

Parameters not published.

Ask AI

✦

Ask AI about Pihole MCP Server

Powered by Claude · Grounded in docs

I know everything about Pihole MCP Server. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

Static checks derived from the repository 2 hours ago. Heuristics on the source, not an audit.

  • ✓README presentThe repository ships documentation.
  • ✓License declaredUsable under a stated license.
  • !Tests presentNo tests found. Behaviour changes may go unnoticed between versions.
  • ✓Dependencies pinnedA lockfile pins dependency versions.
  • ✓No dynamic code executionSource scan found no eval, dynamic Function, or shell execution.
  • !Scoped permissionsDoesn't declare a permission scope. Assume it can do anything its process can.

Releases

v0.2.1PiHoleMCPServer v0.2.1 — Manage Local DNS, System Prompt & Descriptors/Instructions · 27 Apr 2025DNS Management Tools `add_local_a_record`: add local A records to Pi-hole `add_local_cname_record`: add local CNAME records to Pi-hole `remove_local_a_record`: preview and delete all A records for a hostname (requires confirmation)…
v0.2.0PiHoleMCPServer v0.2.0 – Project Modularity, Version Resource & New Tools · 20 Apr 2025Overview Minor additions to the metrics API, a server‑version resource, and a fully modular codebase. Added Granular query parameters in `list_queries` for filtering by time range, client, domain, upstream, cursor, etc. New metrics…
v0.1.1PiHoleMCPServer v0.1.1 – Multi-PiHole Support, CI/CD, CHANGELOG, Session Management · 19 Apr 2025Highlights You can now register and manage up to 4 Pi‑holes via environment variables. The MCP server exposes a `piholes://` resource so clients can discover your configured Pi‑holes. CI/CD: Each new release automatically builds & pushes a…

README

🍓 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-holes
  • version://: Returns the MCP server version
  • list-tools://: Returns a list of tool categories
    • list-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 suggestions
  • list_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

  1. Type goose configure to open the configuration menu.
  2. Select Add Extension
  3. Select Remote Extension
  4. It will ask for a name. It doesn't matter what you name it. I called mine pihole-mcp.
  5. When it asks "What is the SSE endpoint URI?" enter http://localhost:8383/sse.
  6. Enter a timeout.
  7. Add a description if you'd like.
  8. Select No when it asks about environment variables. Screenshot of configuration

Start a Session

Once the server is installed, start a chat session.

goose session

Try asking it: "What are my local DNS records?"

Screenshot of local DNS tool

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

Screenshot of 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.

Claude DNS info

Claude query info

License

MIT

README fetched from the repository 2 hours ago. The original is authoritative.

Questions

About Pihole MCP Server

How do I install Pihole MCP Server?

Run uvx pihole-mcp-server, then add the server to your MCP client's configuration.

Is Pihole MCP Server safe to use with an AI agent?

Its trust score is 55 out of 100 (fair). It passes 4 of the 6 static security checks run so far; the failures are listed above. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Pihole MCP Server still maintained?

The last commit was a year ago and 6 open issues. That's long enough that you should check whether the maintainer is responding to issues before depending on it.