Clarifai MCP Server logo

Clarifai MCP Server

by tot-ra

The Clarifai MCP Server is a local server that bridges the Clarifai API and MCP clients, enabling interaction with Clarifai services like image generation and inference. It allows MCP clients to interact with Clarifai using standard MCP requests without overloading LLM context with heavy binary results.

View on GitHub

Last updated: N/A

What is Clarifai MCP Server?

The Clarifai MCP Server is a Model Context Protocol (MCP) server designed to run locally and act as an intermediary between MCP clients (like IDE extensions) and the Clarifai API. It facilitates interaction with Clarifai services such as image generation and inference by handling MCP requests.

How to use Clarifai MCP Server?

To use the server, first clone the repository and build the binary using go build. Then, configure your MCP client (e.g., VS Code) with the path to the binary and any required command-line arguments, such as your Clarifai PAT. Run the server, and the MCP client can then send requests to it.

Key features of Clarifai MCP Server

  • Provides MCP tools for uploading files, generating images, and performing inference on images by path or URL.

  • Exposes Clarifai entities as read-only MCP resources, allowing clients to list, search, and read data.

  • Supports a consistent URI structure for accessing Clarifai resources.

  • Utilizes JSON-RPC 2.0 over stdio for seamless integration with MCP client frameworks.

Use cases of Clarifai MCP Server

  • Integrating Clarifai's image generation capabilities into IDEs or other development tools.

  • Providing a local interface for interacting with Clarifai's API without exposing the PAT directly to the client.

  • Enabling AI agents to automatically call image generation and place results on the desktop.

  • Performing inference on local images or images from URLs within a development workflow.

FAQ from Clarifai MCP Server

What is MCP?

MCP stands for Model Context Protocol. It's a standard protocol for communication between tools and services related to machine learning models.

How do I get a Clarifai PAT?

You can obtain a Personal Access Token (PAT) from your Clarifai account settings on the Clarifai website.

Where are generated images saved?

Generated images are saved to the directory specified by the --output-path command-line argument. If no path is specified, the default location may vary.

What resource types are supported?

The server supports listing, searching, and reading Inputs, Annotations, Models, Model Versions, Datasets, and Dataset Versions.

How does authentication work?

Authentication is handled using a Personal Access Token (PAT) provided via the --pat command-line flag, which is included in the metadata of outgoing gRPC requests to the Clarifai API.