MCP server for Pi-hole v6 API - control DNS blocking from Claude Code
Setup
Choose your client, copy the config, then fill in any required environment variables.
claude mcp add pihole --env PIHOLE_URL='<PIHOLE_URL>' --env PIHOLE_PASSWORD='<PIHOLE_PASSWORD>' -- npx -y mcp-pihole-server~/.codex/config.toml
[mcp_servers.pihole]
command = "npx"
args = ["-y", "mcp-pihole-server"]
env = { PIHOLE_URL = "<PIHOLE_URL>", PIHOLE_PASSWORD = "<PIHOLE_PASSWORD>" }
# codex mcp add pihole --env PIHOLE_URL='<PIHOLE_URL>' --env PIHOLE_PASSWORD='<PIHOLE_PASSWORD>' -- npx -y mcp-pihole-server~/.cursor/mcp.json
{
"mcpServers": {
"pihole": {
"command": "npx",
"args": [
"-y",
"mcp-pihole-server"
],
"env": {
"PIHOLE_URL": "<PIHOLE_URL>",
"PIHOLE_PASSWORD": "<PIHOLE_PASSWORD>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"pihole": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"mcp-pihole-server"
],
"env": {
"PIHOLE_URL": "<PIHOLE_URL>",
"PIHOLE_PASSWORD": "<PIHOLE_PASSWORD>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"pihole": {
"command": "npx",
"args": [
"-y",
"mcp-pihole-server"
],
"env": {
"PIHOLE_URL": "<PIHOLE_URL>",
"PIHOLE_PASSWORD": "<PIHOLE_PASSWORD>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"pihole": {
"command": "npx",
"args": [
"-y",
"mcp-pihole-server"
],
"env": {
"PIHOLE_URL": "<PIHOLE_URL>",
"PIHOLE_PASSWORD": "<PIHOLE_PASSWORD>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"pihole": {
"command": "npx",
"args": [
"-y",
"mcp-pihole-server"
],
"env": {
"PIHOLE_URL": "<PIHOLE_URL>",
"PIHOLE_PASSWORD": "<PIHOLE_PASSWORD>"
}
}
}
}Environment variables
PIHOLE_URLPIHOLE_PASSWORD
Replace the placeholders with your own credentials and keep them out of version control.