PiHole MCP Server

by JafarKhQ

321 downloads
Not rated
GitHub

About

PiHole MCP Server is a Java-based MCP (Model Context Protocol) server that enables AI applications to manage a Pi-hole instance through standard commands. It is designed for users who want to control Pi-hole DNS blocking, domain lists, and retrieve statistics from an AI…

Details

Author
JafarKhQ
Downloads
321
Categories
Other

- Restart the Pi-hole FTL DNS service.
- Get or set DNS blocking status with optional disable timer.
- Add domains to allowlist or denylist (exact or regex).
- Retrieve Pi-hole statistics (total queries, blocked, top domains).
- Fetch system information (CPU, memory, blocking percentage, uptime).

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name PiHole MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Ensure Java 21 is installed, download the JAR from the releases page, and configure your AI client with the server command (java -jar /path/to/pihole-mcp.jar) and environment variables (PIHOLE_HOST, PIHOLE_APP_PASSWORD, and optionally PIHOLE_PORT). Then, restart the client to make the tools available.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "pihole mcp server": {
            "pihole-mcp-server-java": {
                "command": "java",
                "args": [
                    "-jar",
                    "/absolute/path/to/pihole-mcp.jar"
                ],
                "env": {
                    "PIHOLE_PORT": "8080",
                    "PIHOLE_HOST": "192.168.1.2",
                    "PIHOLE_APP_PASSWORD": "your_app_password"
                }
            }
        }
    }
}

McpServers

{
    "pihole-mcp-server-java": {
        "command": "java",
        "args": [
            "-jar",
            "/absolute/path/to/pihole-mcp.jar"
        ],
        "env": {
            "PIHOLE_PORT": "8080",
            "PIHOLE_HOST": "192.168.1.2",
            "PIHOLE_APP_PASSWORD": "your_app_password"
        }
    }
}

Pi-hole MCP Server

Manage Pi-hole with the power of AI

A Pi-hole MCP (Model Control Protocol) server implemented in Java that allows AI applications to interact with and manage a Pi-hole instance through standard commands.

Features

- Core AI tools - Restart Pi-hole FTL Service — restart the Pi-hole FTL DNS service to apply changes or recover. - Get Pi-hole DNS Blocking Status — retrieve current blocking mode and remaining timer. - Set Pi-hole DNS Blocking Status — enable/disable DNS blocking; optionally set a disable duration (seconds). - Add New Domain — add domains to allowlist/denylist (supports exact and regex kinds) with validation and optional comment. - Retrive Pi-hole Statistics — fetch statistics like total queries, blocked queries, and top domains. - Retrive Pi-hole System Information — get system info including CPU load, memory usage, blocking percentage, and uptime.

Running the Server

To run the MCP server, you need to have Java 21 installed on your machine. 1. Download the Pi-hole MCP server JAR file from the releases page 2. Add MCP server configuration to your AI application client. JSON configuration example: ``json { "mcpServers": { "pihole-mcp-server-java": { "command": "java", "args": [ "-jar", "/absolute/path/to/pihole-mcp.jar" ], "env": { "PIHOLE_PORT": "8080", "PIHOLE_HOST": "192.168.1.2", "PIHOLE_APP_PASSWORD": "your_app_password" } } } } ` YAML configuration example: `yaml name: pihole-mcp-server-java version: 0.0.1 schema: v1 mcpServers: - name: pihole-mcp-server-java command: java args: - -jar - /absolute/path/to/pihole-mcp.jar env: { "PIHOLE_PORT": "8080", "PIHOLE_HOST": "192.168.1.2", "PIHOLE_APP_PASSWORD": "your_app_password" } `

Environment Variables

Make sure to set the following environment variables: -
PIHOLE_PORT: (Optional) The port on which your Pi-hole instance is running (default is 80). - PIHOLE_HOST: The IP address or hostname of your Pi-hole instance. - PIHOLE_APP_PASSWORD`: The application password for your Pi-hole instance.
No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.