Content
Foxtrai MCP Server
Based on [CP](https://github.com/PHQ/fastmcp) framework, Foxtrai AI drawing platform MCP Server.
## Features
- **upload_image** — Upload local image as reference image image
- **create_d** — Submit AI drawing task
- **get_task_status** — Query and result
- **generate_image One-click generation (automatic polling)
list_tasks** historical task list
- **list — View image resource list
delete_asset** — Delete image resource
: `nano-banana`, `nano-banana-pro`, `ana-pro-ultra`, `nano-banana-2`
## Installation
```bash
git clone git@github.com:liuruing/foxtrai-mcp.git
cd foxtrai-mcp
uv sync
```
## Integrate with Claude Code
Create `.mcp.json` in the project root directory:
{
"mcp {
"foxtrai": "command": "uv",
"args": ["run", "-- "/path/to/foxtcp", "python", "-mfoxtrai_mcp"],
env": {
"FOXTRAI_TOKEN": "your_token_here"
}
}
}
}
```
> Replace `/path/to/foxtrai-mcp` with the actual clone path, and `your_token_here` with your API Token.
Restart Claude Code after configuration to use drawing-related tools in conversations.
## Integrate with Codex (OpenAI Codex CLI)
Codex CLI also supports MCP Server. Add the following to `~/.codex/config.json`:
```json
{
"mcpServers": "fo": {
"command":",
"args": [" "--directory", "/path/to/foxtrai-mcp", "python", "-m", "foxtrai_mcp.server"],
"env": {
"FOXTRAI_TOKEN": "your_token_here"
}
}
}
}
```
## Integrate with Cursor
Create `.cursor/mcp.json` in the project root directory:
```json
{
"mcpServers": {
"foxtrai": {
"command": "uv",
"args": ["run", "--directory", "/path/to/foxtrai-mcp", "python", "-m", "foxtrai_mcp.server"],
"env": {
"FOXTRAI_TOKEN": "your_token_here"
}
}
}
}
```
## Run Directly
```bash
# stdio mode (for MCP client connection)
FOXTRAI_TOKEN=your_token_here uv run python -m foxtrai_mcp.server
# SSE mode (HTTP service)
FOXTRAI_TOKEN=your_token_here uv run python -c "from foxtrai_mcp.server import mcp; mcp.run(transport='sse', host='0.0.0.0', port=8000)"
```
## Usage Examples
After integration, you can directly say in Claude/Codex:
- "Generate a cyberpunk-style city night scene with a 16:9 ratio using the nano-banana-pro model"
- "Upload this image as a reference image, and then generate a new image with a similar style based on it"
- "View the status of my recent drawing tasks"
- "List all generated images"
## License
MIT