Skip to content

Connect Imagga to Claude: Extract Visual Data, Colors, and OCR Text

Nidhi KN Nidhi KN 9 min read AI & Agents
Elaichi from the team behind Truto

Imagga in Claude, in about a minute.

The best way to connect Imagga to Claude is Elaichi: connect Imagga to Elaichi once, then add Elaichi to Claude as a connector. Two steps, about a minute, with a 14‑day free trial and no credit card required.

  • No credit card required
  • 500+ connectors
  • Credentials vaulted, never read back
  1. Start your free trial

    14 days free, no credit card required.

  2. Connect Imagga

    Once, in Elaichi. Claude never gets more access than you have.

  3. Add Elaichi to Claude

    In Claude, open Customize, then Connectors, press Add and paste the URL. Sign in and approve.

    https://api.elaichi.ai/mcp
TrutoFor product teams

Building Imagga into your own product? This guide is for you.

Connect Imagga to Claude via a managed MCP server to automate visual data extraction, smart cropping, and OCR text processing without writing custom API integration code.

The developer guide

Learn how to connect Imagga to Claude using a managed MCP server. Automate image tagging, color extraction, and OCR data processing with AI agents.

If your team needs to connect Imagga to Claude to automate visual data extraction, moderate user-generated content, or orchestrate complex OCR text processing pipelines, you need a Model Context Protocol (MCP) server. This server acts as the translation layer between Claude's tool calls and Imagga's visual intelligence REST APIs. You can either build and maintain this infrastructure yourself, or use a managed integration platform like Truto to dynamically generate a secure, authenticated MCP server URL.

If your team uses ChatGPT, check out our guide on connecting Imagga to ChatGPT or explore our broader architectural overview on connecting Imagga to AI Agents.

Giving a Large Language Model (LLM) read and write access to a specialized computer vision API like Imagga presents specific engineering hurdles. You must manage complex payload lifecycles for binary uploads versus base64 encodings, map massive nested visual metadata schemas to MCP tool definitions, and handle asynchronous job polling for heavy operations like face grouping. Every time you want to expose a new endpoint, you have to update your server code, redeploy, and test the integration.

This guide breaks down exactly how to use Truto to generate a secure, managed MCP server for the Imagga API, connect it natively to Claude, and execute complex image analysis workflows using natural language.

The Engineering Reality of the Imagga API

A custom MCP server is a self-hosted integration layer. While the open MCP standard provides a predictable way for models to discover tools, the reality of implementing it against specialized machine learning APIs is painful. If you decide to build a custom Imagga MCP server, you own the entire integration lifecycle.

Here are the specific challenges you will face with the Imagga API:

Disparate Input Payload Schemas

Imagga is flexible in how it accepts images, but this flexibility creates schema fragmentation. Almost every analysis endpoint (tagging, cropping, moderation) expects either a multipart binary image upload, a image_base64 encoded string, a direct image_url, or a previously generated image_upload_id. If you expose these as flat MCP tools, an LLM will frequently hallucinate inputs - trying to pass a base64 string into the image_url field, causing HTTP 400 errors. You must build an abstraction layer that strongly types these schemas and guides the model to use the correct parameter for the correct payload type.

Asynchronous Job and Ticket Polling

Not all Imagga endpoints return instant results. Heavy operations, like creating a category-based similarity index or running batch face groupings, return a ticket_id for an asynchronous job. An LLM has no built-in intuition for polling. If you want an agent to execute these jobs, your MCP server must expose specific ticket-checking tools and explicitly prompt the model to poll the status endpoint until it receives a final result.

sequenceDiagram
    participant Agent as Claude
    participant MCP as Truto MCP Server
    participant API as Imagga API
    
    Agent->>MCP: Call create_a_imagga_faces_grouping
    MCP->>API: POST /v2/faces/grouping
    API-->>MCP: Returns ticket_id (pending)
    MCP-->>Agent: ticket_id
    
    Note over Agent: Agent waits 5 seconds
    
    Agent->>MCP: Call get_single_imagga_ticket_by_id
    MCP->>API: GET /v2/tickets/{ticket_id}
    API-->>MCP: Status (completed) + Result Payload
    MCP-->>Agent: Final Face Grouping Data

