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

# MCP server

> Connect a coding agent to your Opper account so it can create projects and API keys, check models and make calls, with your approval in the browser

Opper has an MCP server at `https://api.opper.ai/mcp`. Connect a coding agent to it and the agent can set up Opper for you: create a project, create an API key, check that a model is available and make a first call. You approve the connection once in the browser and choose what the agent may do.

Sign up needs no credit card. Free models work before you add a card, so an agent can take you from no account to a working call without you opening the dashboard.

<Note>
  This is not the documentation search server. `https://docs.opper.ai/mcp` lets an agent search these docs, needs no sign-in and cannot see or change your account. Use that one when an agent needs to look something up, and the server on this page when it needs to do something.
</Note>

## Connect your agent

Add a remote (HTTP) MCP server with the URL `https://api.opper.ai/mcp`. Leave out any API key and any scope list. The client opens a browser window where you sign in and choose the permissions.

The server speaks MCP over Streamable HTTP and signs you in with OAuth. It keeps no session, so there is nothing to reconnect after a deploy.

### OpenCode

Tested with OpenCode 1.18. Add this to `opencode.json`:

```json theme={null}
{
  "mcp": {
    "opper": {
      "type": "remote",
      "url": "https://api.opper.ai/mcp",
      "enabled": true
    }
  }
}
```

Then authenticate and restart the TUI:

```bash theme={null}
opencode mcp auth opper
opencode mcp list   # should report "connected"
```

### Other clients

Any MCP client that supports remote servers with OAuth sign-in can use the URL above. OpenCode is the one we have tested end to end so far.

## What happens when you connect

1. Your agent asks to connect and your browser opens `platform.opper.ai`.
2. You sign in, or create an account if you do not have one. No card is asked for.
3. You pick the organization and what the agent may do. **Read only** is selected to begin with. **Build and manage** adds projects, API keys, rules, routes and model calls. Deleting projects is a separate checkbox.
4. The agent continues on its own. Nothing is pasted into the conversation.

The authorization link is valid for ten minutes. If sign-up takes longer, ask the agent to start the connection again.

## Permissions

You grant permissions per connection. The agent never gets more than you ticked, and adding one later needs a new approval in the browser.

| Permission                                           | Lets the agent                                                                                                                    |
| ---------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| `account:read`                                       | See which account and organization it is connected to, the plan and billing status, and check whether a model is available to you |
| `projects:read`, `projects:write`, `projects:delete` | List, create and edit, or delete projects                                                                                         |
| `apikeys:read`, `apikeys:write`                      | List API keys (prefix only), or create and delete them                                                                            |
| `controls:read`, `controls:write`                    | Read or change rules. Changing rules needs a plan that includes them                                                              |
| `dynamic_routes:read`, `dynamic_routes:write`        | Read, or build, simulate, deploy and roll back custom routes                                                                      |
| `runtime:call`                                       | Make real model calls with one of your project's keys. Normal costs and rules apply                                               |
| `runtime:read`                                       | Read usage, costs and traces                                                                                                      |

## What works without an account

Two tools need no sign-in, so an agent can look around first:

* `list_models` searches the public model catalog.
* `get_guide` returns short recipes for getting started, connecting an app, structured output, rules and debugging.

Every other tool answers with a sign-in challenge, which is what makes the client open the browser.

## API keys

When the agent creates an API key, the secret stays on the server by default. The agent gets the key's ID and can make calls with it through the `call_model` tool. That keeps the secret out of the model conversation.

To use the key in your own application, create one under **Settings, API keys** in the dashboard and set it as `OPPER_API_KEY`. An agent can ask for the secret when it creates a key, but anything a tool returns can end up in the conversation, so only do that with a client you trust to handle it privately.

## Staying in control

* See and disconnect your agents at [platform.opper.ai/mcp/connections](https://platform.opper.ai/mcp/connections). A disconnected agent stops working on its next request.
* Disconnecting an agent does not delete API keys it created. Delete those under **Settings, API keys**.
* The agent acts as you, in the one organization you picked. If you leave that organization, its connections stop working.
* Billing, adding a card and managing members stay in the dashboard.
