# MCP server (/mcp)



UnifAPI ships an [MCP](https://modelcontextprotocol.io) server so any MCP-compatible client — Claude Desktop, Claude Code, Cursor, Codex CLI — can call the catalog without writing HTTP code.

## Endpoint [#endpoint]

```
https://mcp.unifapi.com
```

Authenticate with the same workspace key you use for the HTTP API.

## Claude Desktop [#claude-desktop]

Add UnifAPI to `claude_desktop_config.json`:

```json
{
  "mcpServers": {
    "unifapi": {
      "url": "https://mcp.unifapi.com",
      "headers": {
        "Authorization": "Bearer ${UNIFAPI_KEY}"
      }
    }
  }
}
```

Restart Claude Desktop. The catalog appears under the tools menu — every UnifAPI endpoint becomes a callable tool.

## Claude Code [#claude-code]

```bash
claude mcp add unifapi \
  --transport http \
  --url https://mcp.unifapi.com \
  --header "Authorization: Bearer $UNIFAPI_KEY"
```

Then `/mcp` inside Claude Code to confirm the server is connected.

## Cursor [#cursor]

Open **Settings → MCP → Add new server** and paste:

```json
{
  "unifapi": {
    "url": "https://mcp.unifapi.com",
    "headers": {
      "Authorization": "Bearer YOUR_UNIFAPI_KEY"
    }
  }
}
```

## What the client sees [#what-the-client-sees]

The server exposes one tool per endpoint, plus a discovery tool for browsing the catalog:

| Tool                     | What it does                                |
| ------------------------ | ------------------------------------------- |
| `unifapi.search_catalog` | Find endpoints by keyword or category       |
| `unifapi.describe`       | Return the JSON schema for a given endpoint |
| `unifapi.call`           | Invoke any endpoint with its parameters     |

<Callout type="info">
  MCP calls share the same workspace balance and rate limits as direct HTTP calls. There is no separate MCP pricing.
</Callout>

## Troubleshooting [#troubleshooting]

* **401 from the MCP server** — the `Authorization` header is missing or the key was rotated. Generate a new key in the dashboard.
* **Tool list is empty** — the client cached an old session. Restart the client; the catalog refreshes on connect.
