Lets agents generate media through PiAPI with Midjourney, Flux, Kling, Hunyuan, Udio, Trellis and other models.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add piapi --env PIAPI_API_KEY='<PIAPI_API_KEY>' -- node /absolute/path/to/piapi-mcp-server/dist/index.js~/.codex/config.toml
[mcp_servers.piapi]
command = "node"
args = ["/absolute/path/to/piapi-mcp-server/dist/index.js"]
env = { PIAPI_API_KEY = "<PIAPI_API_KEY>" }
# codex mcp add piapi --env PIAPI_API_KEY='<PIAPI_API_KEY>' -- node /absolute/path/to/piapi-mcp-server/dist/index.js~/.cursor/mcp.json
{
"mcpServers": {
"piapi": {
"command": "node",
"args": [
"/absolute/path/to/piapi-mcp-server/dist/index.js"
],
"env": {
"PIAPI_API_KEY": "<PIAPI_API_KEY>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"piapi": {
"type": "stdio",
"command": "node",
"args": [
"/absolute/path/to/piapi-mcp-server/dist/index.js"
],
"env": {
"PIAPI_API_KEY": "<PIAPI_API_KEY>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"piapi": {
"command": "node",
"args": [
"/absolute/path/to/piapi-mcp-server/dist/index.js"
],
"env": {
"PIAPI_API_KEY": "<PIAPI_API_KEY>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"piapi": {
"command": "node",
"args": [
"/absolute/path/to/piapi-mcp-server/dist/index.js"
],
"env": {
"PIAPI_API_KEY": "<PIAPI_API_KEY>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"piapi": {
"command": "node",
"args": [
"/absolute/path/to/piapi-mcp-server/dist/index.js"
],
"env": {
"PIAPI_API_KEY": "<PIAPI_API_KEY>"
}
}
}
}需要的环境变量
PIAPI_API_KEY
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。