> ## Documentation Index
> Fetch the complete documentation index at: https://docs.solya.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Connect an MCP client

> Get a token and point Claude, Cursor, or any MCP client at the Solya gateway — remote (HTTP) or local (stdio).

## 1. Get a token

The gateway authenticates with a [service-account token](/en/developers/authentication).
Create one under **Settings → API tokens** with the permissions your agent needs, and copy
the `solya_sa_…` value (shown once).

<Warning>
  The token grants whatever its permissions allow, with no human in the loop. Scope it to
  the minimum and store it in your MCP client's secret config — never in shared files.
</Warning>

## 2. Find the gateway URL

The server URL is shown on **Settings → MCP** (copyable). In production it is:

```
https://api-mcp.solya.app/mcp
```

## 3a. Connect remotely (HTTP) — Claude, Cursor

Most clients take a JSON config. Add the Solya server with your token as a bearer header:

```json theme={null}
{
  "mcpServers": {
    "solya-api": {
      "url": "https://api-mcp.solya.app/mcp",
      "headers": { "Authorization": "Bearer solya_sa_xxx" }
    }
  }
}
```

The **Settings → MCP** page generates this snippet per client (Claude, Cursor, Generic) so
you can copy it directly.

For a client that only takes raw values:

```
MCP server URL: https://api-mcp.solya.app/mcp
Header:         Authorization: Bearer solya_sa_xxx
```

## 3b. Connect locally (stdio)

For local use (e.g. Claude Desktop / Claude Code running the gateway as a subprocess), the
gateway runs over **stdio** and reads the token from the environment:

```json theme={null}
{
  "mcpServers": {
    "solya-api": {
      "command": "node",
      "args": ["/absolute/path/to/solya-api-mcp/dist/index.js"],
      "env": {
        "SOLYA_API_BASE_URL": "https://app.solya.app",
        "SOLYA_API_TOKEN": "solya_sa_xxx"
      }
    }
  }
}
```

## 4. Verify

Ask your agent to run `search_operations` (e.g. *"list Solya operations for brands"*), then
`describe_operation` and `invoke_operation` on a read endpoint. A `whoami`-style call is a
good first check that the token resolves to the right organization and permissions.

<Note>
  Transports: the hosted gateway speaks modern **Streamable HTTP** at `/mcp` (with a legacy
  **SSE** fallback); the local mode speaks **stdio**. Pick whichever your client supports —
  most modern clients use the remote HTTP config in 3a.
</Note>
