# Connect

> Add the Maylee MCP server to Claude, ChatGPT, Claude Code, Cursor, VS Code or any MCP client, with OAuth or an API key.

Source: https://docs.maylee.app/mcp/connect

> **Coming soon**
>
> The Maylee MCP server is being rolled out and does not answer at this address yet. This page describes how it will work. In the meantime, the [REST API](/api-reference) is available.

The server URL is the same for every client:

```txt
https://mcp.maylee.app/mcp
```

## Connect with OAuth (recommended)

Your assistant discovers everything from the URL: it receives a `401` with an OAuth challenge, reads the discovery documents, registers itself (dynamic client registration, nothing to create on the Maylee side), and opens a Maylee page in your browser. The steps below follow each client's own documentation.

### Claude (claude.ai and Claude Desktop)

Custom connectors are added once to your Claude account, on claude.ai, and are then available in Claude Desktop too. Every plan can add them; the free plan is limited to one custom connector.

**Pro and Max**

1. On claude.ai, open **Customize**, then **Connectors*&#x2A;. Click **+ Add**, then **Add custom connector**.
2. Name it `Maylee`, enter `https://mcp.maylee.app/mcp` as the remote MCP server URL, then click **Continue**.
3. Keep the detected authentication (sign-in with OAuth) and click **Continue**. For the OAuth client, choose **Register automatically**: Maylee registers Claude through dynamic client registration.
4. Click **Add**, then sign in to Maylee in the page that opens (see [below](#in-the-browser)).

In a conversation, click &#x2A;*+** in the lower left, then **Connectors**, and turn Maylee on.

**Team and Enterprise**

An owner adds the connector once: **Organization settings**, **Connectors**, **Add**, **Custom**, **Web**, then the same name, URL and settings as above. Each member then opens **Customize**, **Connectors**, finds Maylee and clicks **Connect**: everyone signs in to their own Maylee account and picks their own workspace.

### Claude Code

```bash
claude mcp add --transport http maylee https://mcp.maylee.app/mcp
```

Add `--scope user` to use it in every project. Then run `/mcp` in Claude Code, select `maylee` and sign in to Maylee in the browser page that opens.

### ChatGPT

Custom MCP servers are added on the ChatGPT website. Depending on your plan, a workspace admin may first have to allow developer mode and custom MCP servers.

1. Go to **Plugins** (`chatgpt.com/plugins&#x60;), select &#x2A;*+**, then **Add custom MCP server**.
2. Name it `Maylee`. Under **Connection**, enter `https://mcp.maylee.app/mcp` as the **Server URL**.
3. For authentication, choose **OAuth** without static credentials: ChatGPT registers itself through dynamic client registration.
4. Review the warning, select **I understand and want to continue**, then **Create as a plugin**, and sign in to Maylee when asked.
5. Install the plugin, then use it in a conversation.

### Cursor

Add the server to `.cursor/mcp.json` in a project, or to `~/.cursor/mcp.json` for every project:

```json
{
  "mcpServers": {
    "maylee": {
      "url": "https://mcp.maylee.app/mcp?toolsets=reference,emails,compose"
    }
  }
}
```

Cursor runs the OAuth sign-in itself when the server asks for it. The `toolsets` filter keeps the list to the reference, emails and compose tools: the full server has 69 tools, and every tool description takes room in the model's context. Add `config` or `account` if you need them. See [Toolsets](#toolsets).

### VS Code

Run **MCP: Add Server** from the Command Palette and follow the guided flow with the URL above, or add the server to `.vscode/mcp.json` in a workspace (or to your user configuration, **MCP: Open User Configuration**):

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

On the first connection, VS Code registers itself (dynamic client registration) and opens the Maylee sign-in in your browser.

### MCP Inspector and other clients

Add a Streamable HTTP server with the URL above. A client that supports MCP authorization handles the OAuth flow by itself.

### In the browser

1. **Sign in to Maylee**, second factor included if you use one.
2. **Check the consent screen.** The application name is declared by the application itself, so it is shown as unverified. Check above all **the address you will be sent back to**: for example `claude.ai`, "a program running on this computer" for Claude Code, or `cursor://...`. If the application declared other return addresses, they are listed too. Only continue if you started the connection yourself.
3. **Pick one workspace** and choose the [permissions](/mcp/permissions), then **Allow**.

Each connection is bound to the workspace and the return address you approved. To use another workspace, connect again and pick it.

### Manage connections

Connected assistants are listed in Maylee under **Settings**, **API keys**, &#x2A;*AI assistants (MCP)**, where each one can be revoked. A revoked assistant loses access within a minute and its tokens never work again, even if you connect the same assistant later. Resetting your password disconnects every assistant.

Access tokens last 30 days and refresh tokens 180 days, rotated on every use. Every request checks again that the connection is still active, that you are still a member of the workspace and that the workspace is not suspended.

## Connect with an API key

For automation, CI jobs and clients configured with a header, use a Maylee API key, created by a workspace owner or admin in **Settings**, **API keys** (see [Authentication](/authentication)):

```bash
claude mcp add --transport http maylee https://mcp.maylee.app/mcp \
  --header "Authorization: Bearer mk_..."
```

In Cursor or any client that accepts headers:

```json
{
  "mcpServers": {
    "maylee": {
      "url": "https://mcp.maylee.app/mcp",
      "headers": { "Authorization": "Bearer mk_..." }
    }
  }
}
```

In VS Code, an input variable keeps the key out of the file: VS Code asks for it once and stores it securely.

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "maylee-api-key",
      "description": "Maylee API key",
      "password": true
    }
  ],
  "servers": {
    "maylee": {
      "type": "http",
      "url": "https://mcp.maylee.app/mcp",
      "headers": { "Authorization": "Bearer ${input:maylee-api-key}" }
    }
  }
}
```

| API key setting               | MCP permission     |
| ----------------------------- | ------------------ |
| `read` scope (required)       | Read               |
| `write` scope                 | Organize and draft |
| **Send emails**, with `write` | Send               |

Tools that act for a person (reply reminders, notification settings) need OAuth and are hidden for API keys.

## Toolsets

A client can load only some toolsets with `?toolsets=`, for example:

```txt
https://mcp.maylee.app/mcp?toolsets=emails,compose
```

Values: `reference`, `account`, `emails`, `compose`, `config`, separated by commas. An unknown name is refused with `400 VALIDATION_FAILED`. Without the parameter, every toolset is loaded.

## Call the server by hand

The transport is plain JSON-RPC over HTTP `POST`, so `curl` works for a quick test with an API key:

```bash
curl -s https://mcp.maylee.app/mcp \
  -H "Authorization: Bearer mk_..." \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"get_workspace","arguments":{}}}'
```

## Discovery endpoints

MCP clients find these by themselves. They are listed for client developers.

| Path                                                                 | Content                                                           |
| -------------------------------------------------------------------- | ----------------------------------------------------------------- |
| `/.well-known/oauth-protected-resource/mcp` (and without `/mcp`)     | Protected resource metadata (RFC 9728)                            |
| `/.well-known/oauth-authorization-server/api/auth` (and at the root) | Authorization server metadata (RFC 8414)                          |
| `/.well-known/openid-configuration/api/auth` (and at the root)       | OpenID configuration                                              |
| `/api/auth/oauth2/register`                                          | Dynamic client registration (RFC 7591, public clients, PKCE S256) |

The OAuth scopes are `maylee:read` (always granted), `maylee:write` and `maylee:send`, plus `offline_access` for refresh tokens.
