home / mcp / pi api mcp server
Provides standardized tools to interact with the PI Dashboard API, including authentication, categories, and charts management via MCP clients.
Configuration
View docs{
"mcpServers": {
"mingzilla-pi-api-mcp-server": {
"url": "http://localhost:8224/pi/api/v2",
"headers": {
"API_URL": "http://localhost:8224/pi/api/v2",
"PI_API_KEY": "XXXXXXXX"
}
}
}
}You have a Model Context Protocol (MCP) server that provides standardized tools and resources to securely interact with the PI Dashboard API. This server enables Claude and other MCP-compatible assistants to access PI Dashboard resources such as categories and charts, perform authentication, manage data, and export chart data for analysis.
After you have the MCP server running, you can connect from an MCP client and perform common actions like authenticating, listing categories and charts, and exporting chart data for analysis. Start by configuring the base API URL, authenticate, check the connection, and then explore the available resources.
Typical workflow you will follow in day-to-day use: set the API URL, authenticate, verify the connection, list charts, view or export chart data, and run analysis prompts to gain insights from the dashboard.
If you need to analyze a chart or extract metadata, you can retrieve metadata from a specific chart, identify related chart IDs, obtain their JSON data, and analyze the results to generate actionable insights.
Prerequisites you should have before installing include Node.js and npm, or Docker if you prefer containerized execution.
Install via Smithery for automatic client integration with your MCP setup.
npx -y @smithery/cli install @mingzilla/pi-api-mcp-server --client claudeUse Docker to run the MCP server without additional MCP configuration. You will provide environment variables for the API URL and API key.
Create or update your MCP client configuration to include the Docker-based server so that your client can connect and issue commands.
{
"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"
]
}
}
}You will configure the MCP client with the base API URL and credentials for API access. If the API URL is not provided at initialization, you will be prompted to set it before performing any operations.
Environment variables used by the Docker-based server are shown in the example and should be provided in your environment or MCP client configuration.
- Use the provided tools to manage categories and charts, extract filterable attributes, and export charts for external use.
- Ensure authentication tokens are kept secure and rotate tokens as needed. Use the keep-session-alive tool to refresh tokens when using token-based authentication.
Obtain guidance on authenticating with the PI API and establishing a session
Authenticate using a username and password as a last-resort option
Verify and refresh the current authentication token to maintain an active session
Invalidate the current token and end the session
Configure the base API URL used for all requests by the MCP client
Set the organization ID for subsequent requests
Validate the API URL and authentication status to ensure connectivity
Retrieve all categories with optional filtering options
Retrieve a specific category by its ID
Create a new category in the PI Dashboard
Update an existing category by its ID
Delete a category by its ID
List all objects within a specific category
List all charts with optional filtering options
Retrieve a specific chart by its ID
Delete a chart by its ID
Export a chart in various formats