# Connect an agent

Source: https://dropshelf.ai/docs/agents/connect

Connect Claude Code, Codex, Cursor, OpenCode or any other MCP client to dropshelf, with one line in a terminal, an OAuth sign-in or a personal access token.

Connect an AI agent to dropshelf so it can publish, share and update drops as you. This page is for
members who use Claude Code, Codex, Cursor, OpenCode or another client that speaks the Model Context
Protocol (MCP).

Every instance serves its MCP server at one address, the dashboard's address followed by `/mcp`:

```text
https://drop.example.com/mcp
```

There are three ways to connect, and you need only one:

- **One line in a terminal.** Any agent that can run commands sets itself up with the `dropshelf` CLI.
- **OAuth sign-in.** Claude Code and Codex sign in to the MCP server in your browser, where your
  instance offers it.
- **A personal access token.** Cursor, OpenCode and every other MCP client send a token.

## Prerequisites [#prerequisites]

- You can sign in to your dropshelf instance.
- An agent that can run commands in a terminal, or an MCP client that supports the Streamable HTTP
  transport.

## Set up an agent in one line [#set-up-an-agent-in-one-line]

To connect an agent that can run commands, such as Claude Code or Codex, paste this line into it:

```text
Set me up on dropshelf: curl https://drop.example.com/start.md and follow it.
```

The agent installs the `dropshelf` CLI that matches your instance and signs you in. You approve the
sign-in in your browser, so no token passes through the chat. The **CLI** tab of the **Connect your
agent** dialog shows the line with your instance's address. [The dropshelf CLI](/docs/agents/cli)
covers the CLI itself.

To use the MCP server instead, continue with the sections below.

## Find the commands for your instance [#find-the-commands-for-your-instance]

The dashboard has the exact commands, with your instance's address already in them:

1. Select **Connect** at the top of the dashboard, then **Your agent** if a menu opens. The
   **Connect your agent** dialog opens.
2. Select the **MCP** tab.
3. In **Client**, choose **Claude Code**, **Codex CLI**, **Codex app** or **Other**.

Each command has its own copy button. When your instance does not offer OAuth sign-in, the dialog
shows the token commands instead and links the **Connections** page.

## Sign in with OAuth [#sign-in-with-oauth]

Claude Code and Codex sign in through dropshelf's own consent page in your browser. Nobody pastes a
token into a chat, and the client renews its own access.

To connect Claude Code:

1. Add the server. `-s user` makes dropshelf available in every project, not only the current folder.

   ```bash
   claude mcp add --transport http -s user dropshelf https://drop.example.com/mcp
   ```

2. Sign in:

   ```bash
   claude mcp login dropshelf
   ```

   A browser opens on your instance. If you are not signed in to dropshelf yet, you sign in first.
3. Select **Approve** on the consent page, then close the tab.

To connect the Codex CLI, run the same two steps with its own commands:

```bash
codex mcp add dropshelf --url https://drop.example.com/mcp
codex mcp login dropshelf
```

In the Codex app, open **Settings > MCP servers > Add server**. Name the server `dropshelf`, choose
Streamable HTTP, enter the address, and select **Authenticate**.

The sign-in lasts while you use it. It ends when it goes unused for longer than your instance allows,
when an admin disables your account, or when you revoke it. To sign in again, run
`claude mcp login dropshelf` or `codex mcp login dropshelf`.

Each app you sign in from appears on the **Connections** page, on the **Apps and tokens** tab, under **Signed-in apps**, where you
can sign it out. See [Personal access tokens](/docs/use/tokens).

## Connect with a personal access token [#connect-with-a-personal-access-token]

Use a token for any other MCP client, for a script, or when your instance does not offer OAuth
sign-in.

1. Create a token on the **Connections** page. [Personal access tokens](/docs/use/tokens) shows how.
2. Point your client at `https://drop.example.com/mcp` over Streamable HTTP.
3. Have the client send the token on every request as `Authorization: Bearer <token>`.

For Claude Code, the add command carries the header:

```bash
claude mcp add --transport http -s user dropshelf https://drop.example.com/mcp --header "Authorization: Bearer <token>"
```

For the Codex CLI, set `DROPSHELF_TOKEN` to the token in your shell, then add the server:

```bash
codex mcp add dropshelf --url https://drop.example.com/mcp --bearer-token-env-var DROPSHELF_TOKEN
```

For Cursor, set `DROPSHELF_TOKEN` in your shell profile, then add the server to `~/.cursor/mcp.json`,
or to `.cursor/mcp.json` in one project. Cursor reads the token from the environment:

```json
{
  "mcpServers": {
    "dropshelf": {
      "url": "https://drop.example.com/mcp",
      "headers": {
        "Authorization": "Bearer ${env:DROPSHELF_TOKEN}"
      }
    }
  }
}
```

For OpenCode, set `DROPSHELF_TOKEN` in your shell, then add the server to your OpenCode
configuration. `oauth: false` makes OpenCode send the token instead of starting an OAuth sign-in:

```json
{
  "$schema": "https://opencode.ai/config.json",
  "mcp": {
    "servers": {
      "dropshelf": {
        "type": "remote",
        "url": "https://drop.example.com/mcp",
        "oauth": false,
        "headers": {
          "Authorization": "Bearer {env:DROPSHELF_TOKEN}"
        }
      }
    }
  }
}
```

For any other client, use the address and the header from the steps above in its MCP settings.

A token acts as you until it expires or you revoke it. It cannot create or revoke other tokens.

## Check whether your instance offers OAuth [#check-whether-your-instance-offers-oauth]

Your admin decides whether agents can sign in with OAuth. See
[Identity provider](/docs/self-host/configure/identity-provider#sign-in-for-agents).

A script finds out from the `mcp` block of the instance's description:

```bash
curl -sS -H "Authorization: Bearer <token>" https://drop.example.com/api/v1/instance | jq .mcp
```

```text
{
  "url": "https://drop.example.com/mcp",
  "oauth": true
}
```

When `oauth` is `false`, connect with a token.

## The skills an agent gets [#the-skills-an-agent-gets]

dropshelf teaches an agent how to work with it through skills:

- **The `dropshelf` skill** comes from the MCP server through the MCP Skills extension. A client that
  supports the extension loads the skill from your instance, so it always matches the instance's
  version and settings.
- **The `dropshelf-cli` skill** comes with the CLI. `dropshelf login` offers to install it, and
  `dropshelf skills install` installs it for Claude Code, Codex, Cursor and OpenCode.

## What an agent can do [#what-an-agent-can-do]

Once connected, the agent works with the same permissions as you:

- Create drops and new versions, publish them and roll back.
- Change a drop's name, address, retention and visibility, and share it with people.
- Read comments, reply to them and resolve change requests.
- Read and write a drop's stored data, where an admin has turned it on.
- Read company data through connectors, where an admin has turned them on.

Every tool and resource is listed in the [MCP reference](/docs/reference/mcp).

## Confirm it worked [#confirm-it-worked]

Ask the agent to list your drops. It answers with the drops you own, or says you have none yet.

## Prompts to try [#prompts-to-try]

These prompts each use a different part of dropshelf:

- "Build a dashboard of last week's deploys and put it on dropshelf for 30 days."
- "Read the comments on the deploys drop, fix what they ask for and publish a new version."
- "Share the deploys drop with ana@example.com as a viewer."

## Next steps [#next-steps]

- [The dropshelf CLI](/docs/agents/cli)
- [Publish from CI](/docs/agents/ci)
- [Build on the drop platform](/docs/agents/platform)
- [MCP reference](/docs/reference/mcp)
- [Personal access tokens](/docs/use/tokens)
