PiAPI

v1.0.0Data Science & MLstable

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

piapimcpai-integration
Share:
70
Stars
0
Downloads
0
Weekly
0/5

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

Generate images using Midjourney, Flux, Kling integration.
Create videos with multiple generation services.
Generate audio and media content from Claude.
apinetwork

Maintainer

LicenseMIT
Languagetypescript
Versionv1.0.0
UpdatedApr 16, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx piapi

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use PiAPI

The PiAPI MCP server is a TypeScript implementation that connects Claude and other MCP-compatible AI clients to PiAPI's unified media generation platform, enabling direct generation of images, videos, audio, and 3D models from natural language prompts. It supports Midjourney, Flux, Kling, LumaLabs (Dream Machine), Suno, Udio, TTS Zero-Shot, Hunyuan, Skyreels, and Trellis — all through a single API key from piapi.ai. Developers and creative professionals use it to automate media production pipelines or to experiment with multiple AI generation services without switching tools.

Prerequisites

  • Node.js 16.x or higher and npm or yarn
  • A PiAPI account and API key from piapi.ai/workspace/key
  • An MCP-compatible client such as Claude Desktop, Cursor, or VS Code
  • Git to clone the repository for manual setup
1

Get your PiAPI API key

Sign up at piapi.ai and navigate to piapi.ai/workspace/key to generate your API key. This single key grants access to all supported media generation services.

2

Clone the repository and install dependencies

Clone the PiAPI MCP server repository, install Node.js dependencies, and build the TypeScript source to generate the runnable dist/index.js file.

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

Configure your MCP client

Add the PiAPI MCP server to your Claude Desktop or other MCP client configuration. Use the absolute path to the built dist/index.js and set your PIAPI_API_KEY environment variable.

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

Alternatively, install via Smithery

For a faster automated setup, use the Smithery CLI to install and configure the PiAPI server for Claude in one command.

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

Restart your MCP client and test

Restart Claude Desktop or your MCP client after configuration. The PiAPI tools should appear in the available tools list. Note that media generation tasks are time-consuming and may approach timeout limits.

# Test with MCP Inspector:
npm run inspect
# Open: http://localhost:5173?timeout=60000

PiAPI Examples

Client configuration

Claude Desktop configuration using the built Node.js entry point. Replace the path and API key with your actual values.

{
  "mcpServers": {
    "piapi": {
      "command": "node",
      "args": ["/Users/yourname/piapi-mcp-server/dist/index.js"],
      "env": {
        "PIAPI_API_KEY": "your_api_key_here"
      }
    }
  }
}

Prompts to try

Ask your AI assistant to generate media content using the specific services supported by PiAPI.

- "Generate a photorealistic image of a mountain lake at sunset using Flux"
- "Create a short video clip of a dancing robot using Kling"
- "Generate a 30-second music track with an upbeat electronic style using Suno"
- "Use Trellis to create a 3D model from this product image"
- "Generate a LumaLabs Dream Machine video from this scene description"

Troubleshooting PiAPI

Media generation times out before completing

Image and video generation tasks take 30–120 seconds. Use the MCP Inspector with an extended timeout (`http://localhost:5173?timeout=60000`) for testing. In Claude Desktop, tasks may appear to fail but the generation may still complete on PiAPI's servers — check your piapi.ai dashboard.

Authentication error: invalid API key

Verify your key at piapi.ai/workspace/key. Ensure `PIAPI_API_KEY` is set in the `env` block of your MCP config and not as a shell environment variable, since MCP subprocesses may not inherit the shell environment.

dist/index.js not found after configuration

Run `npm run build` in the cloned repository directory first. The TypeScript compilation step is required before the server can run. Use the absolute path to dist/index.js in your MCP config args.

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. You can use it freely in both personal and commercial projects.

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.

Quick Config Preview

{ "mcpServers": { "piapi": { "command": "npx", "args": ["-y", "piapi"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

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.

33,000+ ServersFree & Open SourceStep-by-Step Guides