Token导航 LogoToken导航TokenDH.com
PI API MCP Server logo
搜索检索stdio官方级别未说明来源级核验

PI API MCP Server

MCP Server

@smithery/cli

MCP (Model Context Protocol) Server for the PI API

工具数

18

提示词数

0

GitHub Stars

7

资源数

0
API集成安全访问JavaScriptClaude数据可视化Claude DesktopClaudeCline

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

mingzilla

提供方

mingzilla

最后核验

2026/5/18 04:05

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

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

详细介绍

PI API MCP服务器

](https://smithery.ai/server/@mingzilla/pi-api-mcp-server)

模型上下文协议(MCP)服务器,为与PI仪表板API交互提供标准化工具和资源。此实现使Claude和其他兼容MCP的AI助手能够安全地访问和管理PI Dashboard资源,包括类别和图表。

将PI与MCP结合使用

以下演示了安装完成后此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安装

通过以下方式自动安装Claude Desktop的pi-api-mcp服务器 史密瑟里:

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 在执行任何操作之前,请使用工具。这种设计允许在启动时没有预先确定URL的环境中进行灵活配置。

配置文件位置

访问您的Claude进行桌面应用程序配置,网址为:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • 窗户: %APPDATA%\Claude\claude_desktop_config.json
  • Linux:现在使用其他工具。例如,Cline-让它向您展示MCP配置文件

可用工具

架构发现

  • 获取可过滤属性:通过检查示例实体,获取可用于过滤的属性列表
  Get the filterable attributes for chart entities

连接管理

  • 检查连接:检查当前API URL和身份验证是否有效
  • 设置api url:为所有请求配置基本API URL
  Set the API URL to http://localhost:8224/pi/api/v2

认证

  • 验证:获取有关身份验证选项的指导
  • 使用凭据进行身份验证:使用用户名和密码进行身份验证(最后手段选项)
  • 保持会话活动:验证并刷新当前身份验证令牌(也用于基于令牌的身份验证)
  • 登出:使当前令牌无效并结束会话
  • 设置组织:为后续请求设置组织ID

分类

  • 列出类别:列出所有支持过滤的类别
  • 获取类别:按ID获取类别
  • 创建类别:创建新类别
  • 更新类别:更新现有类别
  • 删除类别:删除类别
  • 列出类别对象:列出特定类别的所有对象

图表

  • 列表图表:列出所有支持过滤的图表
  • 获取图表:按ID获取图表
  • 删除图表:删除图表
  • 出口图表:导出各种格式的图表

可用资源

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

可用提示

  • 分析类别:分析仪表板中的类别
  • 分析图表:分析仪表板中的图表
  • 比较图表:比较两个图表之间的数据
  • 类别使用分析:分析图表中如何使用类别
  • 使用过滤器:显示如何在此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 for Desktop集成:

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

开发检查表

  • 更新代码->启动本地服务器->使用index.js的文件路径测试本地服务器
  • 更新readme.md文件->更改mcpServers配置部分:docker+node+npx
  • ./publish.sh-发布到npm
  • ./dockerBuild.sh->。/dockerPublish.sh(编辑版本号以匹配package.json)->测试docker配置
  • 将代码推送到github

许可证

MIT许可证

作者

黄明志(mingzilla)

![Verified on MseeP](https://mseep.ai/app/ccbbfbc9-2cfe-4605-b68f-5f1d447b1190)

](https://smithery.ai/server/@mingzilla/pi-api-mcp-server)

目录标签

目录标签

API集成安全访问JavaScriptClaude数据可视化research-and-dataAPI管理本地部署AI集成仪表盘工具

支持客户端

Claude DesktopClaudeCline

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@smithery/cli

工具数量(toolCount,工具数)

18

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP