The full upstream README, mirrored here for reference. Install config, tool schemas, adoption signals, and an original overview live on the Piapi MCP Server listing page.
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.
Note: Time-consuming tools like video generation may not complete due to Claude's timeout limitations

To install PiAPI MCP Server for Claude Desktop automatically via Smithery:
After building, a dist/index.js file will be generated. You can then configure this file with Claude Desktop and other applications. For detailed configuration instructions, please refer to the Usage section.
First, create a .env file in the project root directory with your API key:
Then run the following command to start the MCP Inspector:
After running the command, MCP Inspector will be available at http://localhost:5173 (default port: 5173). Open this URL in your browser to start testing. The default timeout for inspector operations is 10000ms (10 seconds), which may not be sufficient for image generation tasks. It's recommended to increase the timeout when testing image generation or other time-consuming operations. You can adjust the timeout by adding a timeout parameter to the URL, for example: http://localhost:5173?timeout=60000 (sets timeout to 60 seconds)
The MCP Inspector is a powerful development tool that helps you test and debug your MCP server implementation. Key features include:
For detailed information about using the MCP Inspector and its features, visit the official MCP documentation.
Add this to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json on macOS or %APPDATA%\Claude\claude_desktop_config.json on Windows):
After updating your configuration file, you need to restart Claude for Desktop. Upon restarting, you should see a hammer icon in the bottom right corner of the input box. For more detailed information, visit the official MCP documentation
Note: Following guide is based on Cursor 0.47.5. Features and behaviors may vary in different versions.
To configure the MCP server:
Ctrl+Shift+JTo test the piapi image generation:
Ctrl+ITo disable the piapi server:
src/index.ts registers a contract-backed MCP tool for every committed
PiAPI (model, task_type) capability. Tool names are deterministic:
piapi_<model>_<task_type> (for example,
piapi_qubico_flux1_schnell_txt2img), and their input schemas are generated
from the committed catalog. The existing hand-written convenience tools remain
available; the contract-backed tools ensure the exposed surface stays complete
as the Manager catalog changes.
The legacy convenience tools in src/index.ts remain hand-written, but the
complete contract-backed surface is generated from the committed catalog. This
repository includes a repeatable drift detector that compares that catalog
baseline with PiAPI Manager's versioned API contract. It detects new APIs,
deprecated APIs, parameter changes, and description changes.
Source of truth: the Go API.postman_collection.json contract in the PiAPI
Manager GitHub repository (Gocyber-world/midjourney-http-v2). The task fetches
that versioned contract directly from GitHub and extracts the
POST /api/v1/task examples into (model, task_type) capabilities. If the
Manager repository is private, set the CI secret MCP_SYNC_GITHUB_TOKEN with
least-privilege contents: read on that source repository (and only the
separate approved write permissions needed for MCP update automation). It has
no Apidog dependency and deliberately does not inspect or report pricing.
By default, npm run sync uses the Manager GitHub contract. For recovery or
local development, an exported OpenAPI JSON file can be supplied instead:
When a drift report is produced, a new capability is already represented by its
contract-backed MCP tool after the baseline is accepted. Validate the MCP
server, run npm run sync:accept, and commit the refreshed baseline. Update a
hand-written convenience tool only when a curated model-specific UX is useful.
.github/workflows/sync-piapi.yml is retained for manual dispatch only.
Periodic synchronization is run from the approved local automation environment,
which holds the separately owner-approved MCP credential and can validate,
accept, and push catalog updates after its sensitive-information gate passes.
MIT