Get the FREE Ultimate OpenClaw Setup Guide →

pi-api

MCP (Model Context Protocol) Server for the PI API

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mingzilla-pi-api-mcp-server docker run -i --rm -e API_URL=http://localhost:8224/pi/api/v2 -e PI_API_KEY=XXXXXXXX mingzilla/pi-api-mcp-server

How to use

This MCP server provides a standardized interface to interact with the PI Dashboard API. It exposes tools to authenticate, manage categories and charts, and retrieve chart metadata and exports, enabling Claude and other MCP-compatible assistants to securely access PI Dashboard resources. Typical workflows include authenticating to establish a session, setting the API URL, listing categories and charts, retrieving specific category or chart data, and exporting charts in various formats. Use the available tools to explore the dashboard programmatically, then leverage analysis prompts to derive insights from categories and charts.

How to install

Prerequisites:

  • Docker installed and running on your machine
  • Access to the PI Dashboard API at a URL like http://localhost:8224/pi/api/v2
  • Optional: Node.js and npm if you prefer local npm/npx usage instead of Docker

Installation steps (Docker, recommended):

  1. Ensure Docker is running.
  2. Copy the provided Docker run command snippet from the README or adapt to your environment.
  3. Run the following command to start the MCP server in Docker: docker run -i --rm -e API_URL=http://localhost:8224/pi/api/v2 -e PI_API_KEY=XXXXXXXX mingzilla/pi-api-mcp-server

Alternative: Local npm/npx setup (if you want to run as a Node package):

  1. Install dependencies and build as described in the repository's Development section.
  2. Run the MCP server with npm or npx, for example: npx @mingzilla/pi-api-mcp-server --api-url http://localhost:8224/pi/api/v2 --auth-token XXXXXXXXX

Configuration tip: If you deploy via Docker, you can predefine environment variables for API_URL and PI_API_KEY as shown in the example. If you run locally, ensure the API URL matches your PI Dashboard instance.

Additional notes

Tips and caveats:

  • If the API URL is not provided at startup when using certain clients, you may be prompted to set it using a set-api-url tool.
  • The provided autoApprove list determines which MCP client actions are permitted without additional confirmation; adjust as needed for your security posture.
  • Ensure the PI_API_KEY (or authentication method) is kept secret and never committed to version control.
  • When using Docker, map or expose ports as needed to allow the MCP client to reach the server.
  • The example assumes the PI Dashboard API is reachable at the configured URL; verify network access and any required CORS or authentication settings on the PI side.

Related MCP Servers

Sponsor this space

Reach thousands of developers