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 piapi-mcp-serverConfiguration
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 bridges Claude and other MCP-compatible AI clients to PiAPI's unified AI media generation platform, enabling generation of images (Midjourney, Flux), videos (Kling, LumaLabs Dream Machine, Hunyuan, Skyreels, Wan), audio and music (Suno, Udio, TTS Zero-Shot), and 3D models (Trellis) — all from a single API key. It removes the need to integrate each AI media service separately, providing one consistent MCP interface for creative and production workflows. Teams building AI-powered content pipelines or individual creators who want to generate diverse media from within Claude conversations will find this server particularly valuable.
Prerequisites
- Node.js 16.x or higher and npm or yarn
- A PiAPI account and API key obtained from piapi.ai/workspace/key
- Git to clone the repository
- An MCP-compatible client such as Claude Desktop, Cursor, or VS Code
Obtain your PiAPI API key
Register at piapi.ai and go to piapi.ai/workspace/key to generate your API key. This single key provides access to all media generation services including Midjourney, Flux, Kling, Suno, and Trellis.
Install via Smithery (automated)
The quickest installation method uses the Smithery CLI to automatically clone, build, and configure the server for Claude Desktop in a single command.
npx -y @smithery/cli install piapi-mcp-server --client claudeOr clone and build manually
For manual installation, clone the GitHub repository, install dependencies, and build the TypeScript source to generate the executable 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 server to your MCP client configuration file using the absolute path to the compiled entry point and your PIAPI_API_KEY.
{
"mcpServers": {
"piapi": {
"command": "node",
"args": ["/absolute/path/to/piapi-mcp-server/dist/index.js"],
"env": {
"PIAPI_API_KEY": "your_api_key_here"
}
}
}
}Test with MCP Inspector
Use the built-in inspection script to browse and test available tools interactively before connecting your AI client. Use the extended timeout URL since media generation takes time.
npm run inspect
# Then open: http://localhost:5173?timeout=60000PiAPI Examples
Client configuration
Claude Desktop configuration for the PiAPI MCP server. Use the absolute path to dist/index.js from your cloned repository.
{
"mcpServers": {
"piapi": {
"command": "node",
"args": ["/Users/yourname/piapi-mcp-server/dist/index.js"],
"env": {
"PIAPI_API_KEY": "your_api_key_here"
}
}
}
}Prompts to try
After connecting, ask Claude to generate various media types using the specific AI services supported by PiAPI.
- "Generate a Midjourney image of a futuristic cityscape at night in cinematic style"
- "Use Kling to create a 5-second video of ocean waves at sunrise"
- "Generate a 30-second background music track in lo-fi hip-hop style using Suno"
- "Create a 3D model from this product photo using Trellis"
- "Generate a video of a forest path in autumn using LumaLabs Dream Machine"Troubleshooting PiAPI
Generation requests time out in Claude Desktop
Media generation (especially video) can take 60–120 seconds. Claude Desktop has a shorter default MCP tool timeout. Check your piapi.ai dashboard to see if the generation completed — results may be available there even if Claude showed a timeout.
PIAPI_API_KEY not recognized or 401 error
Ensure the API key is placed in the `env` object of your MCP config, not as a shell variable. MCP subprocesses are launched independently and do not inherit your terminal's environment. Verify the key at piapi.ai/workspace/key.
Tool not found for a specific service (e.g., Midjourney imagine)
Make sure you ran `npm run build` after cloning. The dist/index.js must be up to date. Also check the piapi.ai documentation to confirm the specific service is still active under your subscription plan.
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 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.