PiAPI MCP服务器

PiAPI MCP服务器

apinetwork/piapi-mcp-server的镜像,这是一个用TypeScript实现的模型上下文协议(MCP)服务器,与PiAPI的API集成。

PiAPI MCP服务器快速入门

概述

PiAPI MCP服务器是一个TypeScript实现的模型上下文协议(MCP)服务器,它与PiAPI的API集成,使用户能够直接从Claude或其他MCP兼容应用生成媒体内容。

环境要求

  • Node.js 16.x或更高版本
  • npm或yarn
  • PiAPI API密钥(从piapi.ai获取)

安装步骤

  1. 克隆仓库:
git clone https://github.com/apinetwork/piapi-mcp-server
cd piapi-mcp-server
  1. 安装依赖:
npm install
  1. 在项目根目录创建.env文件:
PIAPI_API_KEY=你的API密钥
  1. 构建项目:
npm run build

运行服务器

npm start

与Claude Desktop连接

在Claude Desktop配置文件中添加以下内容(macOS路径:~/Library/Application Support/Claude/claude_desktop_config.json,Windows路径:%APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "piapi": {
      "command": "node",
      "args": ["/absolute/path/to/piapi-mcp-server/dist/index.js"],
      "env": {
        "PIAPI_API_KEY": "你的API密钥"
      }
    }
  }
}