> For the complete documentation index, see [llms.txt](https://docs.baas.sh/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.baas.sh/ai-tools/mcp/setup.md).

# Set up your MCP client

Add the BaaS MCP server to Codex, Claude Code, or another MCP client, and sign in.

Setup takes two steps in any client: add your project's MCP URL, then sign in with your BaaS account in the browser tab that opens. The examples below use `https://my-project-api.baas.sh/mcp`. Replace it with your own URL.

## Before you begin

* A **BaaS project** you have access to. If you can't open it in the BaaS Console, ask a project owner.
* Your project's **MCP URL**. See [Your project's MCP URL](/ai-tools/mcp.md#your-projects-mcp-url).
* A recent version of your AI client. The server uses Streamable HTTP with OAuth sign-in. Update the client if it is more than a few months old.

## Add the server and sign in

{% tabs %}
{% tab title="Codex" %}

### 1. Add the server

```bash
codex mcp add baas --url "https://my-project-api.baas.sh/mcp"
```

### 2. Sign in

```bash
codex mcp login baas
```

Your browser opens on the BaaS sign-in page. Sign in with the account that has access to the project, then return to the terminal.

### 3. Check

```bash
codex mcp list
```

`baas` is listed. Inside a Codex session, type `/mcp` to see the server and its tools.

### Share the server with your team

`codex mcp add` writes to your user configuration, `~/.codex/config.toml`, which applies to every project on your machine. To give the server to everyone who clones the repository, declare it in `.codex/config.toml` at the repository root and commit the file. Codex reads it in trusted projects only.

```toml
# .codex/config.toml

[mcp_servers.baas]
url = "https://my-project-api.baas.sh/mcp"
```

Each person still signs in once on their own machine with `codex mcp login baas`.
{% endtab %}

{% tab title="Claude Code" %}

### 1. Add the server

```bash
claude mcp add --transport http baas https://my-project-api.baas.sh/mcp
```

### 2. Sign in

Start Claude Code in your project and type:

```
/mcp
```

Select **baas**, then **Authenticate**. Your browser opens on the BaaS sign-in page. Sign in with the account that has access to the project, then return to Claude Code.

You can also sign in from the terminal:

```bash
claude mcp login baas
```

### 3. Check

```bash
claude mcp list
```

`baas` is listed as connected. Inside Claude Code, `/mcp` shows the server and its tools.

### Share the server with your team

By default, `claude mcp add` registers the server for you, in the current directory only. To give it to everyone who clones the repository, add it at project scope:

```bash
claude mcp add --transport http --scope project baas https://my-project-api.baas.sh/mcp
```

This writes `.mcp.json` at the repository root. Commit the file:

```json
{
  "mcpServers": {
    "baas": {
      "type": "http",
      "url": "https://my-project-api.baas.sh/mcp"
    }
  }
}
```

Claude Code asks each person to approve the servers in `.mcp.json` the first time they open the project, and each person signs in with their own account. To make the server available in every project on your machine instead, use `--scope user`.
{% endtab %}

{% tab title="Other clients" %}
Any MCP client that supports remote servers over **Streamable HTTP** with **OAuth** can connect. Register the server with these settings:

| Setting        | Value                                                                    |
| -------------- | ------------------------------------------------------------------------ |
| Transport      | Streamable HTTP                                                          |
| URL            | Your project's MCP URL, for example `https://my-project-api.baas.sh/mcp` |
| Authentication | OAuth. The client discovers the sign-in service on its own.              |

Leave any token or header field empty. When the client first connects, it opens the BaaS sign-in page. Sign in with the account that has access to the project.
{% endtab %}
{% endtabs %}

## Sign-in and roles

Sign-in goes through OAuth, with the account you use in the BaaS Console. You never copy a token into a command or a file. Once signed in, the agent gets the tools your role on the project allows, and nothing else. See [Permissions](/ai-tools/mcp/capabilities.md#permissions).

If your role changes, sign out of the server and sign in again so the client picks up the new role: `claude mcp logout baas` then `claude mcp login baas`, or `codex mcp logout baas` then `codex mcp login baas`.

{% hint style="warning" %}
**Never put credentials in a committed file.** The server needs none. `.mcp.json` and `.codex/config.toml` carry the URL only, and the URL is not a secret.
{% endhint %}

## Connect several projects

One server connects to one project. To work with several projects from the same client, add the server once per project under a distinct name, for example `baas-staging` and `baas-production`, each with its own URL.

## Next steps

* [Example prompts](/ai-tools/mcp/example-prompts.md) to try with your agent.
* [MCP server capabilities](/ai-tools/mcp/capabilities.md) for the full list of tools and what the server never does.
