Higgsfield AI MCP Server

Higgsfield AI MCP Server

MCP server integrating Higgsfield AI API for image generation, video animation, and speech-to-video synthesis with character management and job tracking.

Category
访问服务器

README

Higgsfield AI MCP Server

MCP (Model Context Protocol) server for Higgsfield AI API - enabling AI-powered image generation, video creation, and speech synthesis capabilities.

Features

🎨 Text-to-Image (Soul Model)

  • Generate high-quality images from text prompts
  • Multiple image sizes and quality options
  • Custom style presets and character references
  • Batch generation support

🎬 Image-to-Video (DOP Model)

  • Animate static images with motion presets
  • Start and end frame support
  • Customizable motion strength

🗣️ Speech-to-Video

  • Generate talking head videos
  • Custom image and audio input
  • Adjustable quality and duration

👤 Character Management

  • Create consistent character references
  • Use across multiple generations
  • Manage character library

📊 Job Management

  • Async job status tracking
  • Webhook notifications
  • Result retrieval

Installation

Prerequisites

  • Python 3.10 or higher
  • Higgsfield AI API credentials (Get them here)

Install via pip

pip install higgsfield-mcp

Install from source

git clone <repository-url>
cd higgsfield-mcp
pip install -e .

🚀 Quick Setup for Claude Code

Using Claude Code CLI? See CLAUDE_CODE_SETUP.md for step-by-step instructions.

TL;DR:

  1. pip install higgsfield-mcp
  2. Add to .mcp.json:
{
  "mcpServers": {
    "higgsfield": {
      "command": "higgsfield-mcp",
      "env": {
        "HIGGSFIELD_API_KEY": "your-key",
        "HIGGSFIELD_SECRET": "your-secret"
      }
    }
  }
}
  1. Restart Claude Code and start generating!

Configuration

1. Set up environment variables

Create a .env file in your project directory:

HIGGSFIELD_API_KEY=your-api-key-here
HIGGSFIELD_SECRET=your-secret-here

Or export them in your shell:

export HIGGSFIELD_API_KEY=your-api-key-here
export HIGGSFIELD_SECRET=your-secret-here

2. Configure MCP Client

Add to your MCP client configuration (e.g., Claude Desktop config.json):

{
  "mcpServers": {
    "higgsfield": {
      "command": "python",
      "args": ["-m", "higgsfield_mcp.server"],
      "env": {
        "HIGGSFIELD_API_KEY": "your-api-key-here",
        "HIGGSFIELD_SECRET": "your-secret-here"
      }
    }
  }
}

Or if installed via pip:

{
  "mcpServers": {
    "higgsfield": {
      "command": "higgsfield-mcp",
      "env": {
        "HIGGSFIELD_API_KEY": "your-api-key-here",
        "HIGGSFIELD_SECRET": "your-secret-here"
      }
    }
  }
}

Available Tools

Text-to-Image

generate_image_soul

Generate images from text prompts using the Soul model.

Parameters:

  • prompt (required): Text description of the image
  • width_and_height (optional): Image dimensions (default: "1696x960")
    • Options: "1152x2048", "2048x1152", "2048x1536", "1536x2048", etc.
  • enhance_prompt (optional): Auto-enhance prompt (default: true)
  • quality (optional): "720p" or "1080p" (default: "720p")
  • batch_size (optional): 1 or 4 (default: 1)
  • style_id (optional): Style preset UUID
  • style_strength (optional): 0-1 (default: 1.0)
  • seed (optional): 1-1000000 for reproducibility
  • custom_reference_id (optional): Character reference UUID
  • custom_reference_strength (optional): 0-1 (default: 1.0)
  • image_reference_url (optional): Reference image URL
  • webhook_url (optional): Webhook for completion notification
  • webhook_secret (optional): Webhook secret

Example:

{
  "prompt": "A serene mountain landscape at sunset",
  "width_and_height": "2048x1152",
  "quality": "1080p",
  "enhance_prompt": true
}

get_soul_styles

Get list of available style presets.

Returns: List of styles with id, name, description, and preview_url


Image-to-Video

generate_video_dop

Generate video from static image using DOP model.

Parameters:

  • input_image_url (required): Source image URL
  • prompt (required): Animation description
  • model (optional): Model name (default: "dop-turbo")
  • seed (optional): Reproducibility seed
  • motions (optional): Array of motion presets [{id, strength}]
  • input_image_end_url (optional): End frame URL
  • enhance_prompt (optional): Auto-enhance (default: true)
  • webhook_url (optional): Completion webhook
  • webhook_secret (optional): Webhook secret

Example:

{
  "input_image_url": "https://example.com/image.jpg",
  "prompt": "The person slowly turns their head and smiles",
  "motions": [
    {"id": "motion-uuid", "strength": 0.7}
  ]
}

get_motions

