PI API MCP Server
Servidor PI API MCP
Un servidor de Protocolo de Contexto de Modelo (MCP) que proporciona herramientas y recursos estandarizados para interactuar con la API de PI Dashboard. Esta implementación permite a Claude y a otros asistentes de IA compatibles con MCP acceder y gestionar de forma segura los recursos de PI Dashboard, incluyendo categorías y gráficos.
Utilizando PI con MCP
A continuación se muestran escenarios de uso típicos para este servidor MCP después de completar la configuración.
Autenticación inicial:
Ejecute las siguientes instrucciones para establecer una conexión:
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 dashboardAnálisis de gráficos:
Si el ID del gráfico 450 contiene información de metadatos, utilice el siguiente mensaje:
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 insightsEjemplo de salida:

Instalación
Instalación mediante herrería
Para instalar pi-api-mcp-server para Claude Desktop automáticamente a través de Smithery :
npx -y @smithery/cli install @mingzilla/pi-api-mcp-server --client claudeRelated MCP server: tableau-mcp-navi
Instalación - Usando Docker (Recomendado)
No es necesaria la configuración del servidor MCP
Configuración del archivo de configuración del cliente MCP:
{
"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"
]
}
}
}
Nota importante : Si no se proporciona el parámetro --api-url durante la inicialización, el servidor le solicitará que configure la URL de la API con la herramienta set-api-url antes de ejecutar cualquier operación. Este diseño permite una configuración flexible en entornos donde la URL no está predeterminada al inicio.
Ubicación del archivo de configuración
Acceda a la configuración de su aplicación Claude for Desktop en:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonVentanas:
%APPDATA%\Claude\claude_desktop_config.jsonLinux: utilice otras herramientas por ahora, por ejemplo, Cline: pídale que le muestre el archivo de configuración de MCP
Herramientas disponibles
Descubrimiento de esquemas
get-filterable-attributes : obtiene la lista de atributos que se pueden usar para filtrar examinando una entidad de muestra
Get the filterable attributes for chart entities
Gestión de conexiones
check-connection : comprueba si la URL de la API actual y la autenticación son válidas
set-api-url : configura la URL de la API base para todas las solicitudes
Set the API URL to http://localhost:8224/pi/api/v2
Autenticación
autenticar : obtener orientación sobre las opciones de autenticación
authenticate-with-credentials : Autenticar con nombre de usuario y contraseña (opción de último recurso)
keep-session-alive : verifica y actualiza el token de autenticación actual (también se utiliza para la autenticación basada en token)
cerrar sesión : invalida el token actual y finaliza la sesión
set-organization : Establece el ID de la organización para solicitudes posteriores
Categorías
list-categories : enumera todas las categorías con soporte de filtrado
get-category : Obtener una categoría por ID
create-category : Crea una nueva categoría
update-category : Actualizar una categoría existente
delete-category : Eliminar una categoría
list-category-objects : enumera todos los objetos de una categoría específica
Gráficos
list-charts : enumera todos los gráficos con soporte de filtrado
get-chart : Obtener un gráfico por ID
delete-chart : Eliminar un gráfico
export-chart : Exportar un gráfico en varios formatos
Recursos disponibles
auth://status : Obtener el estado de autenticación
categorías://lista : Lista todas las categorías
categorías://{id} : Obtener una categoría específica
categorías://{categoryId}/objects : Obtener objetos para una categoría específica
charts://list : Lista todos los gráficos
charts://{id} : Obtener un gráfico específico
charts://{id}/export/{format} : Exportar un gráfico en un formato específico
Indicaciones disponibles
analizar-categorías : Analizar categorías en el panel
analizar-gráficos : Analizar gráficos en el panel
compare-charts : Compara datos entre dos gráficos
category-usage-analysis : Analiza cómo se utilizan las categorías en los gráficos
use-filters : muestra cómo usar filtros de manera efectiva con esta API
Ejemplos de integración de Claude
A continuación se muestran algunos ejemplos de consultas para utilizar con Claude después de conectarse al servidor:
Establecer la URL de la API
Please use the set-api-url tool to set the PI API URL to http://localhost:8224/pi/api/v2Autenticación
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.Trabajar con categorías
List all categories in the dashboard.Get details about category with ID 123.Trabajar con gráficos
List all the charts available in the dashboard.Export chart with ID 456 as a PDF.Uso de filtros
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.Uso de indicaciones de análisis
Analyze the categories in the dashboard.Compare data between charts 123 and 456.Show me how to use filters effectively with this API.Desarrollo
Ejecución local
Nota: también puedes utilizar
start.shpara ejecutar el servidor de desarrollo.
# Clone the repository (SSH or HTTPS option)
git clone git@github.com: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 startInstalación de NPM
# 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"Configuración del cliente MCP
Integración con Claude para escritorio:
Implementación de Node.js
Ejecute las instrucciones en la sección "Ejecución local"
Asegúrese de que
./dependencies.shse haya ejecutado para instalar las dependencias necesariasImplemente la siguiente configuración (Nota: "@mingzilla/pi-api-mcp-server" hace referencia al paquete instalado a través de "Ejecución local")
{
"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"
]
}
}
}Desarrollo local
Ejecute el servidor usando
./start.shEstablezca la configuración con la ruta al archivo
build/index.js
./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"
]
}
}
}Lista de verificación de desarrollo
actualizar código -> iniciar servidor local -> probar servidor local con ruta de archivo a index.js
Actualizar el archivo readme.md -> cambiar la sección de configuración de mcpServers: docker + node + npx
./publish.sh - publicar en npm
./dockerBuild.sh -> ./dockerPublish.sh (edite el número de versión para que coincida con package.json) -> pruebe la configuración de Docker
enviar código a github
Licencia
Licencia MIT
Autor
Ming Huang (mingzilla)
Available Tools
18 toolsauthenticateC
Guide for authenticating with the PI API
Inputs: no named parameters.
authenticate-with-credentialsA
Authenticate with the PI API using username and password (last resort option)
Inputs: credentials (required).
check-connectionA
Check if the current API URL and authentication are valid
Inputs: no named parameters.
create-categoryC
Create a new category
Inputs: description (required), orgId (required), label, helpText, +2 more.
delete-categoryC
Delete a category
Inputs: id (required).
delete-chartB
Delete a chart
Inputs: id (required).
export-chartC
Export a chart in various formats
Inputs: id (required), format (required).
get-categoryB
Get a category by ID
Inputs: id (required).
get-chartA
Get a chart by ID
Inputs: id (required).
get-filterable-attributesB
Get the list of attributes that can be used for filtering by examining a sample entity
Inputs: entityType (required).
keep-session-aliveC
Verify and refresh the current authentication token (also used for token-based authentication)
Inputs: token.
list-categoriesC
List all categories with filtering support
Inputs: filter, page, pageSize.
list-category-objectsB
List all objects for a specific category
Inputs: categoryId (required).
list-chartsC
List all charts with filtering support
Inputs: filter, page, pageSize.
logoutA
Invalidate the current token and end the session
Inputs: no named parameters.
set-api-urlA
Set the API base URL for all requests
Inputs: url (required).
set-organizationA
Set the organization ID for subsequent requests
Inputs: orgId (required).
update-categoryB
Update an existing category
Inputs: id (required), description, label, helpText, +2 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 18 tools
All 18 tools have clearly distinct purposes. Authentication tools (authenticate, authenticate-with-credentials, check-connection, keep-session-alive, logout) each serve a unique role, and the CRUD tools for categories and charts are well-separated. There is no ambiguity between any pair.
All tool names follow a consistent lowercase-with-hyphens pattern, with verb-noun structure (e.g., create-category, list-charts). Minor exceptions like 'authenticate' (single verb) still fit the pattern, and there is no mixing of conventions.
18 tools is a well-scoped number for a PI API server covering authentication, configuration, category management, and chart operations. It is neither too sparse nor overwhelming, providing a focused yet comprehensive surface.
The tool set includes full CRUD for categories (create, read, update, delete) but only read, delete, and export for charts, missing create and update. This is a notable gap that could hinder agent workflows involving chart lifecycle management.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
MCP server that lets AI assistants use all OneSchema features exposed via the public API.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Related MCP Servers
- AlicenseBqualityBmaintenanceModel Context Protocol (MCP) server that integrates Redash with AI assistants like Claude, allowing them to query data, manage visualizations, and interact with dashboards through natural language.674,587 npm109MIT
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server for Tableau Server. Enables AI assistants to interact with Tableau workbooks, views, datasources, and metadata.24MIT
- FlicenseNot gradedqualityCmaintenanceModel Context Protocol (MCP) server that gives AI assistants a safe, correct data-analyst capability over business metrics - without raw SQL improvisation.-
- AlicenseNot gradedqualityDmaintenanceModel Context Protocol (MCP) server for the MetaWealth Asset Launch Dashboard. It enables AI assistants like ChatGPT and Claude to interact with the MWID Dashboard API for asset management, task tracking, and team collaboration.MIT