Getting Started

Getting Started

API

MCP Server

MCP Server

Connect AI agents to Trellis 2 with the Model Context Protocol

MCP Server

Trellis 2 exposes a Model Context Protocol (MCP) server so AI agents — Claude Code, Cursor, Codex CLI, Windsurf and any MCP-compatible harness — can generate 3D models directly from your agent session.

The MCP server uses your existing API key and credits. No separate signup is needed.

  • Server URL: https://trellis2.app/api/mcp
  • Transport: Streamable HTTP (stateless)
  • Auth: Authorization: Bearer tr_... (same key as the REST API)

Quick Start

Create an API key in Settings → API Keys.

Register the server with your agent. For Claude Code:

claude mcp add trellis2 --transport http https://trellis2.app/api/mcp \
  --header "Authorization: Bearer tr_your_key_here"

For other harnesses, add the same URL and header to their MCP config. Standard JSON format:

{
  "mcpServers": {
    "trellis2": {
      "type": "http",
      "url": "https://trellis2.app/api/mcp",
      "headers": {
        "Authorization": "Bearer tr_your_key_here"
      }
    }
  }
}

Ask your agent: "List the available 3D models" — the agent calls list_models and you are connected.

Tools

ToolDescription
list_modelsList available 3D generation models with credit costs and capabilities
generate_3d_modelStart a 3D generation task from an image URL or text prompt. Credits are deducted atomically
get_taskPoll task status and progress; COMPLETED tasks include mesh / texture / preview URLs

Typical flow: list_models → generate_3d_model → poll get_task until COMPLETED → download from the output URLs.

Failed generations refund credits automatically — the same guarantee as the REST API.

Table of Contents

MCP Server
Quick Start
Tools