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

# Authentication

> How to authenticate with Soria — via the web UI login or MCP server connection.

Soria uses Clerk-backed authentication. You sign in through a browser login page, and the same identity is used across the web UI and MCP server.

## Web UI

Navigate to your Soria instance and you'll be redirected to the login page if you're not authenticated. Sign in with your credentials — no additional setup required.

## MCP via proxy (recommended)

The MCP proxy handles authentication automatically. Once you've added it to your Claude Code config and the backend is running, Claude Code authenticates through the browser flow on first connection.

```json theme={null}
{
  "mcpServers": {
    "soria": {
      "command": "uv",
      "args": ["--directory", "/path/to/soria", "run", "python", "-m", "soria.mcp_proxy"]
    }
  }
}
```

No API keys or tokens to manage — the proxy picks up your existing session.

## MCP via direct HTTP

When connecting directly to the MCP endpoint, use:

```bash theme={null}
claude mcp add --transport http soria http://localhost:8900/mcp/
```

For a deployed instance, replace the URL with your deployment's address:

```bash theme={null}
claude mcp add --transport http soria https://your-soria-instance.example.com/mcp/
```

Claude Code will prompt you to authenticate via browser on first use.

## Switching environments

The MCP proxy supports switching between environments (local, staging, production, PR previews) without re-authenticating:

```
Use environment_list to show available environments
Use environment_switch to connect to soria-my-feature
```

See [Connecting](/mcp/connecting) for full environment switching details.

<Note>
  If you see authentication errors after switching environments, use `environment_switch` with the `local` target to reconnect to your local backend, then switch back to the intended environment.
</Note>
