For Agents

Connect NamiFusion from Claude Code / Codex

Let CLI agents call NamiFusion AI generation, the model marketplace, and workflows directly via remote MCP or the REST API.

Step 1: Get an API Key

Generate a key (sk-...) on the API Keys page. MCP and Marketplace REST requests authenticate with Authorization: Bearer sk-... or X-API-Key: sk-....

Step 2: MCP Endpoints

NamiFusion exposes three remote MCP servers. Connect only the ones you need.

ServerURLCapabilities
Generation MCPhttp://127.0.0.1:45173/api/v1/task/mcp/AI generation, face swap, task management, and file uploads
Marketplace MCPhttp://127.0.0.1:45173/api/v1/marketplace/mcp/API marketplace model discovery and runs
Workflow MCPhttp://127.0.0.1:45173/api/v1/workflow/mcpCanvas workflow orchestration

Step 3: Configure Your Client

Pick your CLI agent and replace sk-YOUR_API_KEY in the examples with your real key.

Run in your terminal (one command per server):

claude mcp add --transport http namifusion-gen http://127.0.0.1:45173/api/v1/task/mcp/ --header "Authorization: Bearer sk-YOUR_API_KEY"
claude mcp add --transport http namifusion-market http://127.0.0.1:45173/api/v1/marketplace/mcp/ --header "Authorization: Bearer sk-YOUR_API_KEY"
claude mcp add --transport http namifusion-workflow http://127.0.0.1:45173/api/v1/workflow/mcp --header "Authorization: Bearer sk-YOUR_API_KEY"

REST Fallback

Without MCP, you can also run models directly through the REST API.

Run a marketplace model:

curl -X POST http://127.0.0.1:45173/api/v1/marketplace/run/MODEL_ID \
  -H "Authorization: Bearer sk-YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input": {...}}'

Full agent integration docs: /docs/agents.md