Strict Rate Limit Pass-Through

Computer vision APIs are computationally expensive, and Imagga enforces strict rate limits depending on your subscription tier. It is critical to note that Truto does not retry, throttle, or apply backoff on rate limit errors. When the upstream Imagga API returns an HTTP 429, Truto passes that exact error back to the caller. Truto normalizes the upstream rate limit information into standardized headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset) per the IETF specification. Your client or agent framework is entirely responsible for detecting these 429 errors, parsing the headers, and implementing its own retry or exponential backoff logic.

How to Generate an Imagga MCP Server

Truto dynamically generates MCP servers directly from the API documentation and schema records of connected integrations. There is no manual tool coding required. You can generate a server via the UI or programmatically via the API.

Method 1: Generating via the Truto UI

For administrators setting up internal tools, the UI provides a fast path to generation:

  1. Navigate to the Integrated Accounts page in your Truto dashboard and select your connected Imagga account.
  2. Click the MCP Servers tab.
  3. Click Create MCP Server.
  4. Configure the server (set a name, select allowed methods like read or write, and apply any necessary tags).
  5. Click Save and copy the generated MCP server URL (e.g., https://api.truto.one/mcp/a1b2c3d4e5f6...).

Method 2: Generating via the Truto API

For engineering teams building multi-tenant AI products, you can provision MCP servers on the fly for your end-users. The API validates the configuration, generates a cryptographically hashed token stored in a distributed key-value store, and returns a ready-to-use endpoint.

Request:

curl -X POST https://api.truto.one/integrated-account/{integrated_account_id}/mcp \
  -H "Authorization: Bearer YOUR_TRUTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Imagga Vision Pipeline",
    "config": {
      "methods": ["read", "write"],
      "tags": ["vision", "moderation"]
    }
  }'

Response:

{
  "id": "mcp_8a9b0c1d",
  "name": "Imagga Vision Pipeline",
  "config": { 
    "methods": ["read", "write"], 
    "tags": ["vision", "moderation"] 
  },
  "expires_at": null,
  "url": "https://api.truto.one/mcp/a1b2c3d4e5f67890"
}

This URL is fully self-contained. The token encodes the integration, the specific tenant account, and the filtering rules.

Connecting the MCP Server to Claude

Once you have the Truto MCP URL, connecting it to Claude requires zero additional code. You can configure it via the Claude desktop UI or directly in the configuration file.

Via the Claude UI

  1. Open Claude Desktop.
  2. Navigate to Settings -> Integrations -> Add MCP Server.
  3. Paste your Truto MCP URL into the connection field.
  4. Click Add. Claude will immediately connect, perform an initialization handshake, and fetch the available Imagga tools.

(Note: If your team uses ChatGPT, the process is similar: go to Settings -> Apps -> Advanced settings, enable Developer mode, and add the Truto URL under Custom connectors.)

Via the Claude Config File

If you prefer managing connections via configuration or are deploying for a broader engineering team, you can add the server directly to your claude_desktop_config.json file. Truto MCP servers speak JSON-RPC 2.0 over standard Server-Sent Events (SSE).

{
  "mcpServers": {
    "imagga_vision": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-sse",
        "https://api.truto.one/mcp/a1b2c3d4e5f67890"
      ]
    }
  }
}

Restart Claude Desktop. The model now has direct, authenticated access to your Imagga API environment.

Imagga Hero Tools for Claude

Truto automatically translates Imagga's complex API endpoints into flattened, LLM-friendly MCP tools. Here are the highest-leverage tools available for visual data processing.

Upload Image for Processing

Tool: create_a_imagga_upload

This is the foundational tool for complex pipelines. Instead of sending an image URL to every endpoint, you upload the file once to Imagga and receive an upload_id. This ID can then be passed to downstream tools like tagging, cropping, and categorization, significantly reducing latency and redundant data transfer.

