Back to MCP Catalog

PiAPI Media Generator MCP Server

Art & CultureTypeScript
Generate images, videos, music, and 3D models using various AI services
Available Tools

flux_imagine

Generate an image using Flux AI from a text prompt

prompt

midjourney_imagine

Generate an image using Midjourney from a text prompt

prompt

kling_generate

Generate video and effects using Kling

prompt

luma_dream_machine

Generate video using Luma Dream Machine

prompt

hunyuan_video

Generate video from text/image prompt using Hunyuan

prompt

skyreels_video

Generate video from image prompt using Skyreels

prompt

wan_video

Generate video from text/image prompt using Wan

prompt

mmaudio_music

Generate music from video using MMAudio

video

tts_zero_shot

Generate voice using zero-shot TTS

text

suno_music

Generate music using Suno

prompt

trellis_3d

Generate 3D model from image using Trellis

image

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.

Overview

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.

Prerequisites

Before installing PiAPI Media Generator, ensure you have:

  • Node.js 16.x or higher installed
  • npm or yarn package manager
  • A PiAPI API key (available at piapi.ai)

Installation

Step 1: Clone the Repository

git clone https://github.com/apinetwork/piapi-mcp-server
cd piapi-mcp-server

Step 2: Install Dependencies

npm install

Step 3: Build the Project

npm run build

This will generate a dist/index.js file that you'll use to configure with Claude Desktop and other applications.

Step 4: Configure Your Environment

Create a .env file in the project root directory with your API key:

PIAPI_API_KEY=your_api_key_here

Connecting to Claude Desktop

To use PiAPI Media Generator with Claude Desktop, add the following configuration to your Claude Desktop configuration file:

  • On macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • On 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"
      }
    }
  }
}

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.

Connecting to Cursor

To use PiAPI Media Generator with Cursor:

  1. Navigate to: File > Preferences > Cursor Settings (or use Ctrl+Shift+J)
  2. Select the "MCP" tab on the left panel
  3. Click "Add new global MCP server" button in the top right
  4. Add your configuration in the opened mcp.json file:
{
  "mcpServers": {
    "piapi": {
      "command": "node",
      "args": ["/absolute/path/to/piapi-mcp-server/dist/index.js"],
      "env": {
        "PIAPI_API_KEY": "your_api_key_here"
      }
    }
  }
}
  1. After configuration, you'll see a "piapi" entry in the MCP Servers page
  2. Click the Refresh button on the entry or restart Cursor to connect to the server

Testing Your Installation

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).

Usage Examples

Once configured, you can ask Claude or Cursor to generate various media types:

  • For images: "Generate an image of a sunset over mountains"
  • For videos: "Create a short video of ocean waves"
  • For music: "Compose a relaxing piano melody"
  • For 3D models: "Generate a 3D model of a modern chair"

Note that time-consuming tools like video generation may not complete due to Claude's timeout limitations.

Troubleshooting

If you encounter issues:

  1. Ensure your API key is correctly set in the configuration
  2. Check that Node.js is properly installed and accessible
  3. Verify the path to the dist/index.js file is correct
  4. Restart your MCP-compatible application after making configuration changes
  5. Check the application logs for any error messages

Related MCPs

Video Jungle
Art & CulturePython

Upload, edit, search, and generate videos with AI assistance

Rijksmuseum
Art & CultureTypeScript

Access and explore the Rijksmuseum's art collection through natural language

AniList
Art & CultureTypeScript

Access and interact with anime, manga, character, and user data from AniList

About Model Context Protocol

Model Context Protocol (MCP) allows AI models to access external tools and services, extending their capabilities beyond their training data.

Generate Cursor Documentation

Save time on coding by generating custom documentation and prompts for Cursor IDE.