Get list of available motion presets.

Returns: List of motions with id, name, description, and preview_url


Speech-to-Video

generate_speech_video

Generate talking head video from text.

Parameters:

  • prompt (required): Speech text
  • input_image_url (optional): Face image URL
  • input_audio_url (optional): Audio URL
  • quality (optional): Quality setting (default: "high")
  • enhance_prompt (optional): Auto-enhance (default: false)
  • seed (optional): Reproducibility seed
  • duration (optional): Duration in seconds
  • webhook_url (optional): Completion webhook
  • webhook_secret (optional): Webhook secret

Example:

{
  "prompt": "Hello, welcome to our presentation!",
  "input_image_url": "https://example.com/face.jpg",
  "quality": "high"
}

Character Management

create_character

Create a custom character reference for consistent generation.

Parameters:

  • name (required): Character name (max 100 chars)
  • image_urls (required): Array of 1-100 image URLs

Example:

{
  "name": "My Character",
  "image_urls": [
    "https://example.com/photo1.jpg",
    "https://example.com/photo2.jpg"
  ]
}

Returns: Character object with id to use in custom_reference_id

get_character

Get character details and processing status.

Parameters:

  • reference_id (required): Character UUID

delete_character

Delete a character reference.

Parameters:

  • reference_id (required): Character UUID

Job Management

get_job_status

Check status and retrieve results of a generation job.

Parameters:

  • job_set_id (required): Job set UUID (returned from generation calls)

Returns: Job details with status and result URLs


Usage Examples

Example 1: Generate an Image

# Using MCP client
result = await client.call_tool(
    "generate_image_soul",
    {
        "prompt": "A cyberpunk city at night with neon lights",
        "width_and_height": "2048x1152",
        "quality": "1080p"
    }
)

# Get the job_set_id from result
job_set_id = result["id"]

# Check status
status = await client.call_tool(
    "get_job_status",
    {"job_set_id": job_set_id}
)

Example 2: Create Character and Use in Generation

# Create character
character = await client.call_tool(
    "create_character",
    {
        "name": "John Doe",
        "image_urls": ["https://example.com/john.jpg"]
    }
)

character_id = character["id"]

# Wait for character to be ready
while True:
    status = await client.call_tool(
        "get_character",
        {"reference_id": character_id}
    )
    if status["status"] == "completed":
        break
    await asyncio.sleep(5)

# Generate image with character
result = await client.call_tool(
    "generate_image_soul",
    {
        "prompt": "Professional headshot in a suit",
        "custom_reference_id": character_id,
        "custom_reference_strength": 0.8
    }
)

Example 3: Animate an Image

# Get available motions
motions = await client.call_tool("get_motions", {})

# Generate video
result = await client.call_tool(
    "generate_video_dop",
    {
        "input_image_url": "https://example.com/portrait.jpg",
        "prompt": "Person looks around with a gentle smile",
        "motions": [
            {"id": motions[0]["id"], "strength": 0.6}
        ]
    }
)

API Response Format

Generation requests return a job set object:

{
  "id": "job-set-uuid",
  "type": "text2image_soul",
  "created_at": "2023-11-07T05:31:56Z",
  "jobs": [
    {
      "id": "job-uuid",
      "job_set_type": "text2image_soul",
      "status": "queued",
      "results": {
        "min": {
          "type": "image_url",
          "url": "https://..."
        },
        "raw": {
          "type": "image_url",
          "url": "https://..."
        }
      }
    }
  ],
  "input_params": {}
}

Job Statuses:

  • queued - Job is waiting to start
  • in_progress - Job is processing
  • completed - Job finished successfully
  • failed - Job failed
  • nsfw - Content filtered

Webhooks

For async workflows, provide a webhook URL to receive notifications when jobs complete:

{
  "prompt": "...",
  "webhook_url": "https://your-server.com/webhook",
  "webhook_secret": "your-secret"
}

Webhook payload matches the job set format with completed results.

Error Handling

The server returns descriptive error messages:

{
  "error": "Higgsfield API Error: API request failed with status 422: ..."
}

Common errors:

  • 401: Invalid API credentials
  • 422: Invalid parameters
  • 500: Generation failed

Development

Setup Development Environment

# Clone repository
git clone <repository-url>
cd higgsfield-mcp

# Install with dev dependencies
pip install -e ".[dev]"

# Run tests
pytest

# Format code
black .
ruff check .

Project Structure

higgsfield-mcp/
├── src/
│   └── higgsfield_mcp/
│       ├── __init__.py
│       ├── client.py       # Higgsfield API client
│       └── server.py       # MCP server implementation
├── tests/
│   └── test_client.py
├── pyproject.toml
├── README.md
└── .env.example

Resources

License

MIT License - see LICENSE file for details

Support

For issues and questions:


Made with ❤️ for the MCP ecosystem

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选