Home / MCP / PiAPI MCP Server

PiAPI MCP Server

Provides a local MCP server gateway to PiAPI for image, video, and audio generation via MCP-compatible clients.

typescript
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "piapi": {
            "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

image/scene

Flux Image generation from text/image prompts enables creating visuals from descriptive prompts.

video/hunyuan

Hunyuan Video generation from text/image prompts for dynamic media content.

video/skyreels

Skyreels Video generation from image prompts for video storytelling.

video/wan

Wan Video generation from text/image prompts for multimedia outputs.

audio/mmaudio

MMAudio Music generation from video content to produce audio tracks.

tts

TTS Zero-Shot voice generation to synthesize voice content.

video/kling

Kling Video and Effects generation for enhanced visuals.

video/luma

Luma Dream Machine video generation for creative video outputs.

music/suno

Suno Music generation to compose audio tracks programmatically.

model/trellis3d

Trellis 3D model generation from image prompts for 3D assets.