# Connect your assistant

Restolayer's MCP server is at `https://manage.restolayer.com/mcp` (Streamable HTTP, JSON responses). Assistants connect with OAuth (they
register themselves and you approve them) or with an API key.

## What it may do

Two things decide it, both set by you in the web app:

1. **The scopes you approve** when it connects: `gateway:read` to read keys, credits, usage and logs, and
   `gateway:write` to change them, within the limits a person set.
2. **Its access level** (Agent access): read only, read and draft, or read, draft and propose. Raising a level is
   done by an owner in the web app; no assistant can raise its own.

You can lower or revoke either at any time; revoking takes effect on the next call. Every call is in the audit log
with the assistant's name.

## Claude

- **Claude (claude.ai, desktop):** Settings → Connectors → Add custom connector, URL `https://manage.restolayer.com/mcp`. Claude opens
  Restolayer's sign-in and consent screen; approve the scopes. The connector then lists Restolayer's tools.
- **Claude Code:** `claude mcp add --transport http restolayer https://manage.restolayer.com/mcp`, then run `/mcp` and choose
  Authenticate to sign in with OAuth. With a key instead, see [the Claude Code quickstart](https://www.restolayer.com/docs/quickstart/claude-code).

## ChatGPT

Settings → Apps and connectors → Advanced → developer mode, then create a connector with the server URL `https://manage.restolayer.com/mcp`.
ChatGPT registers itself and opens the consent screen. Self-registered apps show as "not verified" until reviewed.
More: [the ChatGPT quickstart](https://www.restolayer.com/docs/quickstart/chatgpt).

## Cursor

Add the server to `.cursor/mcp.json` (or `~/.cursor/mcp.json`) with just the URL, and Cursor runs the OAuth sign-in
when it first connects:

```json
{ "mcpServers": { "restolayer": { "url": "https://manage.restolayer.com/mcp" } } }
```

With a key instead, see [the Cursor quickstart](https://www.restolayer.com/docs/quickstart/cursor).

## The OAuth steps (any client)

1. The client reads `https://manage.restolayer.com/.well-known/oauth-protected-resource/mcp`, which names the authorization server,
   the scopes (`gateway:read`, `gateway:write` …).
2. It registers itself (RFC 7591 dynamic client registration) and starts an authorization-code flow with PKCE.
3. You sign in at https://app.restolayer.com and approve the scopes on the consent screen.
4. It receives a token bound to `https://manage.restolayer.com/mcp` and calls the tools. Connected apps are listed, and can be disconnected, in
   the web app.

## Check it

Ask the assistant: "Who am I in Restolayer, and what may you do?" It calls
[`lg_whoami`](https://www.restolayer.com/docs/mcp/tools/lg_whoami) and answers with your organization and its scopes.

Next: [the MCP tools](https://www.restolayer.com/docs/mcp/tools), [the CLI](https://www.restolayer.com/docs/quickstart/cli),
[the REST API](https://www.restolayer.com/docs/quickstart/rest).
