Generate an image using Flux AI from a text prompt
Generate an image using Midjourney from a text prompt
Generate video and effects using Kling
Generate video using Luma Dream Machine
Generate video from text/image prompt using Hunyuan
Generate video from image prompt using Skyreels
Generate video from text/image prompt using Wan
Generate music from video using MMAudio
Generate voice using zero-shot TTS
Generate music using Suno
Generate 3D model from image using Trellis
PiAPI Media Generator is a powerful MCP server that integrates with PiAPI's API to enable media content generation directly from Claude and other MCP-compatible applications. It provides access to multiple AI services including Midjourney, Flux, Kling, LumaLabs, Udio, Chrip, and Trellis, allowing users to create images, videos, music, and 3D models without leaving their AI assistant interface.
PiAPI Media Generator is a TypeScript-based MCP server that connects to PiAPI's API, enabling you to generate various types of media content directly within Claude or other MCP-compatible applications. This integration allows you to create images, videos, music, and 3D models using popular AI services without switching between different platforms.
Before installing PiAPI Media Generator, ensure you have:
git clone https://github.com/apinetwork/piapi-mcp-server
cd piapi-mcp-server
npm install
npm run build
This will generate a dist/index.js
file that you'll use to configure with Claude Desktop and other applications.
Create a .env
file in the project root directory with your API key:
PIAPI_API_KEY=your_api_key_here
To use PiAPI Media Generator with Claude Desktop, add the following configuration to your Claude Desktop configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%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"
}
}
}
}
After updating your configuration, restart Claude Desktop. You should see a hammer icon in the bottom right corner of the input box, indicating that the MCP server is connected.
To use PiAPI Media Generator with Cursor:
Ctrl+Shift+J
){
"mcpServers": {
"piapi": {
"command": "node",
"args": ["/absolute/path/to/piapi-mcp-server/dist/index.js"],
"env": {
"PIAPI_API_KEY": "your_api_key_here"
}
}
}
}
You can test your installation using the MCP Inspector:
npm run inspect
The MCP Inspector will be available at http://localhost:5173 (default port: 5173). For time-consuming operations like image generation, you may need to increase the timeout by adding a timeout parameter to the URL, for example: http://localhost:5173?timeout=60000 (sets timeout to 60 seconds).
Once configured, you can ask Claude or Cursor to generate various media types:
Note that time-consuming tools like video generation may not complete due to Claude's timeout limitations.
If you encounter issues: