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

piapi-mcp-servermcpai-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 with Midjourney, Flux, or Kling directly from Claude.
Create videos with LumaLabs and generate audio with Udio.
Access Trellis and other media generation services through one API.
apinetwork

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedApr 16, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx piapi-mcp-server

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 bridges Claude and other MCP-compatible AI clients to PiAPI's unified AI media generation platform, enabling generation of images (Midjourney, Flux), videos (Kling, LumaLabs Dream Machine, Hunyuan, Skyreels, Wan), audio and music (Suno, Udio, TTS Zero-Shot), and 3D models (Trellis) — all from a single API key. It removes the need to integrate each AI media service separately, providing one consistent MCP interface for creative and production workflows. Teams building AI-powered content pipelines or individual creators who want to generate diverse media from within Claude conversations will find this server particularly valuable.

Prerequisites

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

Obtain your PiAPI API key

Register at piapi.ai and go to piapi.ai/workspace/key to generate your API key. This single key provides access to all media generation services including Midjourney, Flux, Kling, Suno, and Trellis.

2

Install via Smithery (automated)

The quickest installation method uses the Smithery CLI to automatically clone, build, and configure the server for Claude Desktop in a single command.

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

Or clone and build manually

For manual installation, clone the GitHub repository, install dependencies, and build the TypeScript source to generate the executable dist/index.js file.

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

Configure your MCP client

Add the server to your MCP client configuration file using the absolute path to the compiled entry point and your PIAPI_API_KEY.

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

Test with MCP Inspector

Use the built-in inspection script to browse and test available tools interactively before connecting your AI client. Use the extended timeout URL since media generation takes time.

npm run inspect
# Then open: http://localhost:5173?timeout=60000

PiAPI Examples

Client configuration

Claude Desktop configuration for the PiAPI MCP server. Use the absolute path to dist/index.js from your cloned repository.

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

Prompts to try

After connecting, ask Claude to generate various media types using the specific AI services supported by PiAPI.

- "Generate a Midjourney image of a futuristic cityscape at night in cinematic style"
- "Use Kling to create a 5-second video of ocean waves at sunrise"
- "Generate a 30-second background music track in lo-fi hip-hop style using Suno"
- "Create a 3D model from this product photo using Trellis"
- "Generate a video of a forest path in autumn using LumaLabs Dream Machine"

Troubleshooting PiAPI

Generation requests time out in Claude Desktop

Media generation (especially video) can take 60–120 seconds. Claude Desktop has a shorter default MCP tool timeout. Check your piapi.ai dashboard to see if the generation completed — results may be available there even if Claude showed a timeout.

PIAPI_API_KEY not recognized or 401 error

Ensure the API key is placed in the `env` object of your MCP config, not as a shell variable. MCP subprocesses are launched independently and do not inherit your terminal's environment. Verify the key at piapi.ai/workspace/key.

Tool not found for a specific service (e.g., Midjourney imagine)

Make sure you ran `npm run build` after cloning. The dist/index.js must be up to date. Also check the piapi.ai documentation to confirm the specific service is still active under your subscription plan.

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 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-mcp-server": { "command": "npx", "args": ["-y", "piapi-mcp-server"] } } }

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