PI Dashboard Integration
STDIOMCP server providing standardized tools for interacting with PI Dashboard API.
MCP server providing standardized tools for interacting with PI Dashboard API.
A Model Context Protocol (MCP) server that provides standardized tools and resources for interacting with the PI Dashboard API. This implementation enables Claude and other MCP-compatible AI assistants to securely access and manage PI Dashboard resources, including categories and charts.
The following demonstrates typical usage scenarios for this MCP Server after setup completion.
Initial Authentication:
Ensure the PI API MCP server is running
Set the API URL to http://localhost:8224/pi/api/v2
Use the authenticate tool for authentication guidance
Check the connection status to verify everything is working
List two charts from the dashboard
Chart Analysis:
Retrieve the metadata from chart ID 450
Extract the chart JSON data from ID 450
Identify chart IDs associated with claims
Obtain JSON data for the identified charts
Analyze the data to generate actionable insights
Example Output:
To install pi-api-mcp-server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @mingzilla/pi-api-mcp-server --client claude
{ "mcpServers": { "pi-api": { "command": "docker", "args": [ "run", "-i", "--rm", "-e", "API_URL=http://localhost:8224/pi/api/v2", "-e", "PI_API_KEY=XXXXXXXX", "mingzilla/pi-api-mcp-server" ], "disabled": false, "autoApprove": [ "keep-session-alive", "check-connection", "authenticate", "list-categories", "get-category", "list-charts", "get-chart", "export-chart", "get-filterable-attributes", "export-chart" ] } } }
Important Note: If the --api-url
parameter is not provided at initialization, the server will prompt you to configure the API URL using the set-api-url
tool before executing any operations. This design enables flexible configuration in environments where the URL is not predetermined at startup.
Access your Claude for Desktop application configuration at:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
Get the filterable attributes for chart entities
Set the API URL to http://localhost:8224/pi/api/v2
Here are some example queries to use with Claude after connecting the server:
Please use the set-api-url tool to set the PI API URL to http://localhost:8224/pi/api/v2
Please help me authenticate to the PI API.
I have a token. Please use the keep-session-alive tool with my token: [YOUR_TOKEN_HERE]
Please check if my connection to the PI API is working properly.
List all categories in the dashboard.
Get details about category with ID 123.
List all the charts available in the dashboard.
Export chart with ID 456 as a PDF.
Get the filterable attributes for chart entities to understand what fields I can filter on.
List charts with description containing "revenue" using the filter option.
Analyze the categories in the dashboard.
Compare data between charts 123 and 456.
Show me how to use filters effectively with this API.
start.sh
to run the dev server as well.# Clone the repository (SSH or HTTPS option) git clone [email protected]:mingzilla/pi-api-mcp-server.git cd pi-api-mcp-server # Install dependencies npm install ./dependencies.sh # Installs global dependencies to enable MCP client connection via "@mingzilla/pi-api-mcp-server" # Build the project npm run build # Execute the server npm start
# Global installation npm install -g @mingzilla/pi-api-mcp-server # Direct execution via npx npx @mingzilla/pi-api-mcp-server --api-url "http://localhost:8224/pi/api/v2" --auth-token "XXXXXXXX"
Integration with Claude for Desktop:
./dependencies.sh
has been executed to install required dependencies{ "mcpServers": { "pi-api": { "command": "npx", "args": [ "-y", "@mingzilla/pi-api-mcp-server", "--api-url", "http://localhost:8224/pi/api/v2", "--auth-token", "XXXXXXXX" ], "autoApprove": [ "keep-session-alive", "check-connection", "authenticate", "list-categories", "get-category", "list-charts", "get-chart", "export-chart", "get-filterable-attributes", "export-chart" ] } } }
./start.sh
build/index.js
file./start.sh
{ "mcpServers": { "pi-api": { "command": "node", "args": [ "/home/mingzilla/dev/tool-mcp-pi-api-server/build/index.js", "--api-url", "http://localhost:8224/pi/api/v2", "--auth-token", "XXXXXXXX" ], "autoApprove": [ "keep-session-alive", "check-connection", "authenticate", "list-categories", "get-category", "list-charts", "get-chart", "export-chart", "get-filterable-attributes", "export-chart" ] } } }
MIT License
Ming Huang (mingzilla)