"Upload this base64 encoded product image to Imagga using create_a_imagga_upload and give me the upload_id so we can use it for tagging and cropping."

Standard Image Tagging

Tool: list_all_imagga_tags

Analyzes an image and returns a flat list of descriptive tags with confidence scores. This tool accepts either an image_url or a previously generated image_upload_id. It is ideal for automatically generating metadata for Digital Asset Management (DAM) systems or e-commerce catalogs.

"Take this image URL and run it through list_all_imagga_tags. Filter the results and only return tags that have a confidence score higher than 40%."

Adult Content Moderation

Tool: list_all_imagga_adult_content_moderation

Classifies an image for adult or explicit content. This tool is critical for platforms handling user-generated content. It evaluates the image and returns categorized risk scores, allowing Claude to make automated moderation decisions before an image goes live.

"Analyze this image upload ID using list_all_imagga_adult_content_moderation. If the explicit content confidence is above 10%, flag the asset for manual human review."

OCR Text Extraction

Tool: list_all_imagga_text

Detects readable text within an image and returns the recognized strings alongside their bounding-box coordinates (xmin, ymin, xmax, ymax). This is exceptionally useful for digitizing physical documents, analyzing street signs in datasets, or extracting copy from marketing banners.

"Run list_all_imagga_text on this image URL. Extract all the visible text and format it into a clean markdown document, ignoring the bounding box coordinates."

Dominant Color Extraction

Tool: list_all_imagga_colors

Extracts the dominant colors of an image, returning detailed palettes including image_colors, background_colors, and foreground_colors. This data is highly valuable for front-end styling algorithms, dynamic UI theming, or filtering e-commerce search results by visual color.

"Use list_all_imagga_colors on this uploaded image ID. Extract the primary background color hex code and write a brief description of the color palette's mood."

Smart Cropping

Tool: list_all_imagga_smart_croppings

Analyzes an image and returns structured crop boxes that preserve the most visually important subjects. Instead of manually cropping assets for different social media dimensions, you can feed an image to this tool and let it determine the optimal x/y coordinates for thumbnail generation.

"Analyze this image URL with list_all_imagga_smart_croppings. Give me the coordinates for the best 1:1 square crop that keeps the primary subject centered."

To view the complete inventory of available endpoints, including Face Similarity, Face Grouping, and Background Removal, visit the Imagga integration page.

Workflows in Action

Exposing individual tools is useful, but MCP's true value emerges when Claude chains these operations together to execute autonomous workflows based on a single prompt.

Scenario 1: Automated Asset Moderation and Metadata Tagging

Content moderation teams face massive backlogs of user-generated images. An AI agent can act as the first line of defense, intercepting assets, moderating them, and tagging them for searchability.

"Process this new batch of image URLs. For each one, check for explicit content. If it passes moderation, generate descriptive tags for our search index and extract the dominant colors so we can categorize it in the database."

How the agent executes this:

  1. Calls list_all_imagga_adult_content_moderation for the first image URL.
  2. Evaluates the risk score. If the image is safe, it proceeds.
  3. Calls list_all_imagga_tags to generate SEO-friendly search keywords.
  4. Calls list_all_imagga_colors to extract the primary foreground and background hex codes.
  5. Compiles the metadata and returns a structured JSON object to the user.
flowchart TD
    A["Agent receives image URL"] --> B["Check moderation<br>(list_all_imagga_adult_content_moderation)"]
    B --> C{Is image safe?}
    C -->|"No"| D["Flag for manual review"]
    C -->|"Yes"| E["Generate Tags<br>(list_all_imagga_tags)"]
    E --> F["Extract Colors<br>(list_all_imagga_colors)"]
    F --> G["Return compiled asset metadata"]

Scenario 2: E-Commerce Product Image Pre-Processing

Merchandising teams spend hours manually uploading photos, writing descriptions, and cropping images for different device views. An agent can automate the entire pre-processing pipeline.

