Skip to main content
Connect ModelsLab’s powerful AI generation capabilities to your favorite AI coding assistant. This guide covers integration with popular MCP-compatible agents and tools.

Overview

The ModelsLab MCP Web API works with any client that supports the Model Context Protocol over HTTP. This includes:
  • Claude Code - Anthropic’s CLI coding assistant
  • OpenCode - Open-source AI coding agent
  • Claude Desktop - Claude’s desktop application
  • Cursor - AI-powered code editor
  • Continue - Open-source AI code assistant
  • Custom integrations - Any MCP-compatible client

Claude Code

Claude Code is Anthropic’s agentic CLI tool for software development.

Configuration

Add ModelsLab to your Claude Code MCP settings file:
Edit ~/.claude/settings.json:
settings.json

Usage

Once configured, you can ask Claude Code to generate images, videos, and audio directly:

OpenCode

OpenCode is an open-source AI coding agent that runs in your terminal.

Configuration

Add ModelsLab to your OpenCode configuration:
Create or edit opencode.json in your project root:
opencode.json

Usage

Start OpenCode and use ModelsLab tools:
Then in the interactive session:

Claude Desktop

Claude Desktop supports MCP servers for extended functionality.

Configuration

Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
claude_desktop_config.json

Restart Required

After updating the configuration:
  1. Completely quit Claude Desktop (not just minimize)
  2. Reopen Claude Desktop
  3. The ModelsLab tools should now be available

Cursor

Cursor is an AI-powered code editor with MCP support.

Configuration

Add ModelsLab to your Cursor MCP settings:
  1. Open Cursor Settings (Cmd/Ctrl + ,)
  2. Search for “MCP”
  3. Add the following server configuration:
Alternatively, edit .cursor/mcp.json in your project:
mcp.json

VS Code (Copilot Agent Mode)

VS Code supports MCP servers through Copilot Agent Mode.

Configuration

Create or edit .vscode/mcp.json in your project:
mcp.json

Usage

Once configured, use ModelsLab tools in Copilot Agent Mode:

Windsurf

Windsurf is an AI-powered IDE by Codeium with MCP support.

Configuration

Edit ~/.codeium/windsurf/mcp_config.json:
mcp_config.json

Restart Required

After updating the configuration, restart Windsurf for the changes to take effect.

Continue

Continue is an open-source AI code assistant that works with VS Code and JetBrains IDEs.

Configuration

Edit your Continue configuration file (~/.continue/config.json):
config.json

Generic MCP Client

For any MCP-compatible client, use the following configuration pattern:

Environment Variables

For security, you can use environment variables instead of hardcoding your API key:
Add to your shell profile (~/.bashrc, ~/.zshrc, etc.):
Then reference it in your config:
Note: Environment variable substitution support varies by client. Check your specific client’s documentation.

Verification

After configuring your MCP client, verify the integration is working:

Test Connection

Ask your AI agent to list available models:

Generate a Test Image

Check for Errors

If the integration isn’t working, check:
  1. API Key: Ensure your API key is valid and has sufficient credits
  2. URL: Verify the endpoint URL is correct
  3. Headers: Confirm the Authorization header format is correct
  4. Client Support: Ensure your MCP client supports HTTP transport

Troubleshooting

  • Verify the endpoint URL is correct
  • Check your network connection
  • Ensure there are no firewall rules blocking the connection
  • Verify your API key is correct
  • Check that the Authorization header uses Bearer prefix (with space)
  • Ensure your API key has not expired
  • Restart your MCP client after configuration changes
  • Check the configuration file syntax (valid JSON)
  • Verify the config file is in the correct location
  • Check your ModelsLab account for usage limits
  • Add delays between requests if making many calls
  • Consider upgrading your plan for higher limits

Next Steps

Tools Reference

Explore all available MCP tools and their parameters

Get API Key

Create or manage your ModelsLab API keys