# MCP Server

## Overview

The Scaleflex MCP Server enables AI agents and Large Language Models (LLMs) to securely interact with the [**Scaleflex API**](https://developers.scaleflex.com/) through a curated set of tools. It allows LLMs to retrieve and interact with assets from your Scaleflex project.

The server implements the [**Model Context Protocol (MCP)**](https://modelcontextprotocol.io/) and is designed to be consumed by MCP-compatible clients such as [Claude Desktop](https://claude.com), [Mistral Le Chat](https://chat.mistral.ai/), [goose](https://block.github.io/), [LibreChat](https://www.librechat.ai/), etc.

## Architecture

* **Protocol**: [Model Context Protocol (MCP)](https://modelcontextprotocol.io/)
* **Transport**: Streamable HTTP
* **Authentication**: OAuth2 or API token (Bearer)
* **Upstream API**: [Scaleflex DAM API](https://developers.scaleflex.com/)

The server does not expose the full upstream API surface. Instead, it relies on a **simplified and validated OpenAPI specification** to ensure compatibility with MCP tooling and LLM function-calling mechanisms.

## Public MCP Endpoint

```
https://mcp.scaleflex.com/mcp
```

## Authentication

The Scaleflex MCP Server supports two authentication mechanisms:

### OAuth2

If supported by the MCP client, OAuth2 is the recommended authentication method. The client handles token acquisition and renewal automatically.

### API Token Authentication

Clients may also authenticate by explicitly passing an `Authorization` header:

```
Authorization: Bearer TOKEN:KEY
```

Where:

* `TOKEN` is your Scaleflex project token.
* `KEY` is an API key associated with the project.

## Client Setup Guides

### Claude Desktop

#### Custom Connector (Remote MCP)

Follow Anthropic’s official guide for [**Custom Connectors Using Remote MCP**](https://support.claude.com/en/articles/11175166-getting-started-with-custom-connectors-using-remote-mcp). This option is available for Pro, Max, Team and Enterprise plans.

#### Local Proxy Connector

If custom connectors are unavailable, a local MCP proxy can be used via the [`mcp-remote`](https://www.npmjs.com/package/mcp-remote) package:

```json
{
  "mcpServers": {
    "scaleflex-mcp": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://mcp.scaleflex.com/mcp",
        "--allow-http",
        "--header",
        "Authorization:${AUTH_TOKEN}"
      ],
      "env": {
        "AUTH_TOKEN": "Bearer TOKEN:KEY"
      }
    }
  }
}
```

***

### Mistral Le Chat

1. Navigate to **Intelligence → Connectors**
2. Click **Add Connector**
3. Select **Custom MCP Connector**
4. Set the MCP URL to `https://mcp.scaleflex.com/mcp`
5. Choose authentication:
   * OAuth2, or
   * API Token (Bearer `TOKEN:KEY`)
6. Activate the connector in chat

***

### Goose

Configure Goose to load the MCP server as an extension.

#### OAuth2 configuration:

```yaml
extensions:
  scaleflex:
    enabled: true
    type: streamable_http
    name: scaleflex
    uri: https://mcp.scaleflex.com/mcp
    headers: {}
    description: Enables interaction with the Scaleflex API
    timeout: 300
```

#### API token configuration:

```yaml
extensions:
  scaleflex:
    enabled: true
    type: streamable_http
    name: scaleflex
    uri: https://mcp.scaleflex.com/mcp
    headers:
      authorization: bearer TOKEN:KEY
    description: Enables interaction with the Scaleflex API
    timeout: 300
```

Enable the extension so that its tools are available to the LLM during conversations.

***

### LibreChat

1. Deploy LibreChat following the official Quick Start guide
2. Add the MCP server to `librechat.yaml`:

```yaml
mcpServers:
  scaleflex:
    type: streamable-http
    initTimeout: 500000
    url: https://mcp.scaleflex.com/mcp
```

3. Restart the LibreChat API service
4. Authenticate via OAuth2 when enabling the MCP server in chat

## Available Tools

| Tool Name           | Description                                                              |
| ------------------- | ------------------------------------------------------------------------ |
| `fileList`          | Search and retrieve files with metadata, filters, and AI-assisted search |
| `fileUpload`        | Upload new files to the Scaleflex DAM by providing their URLs            |
| ​​`filesDelete`     | Delete uploaded assets by UUID                                           |
| `fileDetails`       | Get information about an asset by UUID                                   |
| `folderList`        | List and search folders with ownership and size information              |
| `productList`       | Retrieve all available products                                          |
| `productFiles`      | List files attached to a specific product reference                      |
| `tagList`           | Retrieve all available tags                                              |
| `tagCreate`         | Create a new tag object                                                  |
| `tagsDelete`        | ​​Delete tag objects by UUID                                             |
| ​​​​`tagsAttach`    | ​​Attach tags to a file                                                  |
| `tagUpdate`         | Update the regional variants of a tag object                             |
| `labelList`         | Retrieve all available labels and usage metadata                         |
| `metaList`          | Retrieve the full custom metadata taxonomy                               |
| `metaUpdate`        | Update the metadata fields of a specific file identified by its UUID     |
| `file_upload_app`   | MCP App for uploading files to the Scaleflex Asset Hub                   |
| `asset_preview_app` | MCP App for interactive preview of a list of asset UUIDs.                |
| `get_languages`     | Return the language codes of all languages associated with the project.  |
| `get_headers`       | Return HTTP headers received by the MCP server                           |
| `get_token`         | Return the authenticated project token                                   |
| `get_current_time`  | Return the current UTC time (ISO 8601)                                   |

## Troubleshooting

### Authentication Errors (401 / 403)

* Verify the token and API key are valid
* Ensure the `Authorization` header format is correct
* Confirm the client supports the chosen authentication method

### Tools Not Appearing in the LLM

* Ensure the MCP server is enabled in the client UI
* Confirm the MCP endpoint is publicly reachable
* Restart the client after configuration changes

### Timeout or Connection Errors

* Increase client-side timeout values
* Verify outbound HTTPS access from the client environment
* Check for corporate firewall or proxy restrictions

### Unexpected Tool Arguments or Validation Errors

* Ensure the LLM is not generating unsupported fields
* Retry with simpler, more explicit prompts
* [Contact us](https://www.scaleflex.com/contact-us) for additional help

## Changelog

### v0.5.0 <a href="#v0.2.0" id="v0.2.0"></a>

* MCP tool for querying asset details by UUID
* MCP GUI app for uploading files
* MCP GUI app for previewing assets

### v0.4.0 <a href="#v0.2.0" id="v0.2.0"></a>

* FastMCP version updated to 3.\*

### v0.3.0 <a href="#v0.2.0" id="v0.2.0"></a>

* MCP tool for asset upload (via URLs)
* MCP tool for asset deletion

### v0.2.0

* MCP tools for tag management (creation, deletion, update, attachment)
* MCP tools for metadata management (field retrieval, update)

### v0.1.0 - Public release

* Initial MCP server implementation
* OAuth2 and API token authentication
* Compatibility with major MCP-enabled clients


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.scaleflex.com/digital-asset-management-dam/plugins-and-connectors/mcp-server.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
