PiAPI-MCP Server
piapi-mcp-服务器
模型上下文协议 (MCP) 服务器的 TypeScript 实现,与 PiAPI 的 API 集成。PiAPI 允许用户直接从 Claude 或任何其他兼容 MCP 的应用程序使用 Midjourney/Flux/Kling/LumaLabs/Udio/Chrip/Trellis 生成媒体内容。
功能(更多功能即将推出)
注意:由于 Claude 的超时限制,视频生成等耗时工具可能无法完成
[x] 基础图像工具包
[x] 基础视频工具包
[x] 从文本/图像提示生成 Flux 图像
[x] 根据文本/图像提示生成混元视频
[x] 从图像提示生成 Skyreels 视频
[x] 从文本/图像提示生成 Wan 视频
[x] MMAudio 从视频生成音乐
[x] TTS Zero-Shot 语音生成
[ ] 旅途中图像生成
[x] 想象一下
[ ] 其他
[x] Kling 视频和效果生成
[x] Luma Dream Machine 视频生成
[x] Suno 音乐世代
[ ] Suno 歌词生成
[ ] Udio 音乐和歌词生成
[x] 从图像生成网格 3D 模型
[ ] LLM 内部的工作流程规划
Related MCP server: erpnext-server
使用 Claude 桌面示例

先决条件
Node.js 16.x 或更高版本
npm 或 yarn
PiAPI API 密钥(在piapi.ai获取)
安装
克隆存储库:
git clone https://github.com/apinetwork/piapi-mcp-server
cd piapi-mcp-server安装依赖项:
npm install构建项目:
npm run build构建完成后,将生成一个dist/index.js文件。您可以使用 Claude Desktop 和其他应用程序配置此文件。详细的配置说明,请参阅使用部分。
(可选)使用 MCP Inspector 测试服务器:
首先,使用您的 API 密钥在项目根目录中创建一个.env文件:
PIAPI_API_KEY=your_api_key_here然后运行以下命令启动 MCP Inspector:
npm run inspect运行命令后,MCP Inspector 将在http://localhost:5173 (默认端口:5173)上可用。在浏览器中打开此 URL 即可开始测试。检查器操作的默认超时时间为 10000 毫秒(10 秒),对于图像生成任务来说,这可能不够用。在测试图像生成或其他耗时操作时,建议增加超时时间。您可以通过在 URL 中添加超时参数来调整超时时间,例如: http://localhost:5173?timeout=60000 (将超时设置为 60 秒)。
MCP Inspector 是一款功能强大的开发工具,可帮助您测试和调试 MCP 服务器实现。主要功能包括:
交互式测试:通过 Web 界面直接测试服务器的功能
实时反馈:查看函数调用的即时结果以及发生的任何错误
请求/响应检查:查看有关请求和响应的详细信息
函数文档:浏览可用的函数及其参数
自定义参数:设置自定义超时值和其他配置选项
历史跟踪:跟踪以前的函数调用及其结果
有关使用 MCP Inspector 及其功能的详细信息,请访问官方 MCP 文档。
用法
连接到 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": "your_api_key_here"
}
}
}
}更新配置文件后,您需要重新启动 Claude for Desktop。重新启动后,您应该会在输入框的右下角看到一个锤子图标。更多详细信息,请访问MCP 官方文档
连接到光标
注意:以下指南基于 Cursor 0.47.5。不同版本的功能和行为可能会有所不同。
要配置 MCP 服务器:
导航至:文件 > 首选项 > 光标设置,或使用快捷键
Ctrl+Shift+J在左侧面板上选择“MCP”选项卡
点击右上角的“添加新的全局 MCP 服务器”按钮
在打开的 mcp.json 文件中添加您的配置
{
"mcpServers": {
"piapi": {
"command": "node",
"args": ["/absolute/path/to/piapi-mcp-server/dist/index.js"],
"env": {
"PIAPI_API_KEY": "your_api_key_here"
}
}
}
}配置完成后,您将在 MCP 服务器页面看到“piapi”条目
点击入口处的刷新按钮或者重启Cursor即可连接piapi服务器
测试 piapi 图像生成:
在Cursor Chat中打开并选择“代理模式”,或者使用快捷键
Ctrl+I输入测试提示,例如:“生成一只狗的图像”
该图像将根据您的提示使用 piapi 服务器生成
要禁用 piapi 服务器:
导航至“光标设置”中的“MCP 服务器”页面
在服务器列表中找到“piapi”条目
单击“启用”切换按钮将其切换为“禁用”
发展
项目结构
piapi-mcp-server/
├── assets/
├── src/
│ ├── index.ts # Main server entry point
├── package.json
├── tsconfig.json
└── .env.example执照
麻省理工学院
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceA TypeScript-based MCP server that enables AI assistants to interact with Gyazo images using the Model Context Protocol, providing access to image URIs, metadata, and OCR data via the Gyazo API.1827MIT
- AlicenseBqualityFmaintenanceThis is a TypeScript-based MCP server that provides integration with ERPNext/Frappe API. It enables AI assistants to interact with ERPNext data and functionality through the Model Context Protocol.6113MIT
- AlicenseAqualityDmaintenanceA TypeScript-based Model Context Protocol server that enables large language models to directly invoke Alibaba Cloud's Tongyi Wanxiang text-to-image generation API.4396MIT
- FlicenseNot gradedqualityDmaintenanceA TypeScript server that fully implements the Model Context Protocol (MCP) standard, providing API access to Docker CLI operations like build, run, stop, and image management through compatible AI clients.
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for Flux AI image generation
A Model Context Protocol server for Wix AI tools
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/apinetwork/piapi-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server