PolarHub
  • Agents
  • MCP Servers
  • Skills
  • PolarBear
PolarHub © 2026
MCP ServersdatabasesMCP PI 仪表板服务器
返回「databases」

MCP PI 仪表板服务器

modelscope·@mingzilla/pi-api-mcp-server

databases0下载LocalModelScope

简介

一个模型上下文协议(MCP)服务器,使克劳德及其他与MCP兼容的AI助手能够安全地访问和管理PI仪表板资源,包括分类和图表。

MCP Server 详情

来自 ModelScope 索引

PI API MCP 服务器

smithery 徽章

这是一个 Model Context Protocol (MCP) 服务器,为与 PI 仪表板 API 交互提供了标准化的工具和资源。此实现使 Claude 和其他兼容 MCP 的 AI 助手能够安全地访问和管理 PI 仪表板资源,包括类别和图表。

使用 MCP 与 PI 交互

以下是在完成设置后,此 MCP 服务器的典型使用场景示例。

初始认证:

  • 执行以下指令以建立连接:
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

图表分析:

  • 如果图表 ID 450 包含元数据信息,请使用以下提示:
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-response.png

安装

通过 Smithery 安装

要通过 Smithery 自动安装 pi-api-mcp-server 到 Claude Desktop:

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

安装 - 使用 Docker(推荐)

  • 不需要配置 MCP 服务器
  • 配置 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"
      ]
    }
  }
}

重要提示:如果在初始化时未提供 --api-url 参数,服务器会在执行任何操作之前提示您使用 set-api-url 工具配置 API URL。这种设计使得在启动时 URL 尚未确定的环境中也能灵活配置。

配置文件位置

访问您的 Claude for Desktop 应用程序配置文件的位置如下:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: 目前请使用其他工具。例如 Cline - 请求它显示 MCP 配置文件

可用工具

模式发现

  • get-filterable-attributes: 通过检查样本实体来获取可用于过滤的属性列表
    获取图表实体的可过滤属性
    

连接管理

  • check-connection: 检查当前 API URL 和认证是否有效
  • set-api-url: 为所有请求配置基础 API URL
    将 API URL 设置为 http://localhost:8224/pi/api/v2
    

认证

  • authenticate: 获取认证选项的指导
  • authenticate-with-credentials: 使用用户名和密码进行认证(最后手段)
  • keep-session-alive: 验证并刷新当前认证令牌(也用于基于令牌的认证)
  • logout: 使当前令牌无效并结束会话
  • set-organization: 为后续请求设置组织 ID

类别

  • list-categories: 列出所有支持过滤的类别
  • get-category: 通过 ID 获取类别
  • create-category: 创建新类别
  • update-category: 更新现有类别
  • delete-category: 删除类别
  • list-category-objects: 列出特定类别的所有对象

图表

  • list-charts: 列出所有图表并支持过滤
  • get-chart: 通过ID获取图表
  • delete-chart: 删除图表
  • export-chart: 以多种格式导出图表

可用资源

  • auth://status: 获取认证状态
  • categories://list: 列出所有类别
  • categories://{id}: 获取特定类别
  • categories://{categoryId}/objects: 获取特定类别的对象
  • charts://list: 列出所有图表
  • charts://{id}: 获取特定图表
  • charts://{id}/export/{format}: 以特定格式导出图表

可用提示

  • analyze-categories: 分析仪表板中的类别
  • analyze-charts: 分析仪表板中的图表
  • compare-charts: 比较两个图表之间的数据
  • category-usage-analysis: 分析类别在图表中的使用情况
  • use-filters: 展示如何有效地使用此API的过滤器

Claude集成示例

以下是一些与Claude连接服务器后使用的示例查询:

设置API URL

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来运行开发服务器。
# 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 start

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"

MCP客户端配置

与桌面版Claude集成:

Node.js实现

  • 执行“本地执行”部分中的说明
  • 确保已执行./dependencies.sh以安装所需依赖
  • 实现以下配置(注意:@mingzilla/pi-api-mcp-server引用的是通过“本地执行”安装的包)
{
  "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文件路径的配置
./start.sh
{
  "mcpServers": {
    "pi-api": {
      "command": "node",
      "args": [
        "/home/mingzilla/dev/tool-mcp-pi-api-server/build/index.js",
        "--…

相关 MCP Servers(来自「databases」)

千牛安全审计

审计 npm 包依赖项以查找安全漏洞,提供详细的报告和修复建议,并集成 MCP。

@qianniuspace/mcp-security-audit

Claude 数据库连接器

通过API层将克劳德桌面版直接连接到数据库,使其能够探索数据库结构、编写SQL查询、分析数据集和创建报告。该API层还包含用于表探索和查询执行的工具。

@runekaagaard/mcp-alchemy

DBCode数据库管理工具

DBCode 是一个 Visual Studio Code 扩展,允许你管理许多数据库,包括 PostgreSQL、MySQL、SQL Server、DuckDB、Redis、MongoDB 等更多数据库。 DBCode 提供了运行 MCP 服务器的选项,可以访问这些数据库、它们的模式以及执行查询的能力。

@dbcodeio/public

DMS-数据库安全访问

AI 首选的统一数据访问通道,支持30多种数据源(阿里云全系/主流数据库/数仓)的安全访问。

@aliyun/alibabacloud-dms-mcp-server

Doris模型控制面板服务

后端服务,实现了模型控制面板协议,可连接到 Apache Doris 数据库,允许用户执行 SQL 查询、管理元数据,并且有可能利用大语言模型(LLMs)完成自然语言到 SQL 的转换等任务。

@apache/doris-mcp-server

Excel服务器

提供对Excel文件的操纵功能。此服务器启用工作簿创建、数据操纵、格式设置和高级Excel功能。

@haris-musa/excel-mcp-server

自动安装

点击按钮会唤起 PolarBear 客户端,并把当前 MCP Server 的 Markdown 详情文档地址传给客户端。

/api/mcps/mingzilla-pi-api-mcp-server/markdown
打开 PolarBear 安装查看 Markdown 文档

手动安装

在 PolarBear 或其他支持 MCP 的客户端中,新建 MCP Server,并参考下方来源或安装提示配置。

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

基本信息

分类
databases / monitoring
运行方式
No
许可证
Apache License 2.0
详情文件
mingzilla-pi-api-mcp-server.md