# MCP setup

The Layer MCP server is available at `https://mcp.app.layer.ai/mcp` over Streamable HTTP. Most clients connect with **OAuth** — you log in with your Layer account the first time the client uses Layer. Find your client below.

## Authenticate with a token instead

If a client doesn’t support OAuth (or you prefer a static credential), authenticate with a [Personal Access Token](/docs/authentication). Generate one at [**User Settings → New Token**](https://app.layer.ai/settings) (it starts with `pat_`), then add an `Authorization` header to the client’s config:

* CLI flag: `--header "Authorization: Bearer YOUR_PAT"`
* JSON config: `"headers": { "Authorization": "Bearer YOUR_PAT" }`

## Connect your client

### Claude.ai / Claude Desktop

The simplest way is to add Layer as a **custom connector** through the UI — no config files or Node.js required.

* **Pro / Max (single seat):** Open **Settings > Connectors**, click **\+ Add custom connector**, enter `https://mcp.app.layer.ai/mcp`, and click **Add**.
* **Team / Enterprise:** Only an Owner can add a connector for the organization, via **Organization settings > Connectors > Add > Custom > Web**. Members then authenticate individually under **Settings > Connectors**.

OAuth triggers on first use — log in with your Layer account when prompted.

Note

Custom connectors are currently in beta. The connection runs from Anthropic’s cloud, not your machine, so Layer must be reachable over the public internet (it is by default).

Older clients: add Layer with a local config file

If your version doesn’t support custom connectors, add Layer as a local server via `mcp-remote` (requires Node.js). In **Settings > Developer > MCP Servers**, add this config:

```json
{
  "mcpServers": {
    "Layer": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.app.layer.ai/mcp"]
    }
  }
}
```

`mcp-remote` is installed automatically via npx.

### Claude Code (CLI)

Add the server, then authenticate from the `/mcp` panel:

```bash
claude mcp add --transport http Layer https://mcp.app.layer.ai/mcp
```

Launch Claude Code, run `/mcp`, select **Layer**, and choose **Authenticate** — log in with your Layer account in the browser window that opens.

Note

If this fails with a transport error, try `--transport sse` instead — the correct flag depends on your Claude Code version.

### Codex

Run this command, or add it to `~/.codex/config.toml` manually:

```bash
codex mcp add layer -- npx -y mcp-remote@latest https://mcp.app.layer.ai/mcp
```

OAuth triggers on first use.

### Cursor

[Install with Cursor](cursor://anysphere.cursor-deeplink/mcp/install?name=Layer&config=eyJ0eXBlIjoiaHR0cCIsInVybCI6Imh0dHBzOi8vbWNwLmFwcC5sYXllci5haS9tY3AifQ==) 

Or add it manually in **Settings > Features > MCP**: click **\+ Add New MCP Server**, choose **Streamable HTTP**, name it `Layer`, and use the URL `https://mcp.app.layer.ai/mcp`. OAuth triggers automatically — log in when prompted.

### Windsurf

Open the Command Palette (**Cmd + Shift + P**), search for **MCP: Add Server**, and select **HTTP** — or add this to `~/.codeium/windsurf/mcp_config.json`:

```json
{
  "mcpServers": {
    "Layer": {
      "serverUrl": "https://mcp.app.layer.ai/mcp"
    }
  }
}
```

The OAuth flow triggers automatically. Verify it works by asking: _“What can I do with Layer?”_

### VS Code

[Install with VS Code](vscode:mcp/install?%7B%22name%22%3A%22Layer%22%2C%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.app.layer.ai%2Fmcp%22%7D) 

Or manually add this to `.vscode/mcp.json`:

```json
{
  "servers": {
    "Layer": {
      "type": "http",
      "url": "https://mcp.app.layer.ai/mcp"
    }
  }
}
```

OAuth triggers on first use — log in with your Layer account when prompted.

### Gemini CLI

Run this command, or add it to `~/.gemini/settings.json` manually:

```bash
gemini mcp add --transport http Layer https://mcp.app.layer.ai/mcp
```

OAuth triggers on first use.

### Amp

Run this command — Amp authenticates via Dynamic Client Registration:

```bash
amp mcp add layer https://mcp.app.layer.ai/mcp
```

### OpenCode

Edit `~/.config/opencode/opencode.json`:

```json
{
  "mcp": {
    "Layer": {
      "type": "remote",
      "url": "https://mcp.app.layer.ai/mcp"
    }
  }
}
```

OAuth triggers automatically on first use — log in with your Layer account when prompted.

### Warp

In **Settings > AI > Manage MCP servers > + Add > CLI Server**, enter this command:

```bash
npx -y mcp-remote@latest https://mcp.app.layer.ai/mcp
```

OAuth triggers on first use.

### Zed

Zed only supports stdio transport — use `mcp-remote` as a bridge. Add this to `~/.config/zed/settings.json`:

```json
{
  "context_servers": {
    "Layer": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.app.layer.ai/mcp"]
    }
  }
}
```

OAuth triggers automatically on first use — log in with your Layer account when prompted.

### OpenClaw

Add Layer with the OpenClaw CLI:

```bash
openclaw mcp set layer '{
  "transport": "streamable-http",
  "url": "https://mcp.app.layer.ai/mcp"
}'
```

OAuth triggers on first use — sign in with your Layer account when prompted.

### Hermes

Paste this into `~/.hermes/config.yaml`:

```yaml
mcp_servers:
  layer:
    url: "https://mcp.app.layer.ai/mcp"
```

Sign in with your Layer account when Hermes asks you.

### Manus

Manus doesn’t have a built-in OAuth flow — connect with a [Personal Access Token](#authenticate-with-a-token-instead). In Manus, go to **Personalization > Connectors > Add connector > Custom MCP > Import by JSON** and paste:

```json
{
  "mcpServers": {
    "Layer": {
      "type": "streamableHttp",
      "url": "https://mcp.app.layer.ai/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_PAT"
      }
    }
  }
}
```

Replace `YOUR_PAT` with your token and click **Save**.

### Other clients

Any MCP client that can launch a command can connect through the `mcp-remote` bridge (requires Node.js):

```json
{
  "mcpServers": {
    "Layer": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "https://mcp.app.layer.ai/mcp"]
    }
  }
}
```

Add `"--header", "Authorization: Bearer YOUR_PAT"` to `args` to use a [token](#authenticate-with-a-token-instead) instead of OAuth.

## Troubleshooting

**Layer doesn’t appear in my Connectors list (Claude)**On a personal **Pro / Max** account, add it yourself under **Settings > Connectors > + Add custom connector**. On **Team / Enterprise**, an Owner must add it org-wide first (**Organization settings > Connectors**) — after that, authenticate it individually under **Settings > Connectors**.

**Authorization fails or times out**Make sure you have an active Layer account at [layer.ai](/). If you’re behind a VPN or corporate firewall, the OAuth redirect may be blocked — try on a direct connection.

**Agent doesn’t seem to use Layer tools**Start a new conversation after connecting — existing conversations may not pick up new MCP servers. Check that the connector status shows as connected.

**Claude Code: “unknown transport” error**Try `--transport sse` instead of `--transport http` — the correct flag depends on your Claude Code version.

**Codex: MCP server not loading**Make sure `mcp-remote` is installed correctly. Try running `npx -y mcp-remote@latest` to verify. If using a token, ensure your `Authorization` header is set correctly and restart Codex.

**Cursor / VS Code / Windsurf: connection fails**Verify the MCP server URL is exactly `https://mcp.app.layer.ai/mcp`. If using a token, check that the `Authorization` header value starts with `Bearer ` (with a space) followed by your token.

**Manus: tools not working**Verify that your Personal Access Token is valid and the `Authorization` header value starts with `Bearer ` (with a space) followed by your token. Make sure the transport type is `streamableHttp` in the JSON config.

**Gemini CLI: authentication error**If using a token, ensure the header flag is formatted correctly: `--header "Authorization: Bearer YOUR_PAT"`. If using OAuth, the flow should trigger automatically on first tool use.