"Take this base64 encoded raw product photo. Upload it to Imagga, extract the visible text on the packaging, generate smart cropping coordinates for our mobile app thumbnail, and output everything as a final metadata report."

How the agent executes this:

  1. Calls create_a_imagga_upload with the base64 string and receives an image_upload_id.
  2. Calls get_single_imagga_text_by_id using the upload ID to perform OCR and extract the label text.
  3. Calls get_single_imagga_smart_cropping_by_id to determine the exact pixel coordinates for the optimal mobile crop.
  4. Synthesizes the OCR text and crop coordinates into a final markdown report for the merchandising team.

Security and Access Control

Giving an LLM access to your computer vision pipelines requires strict governance. Truto MCP servers include multiple layers of security to ensure agents only execute authorized actions.

  • Method Filtering: You can restrict a server to specific operations. Setting methods: ["read"] allows the agent to analyze images and fetch tags, but prevents it from executing state-changing write operations like deleting asynchronous job tickets.
  • Tag Filtering: You can scope tools by functional domain. By applying a tag filter like tags: ["moderation"], the server will only expose content moderation tools, hiding facial recognition and OCR tools from that specific agent.
  • Double Authentication: By enabling require_api_token_auth: true, possession of the MCP URL is no longer enough. The client must also pass a valid Truto API token in the Authorization header, ensuring only verified internal systems can access the server.
  • Time-to-Live (TTL): You can set an expires_at timestamp when generating a server. Truto uses distributed alarms to automatically purge the token and all associated metadata when the TTL expires, making it perfect for temporary agent sessions.

Architecting for Scale

Connecting an AI agent to Imagga via a custom-built integration layer is a heavy engineering lift. You have to handle multipart form data parsing, maintain retry logic for HTTP 429 rate limit responses, build polling loops for async tickets, and keep your API wrappers up to date when Imagga deprecates endpoints.

By leveraging Truto's dynamic MCP server generation, you offload the entire infrastructure burden. Truto derives tools directly from API documentation schemas, handles the secure routing, and provides the exact headers needed for your client to manage rate limit backoffs. This allows your engineering team to stop writing point-to-point connector code and start building actual AI logic.

Two ways to put Imagga to work

Elaichifrom the team behind Truto

For you and your team

Use Imagga in Claude yourself

Connect Imagga once, add Elaichi to Claude, and ask. Every call is checked against your own permissions and logged.

Start free, 14 days No credit card required
Truto

For product teams

Ship Imagga to your customers

Your customers connect their own Imagga accounts. Your product gets one API and MCP tools for Imagga, through Truto.

FAQ

What is the easiest way to connect Imagga to Claude?
The best way to connect Imagga to Claude is Elaichi: connect Imagga to Elaichi once, then add Elaichi to Claude as a connector. Two steps, about a minute, with a 14-day free trial and no credit card required.
How does Truto handle Imagga rate limits?
Truto does not retry, throttle, or apply backoff logic on rate limit errors. When the Imagga API returns an HTTP 429, Truto passes that error directly to the caller, normalizing the upstream rate limit information into standard IETF headers (ratelimit-limit, ratelimit-remaining, ratelimit-reset). The client or agent is responsible for implementing retry/backoff logic.
How does the MCP server handle Imagga's asynchronous jobs?
Heavy operations like face grouping return a ticket ID rather than instant results. The MCP server exposes specific tools to retrieve ticket status (e.g., get_single_imagga_ticket_by_id). You must prompt the LLM to poll this endpoint until it receives a completed status.
Can I restrict which Imagga tools Claude has access to?
Yes. When generating the MCP server via Truto, you can apply method filtering (e.g., 'read' only) or tag filtering (e.g., 'moderation' only). This ensures the LLM only discovers and uses authorized endpoints.
Do I need to send base64 image strings for every operation?
No. While you can send base64 strings or URLs to individual endpoints, the most efficient pattern is to use create_a_imagga_upload to upload the image once. You can then pass the resulting upload_id to downstream tools like tagging or cropping.
Imagga Imagga in Claude14 days free Start free

More from our Blog