Skip to main content
Glama

Pi-hole MCP Server

by sbarbett
common.py1.06 kB
""" Pi-hole MCP resources """ from typing import Dict, List def register_resources(mcp, pihole_clients, get_version): """Register common resources with the MCP server.""" @mcp.resource("piholes://", description="Return information about all configured Pi-holes") def all_piholes() -> Dict[str, List[Dict[str, str]]]: """Return information about all configured Pi-holes Returns: Dict[str, List[Dict[str, str]]]: A dictionary containing a list of Pi-holes """ piholes_list = [{"name": name, "url": client.connection.base_url} for name, client in pihole_clients.items()] return {"piholes": piholes_list} @mcp.resource("version://", description="Return the current version of the Pi-hole MCP server") def server_version() -> Dict[str, str]: """Return the current version of the Pi-hole MCP server Returns: Dict[str, str]: A dictionary containing the version of the Pi-hole MCP server """ return {"version": get_version()}

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/sbarbett/pihole-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server