PiAPI
A TypeScript implementation of a Model Context Protocol (MCP) server that integrates with PiAPI's API. PiAPI makes user able to generate media content with Midjourney/Flux/Kling/LumaLabs/Udio/Chrip/Trellis directly from Claude or any other MCP-compat
What is PiAPI?
PiAPI is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to typescript implementation of a model context protocol (mcp) server that integrates with piapi's api. piapi makes user able to generate media content with midjourney/flux/kling/lumalabs/udio/chrip/trel...
A TypeScript implementation of a Model Context Protocol (MCP) server that integrates with PiAPI's API. PiAPI makes user able to generate media content with Midjourney/Flux/Kling/LumaLabs/Udio/Chrip/Trellis directly from Claude or any other MCP-compat
This server falls under the Data Science & ML category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A TypeScript implementation of a Model Context Protocol (MCP
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx piapiConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use PiAPI
The PiAPI MCP server is a TypeScript implementation that connects Claude and other MCP-compatible AI clients to PiAPI's unified media generation platform, enabling direct generation of images, videos, audio, and 3D models from natural language prompts. It supports Midjourney, Flux, Kling, LumaLabs (Dream Machine), Suno, Udio, TTS Zero-Shot, Hunyuan, Skyreels, and Trellis — all through a single API key from piapi.ai. Developers and creative professionals use it to automate media production pipelines or to experiment with multiple AI generation services without switching tools.
Prerequisites
- Node.js 16.x or higher and npm or yarn
- A PiAPI account and API key from piapi.ai/workspace/key
- An MCP-compatible client such as Claude Desktop, Cursor, or VS Code
- Git to clone the repository for manual setup
Get your PiAPI API key
Sign up at piapi.ai and navigate to piapi.ai/workspace/key to generate your API key. This single key grants access to all supported media generation services.
Clone the repository and install dependencies
Clone the PiAPI MCP server repository, install Node.js dependencies, and build the TypeScript source to generate the runnable dist/index.js file.
git clone https://github.com/apinetwork/piapi-mcp-server.git
cd piapi-mcp-server
npm install
npm run buildConfigure your MCP client
Add the PiAPI MCP server to your Claude Desktop or other MCP client configuration. Use the absolute path to the built dist/index.js and set your PIAPI_API_KEY environment variable.
{
"mcpServers": {
"piapi": {
"command": "node",
"args": ["/absolute/path/to/piapi-mcp-server/dist/index.js"],
"env": {
"PIAPI_API_KEY": "your_api_key_here"
}
}
}
}Alternatively, install via Smithery
For a faster automated setup, use the Smithery CLI to install and configure the PiAPI server for Claude in one command.
npx -y @smithery/cli install piapi-mcp-server --client claudeRestart your MCP client and test
Restart Claude Desktop or your MCP client after configuration. The PiAPI tools should appear in the available tools list. Note that media generation tasks are time-consuming and may approach timeout limits.
# Test with MCP Inspector:
npm run inspect
# Open: http://localhost:5173?timeout=60000PiAPI Examples
Client configuration
Claude Desktop configuration using the built Node.js entry point. Replace the path and API key with your actual values.
{
"mcpServers": {
"piapi": {
"command": "node",
"args": ["/Users/yourname/piapi-mcp-server/dist/index.js"],
"env": {
"PIAPI_API_KEY": "your_api_key_here"
}
}
}
}Prompts to try
Ask your AI assistant to generate media content using the specific services supported by PiAPI.
- "Generate a photorealistic image of a mountain lake at sunset using Flux"
- "Create a short video clip of a dancing robot using Kling"
- "Generate a 30-second music track with an upbeat electronic style using Suno"
- "Use Trellis to create a 3D model from this product image"
- "Generate a LumaLabs Dream Machine video from this scene description"Troubleshooting PiAPI
Media generation times out before completing
Image and video generation tasks take 30–120 seconds. Use the MCP Inspector with an extended timeout (`http://localhost:5173?timeout=60000`) for testing. In Claude Desktop, tasks may appear to fail but the generation may still complete on PiAPI's servers — check your piapi.ai dashboard.
Authentication error: invalid API key
Verify your key at piapi.ai/workspace/key. Ensure `PIAPI_API_KEY` is set in the `env` block of your MCP config and not as a shell environment variable, since MCP subprocesses may not inherit the shell environment.
dist/index.js not found after configuration
Run `npm run build` in the cloned repository directory first. The TypeScript compilation step is required before the server can run. Use the absolute path to dist/index.js in your MCP config args.
Frequently Asked Questions about PiAPI
What is PiAPI?
PiAPI is a Model Context Protocol (MCP) server that typescript implementation of a model context protocol (mcp) server that integrates with piapi's api. piapi makes user able to generate media content with midjourney/flux/kling/lumalabs/udio/chrip/trellis directly from claude or any other mcp-compat It connects AI assistants to external tools and data sources through a standardized interface.
How do I install PiAPI?
Follow the installation instructions on the PiAPI GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with PiAPI?
PiAPI works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is PiAPI free to use?
Yes, PiAPI is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
PiAPI Alternatives — Similar Data Science & ML Servers
Looking for alternatives to PiAPI? Here are other popular data science & ml servers you can use with Claude, Cursor, and VS Code.
Ultrarag
★ 5.6kA Low-Code MCP Framework for Building Complex and Innovative RAG Pipelines
RocketRide
★ 3.1k📇 🏠 - MCP server that exposes RocketRide AI pipelines as t
Aix Db
★ 2.1kAix-DB 基于 LangChain/LangGraph 框架,结合 MCP Skills 多智能体协作架构,实现自然语言到数据洞察的端到端转换。
NeMo Data Designer
★ 1.9k🎨 NeMo Data Designer: Generate high-quality synthetic data from scratch or from seed data.
PaperBanana
★ 1.7kOpen source implementation and extension of Google Research’s PaperBanana for automated academic figures, diagrams, and research visuals, expanded to new domains like slide generation.
MiniMax
★ 1.5kBridges MiniMax AI capabilities to the Model Context Protocol, enabling AI agents to perform image understanding, text-to-image generation, and speech synthesis. It provides a standardized interface for accessing MiniMax's core tools via JSON-RPC.
Browse More Data Science & ML MCP Servers
Explore all data science & ml servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up PiAPI in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use PiAPI?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.