authenticate
Guide for authenticating with the PI API
Point at a PI API instance, authenticate and set an organization, then filter categories and export charts.
LABSCO SUMMARY
get-filterable-attributes inspects an entity type and reports what can actually be filtered on, which makes the list calls usable without a schema in front of you. Session state is explicit rather than ambient: the base URL, the token and the organization each have their own call, so moving between environments is three calls instead of a restart. Credential login is marked as the last resort, with token refresh as the intended path.
A client for the PI API: session and organization setup, then category and chart operations.
A PI API instance to point at and an account on it. Authentication is by token, with a username and password login available as the fallback.
One command plus a key — npm install -g @mingzilla/pi-api-mcp-server, then supply credentials
USE CASES
Base URL, then a connection check, then a token refresh — each is its own call, so a switch does not require restarting anything.
The filterable attributes are read off a sample entity first, which is what makes the filter expression writable without documentation.
Cascade filters and object positioning are set at creation and adjustable afterwards, and the objects inside are listable separately.
Finding the chart and exporting it are separate steps, and the export format is chosen at call time.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
authenticateGuide for authenticating with the PI API
authenticate-with-credentialsAuthenticate with the PI API using username and password (last resort option)
check-connectionCheck if the current API URL and authentication are valid
create-categoryCreate a new category
delete-categoryDelete a category
delete-chartDelete a chart
export-chartExport a chart in various formats
get-categoryGet a category by ID
get-chartGet a chart by ID
get-filterable-attributesGet the list of attributes that can be used for filtering by examining a sample entity
keep-session-aliveVerify and refresh the current authentication token (also used for token-based authentication)
list-categoriesList all categories with filtering support
list-category-objectsList all objects for a specific category
list-chartsList all charts with filtering support
logoutInvalidate the current token and end the session
set-api-urlSet the API base URL for all requests
set-organizationSet the organization ID for subsequent requests
update-categoryUpdate an existing category
BEFORE YOU INSTALL
18 tools when we connected.
Both documented setups run the server on your machine.
CONTEXT COST
Rated by the size of the 18 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
npm install -g @mingzilla/pi-api-mcp-server{
"mcpServers": {
"pi-api": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"API_URL=http://localhost:8224/pi/api/v2",
"-e",
"PI_API_KEY=<YOUR_PI_API_KEY>",
"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"
]
}
}
}{
"mcpServers": {
"pi-api": {
"command": "npx",
"args": [
"-y",
"@mingzilla/pi-api-mcp-server",
"--api-url",
"http://localhost:8224/pi/api/v2",
"--auth-token",
"<YOUR_PI_API_KEY>"
]
}
}
}