home / mcp / piapi mcp server

PiAPI MCP Server

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-compatible apps.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "apinetwork-piapi-mcp-server": {
      "command": "node",
      "args": [
        "/absolute/path/to/piapi-mcp-server/dist/index.js"
      ],
      "env": {
        "PIAPI_API_KEY": "YOUR_API_KEY_HERE"
      }
    }
  }
}

You run a TypeScript MCP server that connects to PiAPI so you can generate media content from Claude or other MCP-compatible apps. This server exposes a flexible bridge between your MCP client and PiAPI’s generation tools, letting you trigger image, video, and audio pipelines from your prompts.

How to use

Connect your MCP client to the PiAPI MCP Server using a local stdio setup. You run the server locally and point the client at the same runtime process, enabling you to issue prompts that translate into PiAPI-powered content generation.

How to install

Prerequisites you need before installation:

  • Node.js 16.x or higher
  • npm
  • yarn
  • A PiAPI API key (get one at piapi.ai)

Concrete steps you follow to install the MCP server locally are shown here. Copy each command exactly as written and run in your terminal.

Installation via Smithery

npx -y @smithery/cli install piapi-mcp-server --client claude

Manual installation

If you prefer to install manually, follow these steps to clone, install dependencies, and build the project.

git clone https://github.com/apinetwork/piapi-mcp-server
cd piapi-mcp-server
```
```bash
npm install
```
```bash
npm run build

Optional: test server with MCP Inspector

If you want to test the MCP server locally, create an environment file with your API key and launch the inspector to verify the MCP integration.

# in project root
PIAPI_API_KEY=your_api_key_here
```
```bash
npm run inspect

Starting MCP Inspector and testing timeouts

Open the inspector interface at http://localhost:5173 to test functions, inspect requests, and adjust timeouts for time-consuming tasks like image or video generation.

Available tools

base_image_toolkit

Base toolkit for generating images from prompts using PiAPI capabilities.

base_video_toolkit

Base toolkit for generating videos from prompts or image prompts.

flux_image_generation

Image generation from text or image prompts via Flux integration.

hunyuan_video_generation

Video generation from text or image prompts via Hunyuan integration.

skyreels_video_generation

Video creation from image prompts using Skyreels capabilities.

wan_video_generation

Video generation from text or image prompts via Wan integration.

mmaudio_music_generation

Music generation derived from video assets.

tts_zero_shot_voice

Zero-shot voice synthesis for TTS within MCP workflows.

kling_video_effects

Video generation and effects composition using Kling.

luma_dream_machine

Video generation using Luma Dream Machine capabilities.

suno_music_generation

Music generation using Suno tools.

trellis_3d_model

3D model generation from image prompts via Trellis.