PiAPISAFE
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.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
[](https://piapi.ai) [](https://piapi.ai/docs) [](https://discord.gg/qRRvcGa7Wb)
[](https://smithery.ai/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.
Features (more coming soon)
Note: Time-consuming tools like video generation may not complete due to Claude's timeout limitations
- [x] Base Image toolkit
- [x] Base Video toolkit
- [x] Flux Image generation from text/image prompt
- [x] Hunyuan Video generation from text/image prompt
- [x] Skyreels Video generation from image prompt
- [x] Wan Video generation from text/image prompt
- [x] MMAudio Music generation from video
- [x] TTS Zero-Shot voice generation
- [ ] Midjourney Image generation
- [x] imagine
- [ ] other
- [x] Kling Video and Effects generation
- [x] Luma Dream Machine video generation
- [x] Suno Music generation
- [ ] Suno Lyrics generation
- [ ] Udio Music and Lyrics generation
- [x] Trellis 3D model generation from image
- [ ] Workflow planning inside LLMs
Working with Claude Desktop Example
Prerequisites
- Node.js 16.x or higher
- npm or yarn
- A PiAPI API key (get one at piapi.ai)
Installation
Installing via Smithery
1b74857ee812OBSERVED · 2026-10-07Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add piapi-mcp-server --env PIAPI_API_KEY=${PIAPI_API_KEY} --env PIAPI_CONTRACT_GITHUB_TOKEN=${PIAPI_CONTRACT_GITHUB_TOKEN} -- npx -y [email protected]{
"mcpServers": {
"piapi-mcp-server": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"PIAPI_API_KEY": "${PIAPI_API_KEY}",
"PIAPI_CONTRACT_GITHUB_TOKEN": "${PIAPI_CONTRACT_GITHUB_TOKEN}"
}
}
}
}Exposed tools (23)
21 read · 1 write · 1 destructive. Blast radius: 1 tool can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
derive_image | read | Derive a image using Qubico Flux, variation |
generate_3d_model | read | Generate a 3d model using Qubico Trellis |
generate_image | read | Generate a image using Qubico Flux |
generate_image_controlnet | read | Generate a image using Qubico Flux with ControlNet |
generate_music_for_video | read | Generate a music for a video using Qubico MMAudio |
generate_music_suno | read | Generate music using Suno |
generate_video_effect_kling | read | Generate a video effect using Kling |
generate_video_hailuo | read | Generate a video using Hailuo |
generate_video_hunyuan | read | Generate a video using Qubico Hunyuan |
generate_video_kling | read | Generate a video using Kling |
generate_video_luma | read | Generate a video using Luma |
generate_video_skyreels | read | Generate a video using Qubico Skyreels |
generate_video_wan | read | Generate a video using Qubico Wan |
image_faceswap | read | Faceswap an image |
image_rmbg | destructive | Remove the background of an image |
image_segment | read | Segment an image |
image_upscale | read | Upscale an image to a higher resolution |
midjourney_imagine | read | Generate a image using Midjourney Imagine |
modify_image | write | Modify a image using Qubico Flux, inpaint or outpaint |
show_image | read | Show an image with pixels less than 768*1024 due to Claude limitation |
tts_zero_shot | read | Zero-shot TTS using Qubico f5-tts |
video_faceswap | read | Faceswap a video |
video_upscale | read | Upscale video resolution to 2x |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (2 observation(s))
- Network
- declared (5 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (3)
image_rmbg
resolve(__dirname, "../../src/sync/baseline.piapi-catalog.json"),
dotenv, fastmcp, zod, @types/node, typescript
Gates applied: no_behavioural_pass.
1b74857ee812full audit observations/trust-audit/mcp-server/apinetwork__piapi.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-07 | 1b74857ee812 | SAFE | B | 89 | first audit |
Questions
What is the 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.
What tools does PiAPI expose?
23 in total: 21 read-only, 1 that write, and 1 that can delete or overwrite (image_rmbg). Every one is listed on this page with its risk.
Is PiAPI safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B. Separately from the audit: 1 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does PiAPI need?
It reads PIAPI_API_KEY and PIAPI_CONTRACT_GITHUB_TOKEN from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How current is this page?
The grade is for one exact copy of the source (1b74857ee812), read on 2026-10-07. The repository is watched and re-audited when it changes.