mingzilla_pi_api_mcp_server

mingzilla_pi_api_mcp_server

by mingzilla
An MCP server enabling Claude and other AI assistants to securely access and manage PI Dashboard resources.

PI Dashboard API Integration for Claude

Overview

The PI Dashboard API Integration for Claude is a Model Context Protocol (MCP) server designed to provide 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.

Features

  • Secure Access: Enables secure access to PI Dashboard resources.
  • Standardized Tools: Provides a set of standardized tools for interacting with the API.
  • Claude Integration: Seamlessly integrates with Claude for enhanced data analysis and management.

Installation

Installing via Smithery

To install the PI Dashboard API Integration for Claude automatically via Smithery:

npx -y @smithery/cli install @mingzilla/pi-api-mcp-server --client claude

Using Docker (Recommended)

  1. No MCP Server configuration needed.
  2. MCP client configuration file setup:
{
  "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.

Configuration File Location

Access your Claude for Desktop application configuration at:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: Use other tools for now. e.g., Cline - ask it to show you the MCP config file.

Available Tools

Schema Discovery

  • get-filterable-attributes: Get the list of attributes that can be used for filtering by examining a sample entity.

Connection Management

  • check-connection: Check if the current API URL and authentication are valid.
  • set-api-url: Configure the base API URL for all requests.

Authentication

  • authenticate: Get guidance on authentication options.
  • authenticate-with-credentials: Authenticate with username and password (last resort option).
  • keep-session-alive: Verify and refresh the current authentication token (also used for token-based authentication).
  • logout: Invalidate the current token and end the session.
  • set-organization: Set the organization ID for subsequent requests.

Categories

  • list-categories: List all categories with filtering support.
  • get-category: Get a category by ID.
  • create-category: Create a new category.
  • update-category: Update an existing category.
  • delete-category: Delete a category.
  • list-category-objects: List all objects for a specific category.

Charts

  • list-charts: List all charts with filtering support.
  • get-chart: Get a chart by ID.
  • delete-chart: Delete a chart.
  • export-chart: Export a chart in various formats.

Available Resources

  • auth://status: Get authentication status.
  • categories://list: List all categories.
  • categories://{id}: Get a specific category.
  • categories://{categoryId}/objects: Get objects for a specific category.
  • charts://list: List all charts.
  • charts://{id}: Get a specific chart.
  • charts://{id}/export/{format}: Export a chart in a specific format.

Available Prompts

  • analyze-categories: Analyze categories in the dashboard.
  • analyze-charts: Analyze charts in the dashboard.
  • compare-charts: Compare data between two charts.
  • category-usage-analysis: Analyze how categories are being used in charts.
  • use-filters: Shows how to use filters effectively with this API.

Claude Integration Examples

Set the API URL

Please use the set-api-url tool to set the PI API URL to http://localhost:8224/pi/api/v2

Authentication

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.

Working with Categories

List all categories in the dashboard.
Get details about category with ID 123.

Working with Charts

List all the charts available in the dashboard.
Export chart with ID 456 as a PDF.

Using Filters

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.

Using Analysis Prompts

Analyze the categories in the dashboard.
Compare data between charts 123 and 456.
Show me how to use filters effectively with this API.

Development

Local Execution

# 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

NPM Installation

# 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"

MCP Client Configuration

Node.js Implementation

{
  "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"
      ]
    }
  }
}

Local Development

./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"
      ]
    }
  }
}

License

MIT License

Author

Ming Huang (mingzilla)

smithery badge

Features & Capabilities

Categories
mcp_server model_context_protocol claude api_integration docker javascript shell search

Implementation Details

Stats

0 Views
1 GitHub Stars

Repository Info

mingzilla Organization

Similar MCP Servers

continuedev_continue by continuedev
25049
21423
9300