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

# Authentication

> API Key and OAuth authentication for Well MCP

Well MCP supports two authentication methods: **API Key** for simple setups and **OAuth** for production use.

## API Key (Simple)

Best for: personal use, testing, development

### How to Get an API Key

1. Log into [Well Dashboard](https://app.wellapp.ai)
2. Go to **Settings** > **API Keys**
3. Click **Generate New Key**
4. Copy the key immediately (it won't be shown again)

### Usage

Include the API key in the `Authorization` header:

```
Authorization: Bearer YOUR_API_KEY
```

Or set it as an environment variable for stdio transport:

```bash theme={null}
WELL_API_KEY=your_api_key_here
```

<Warning>
  Never commit API keys to version control. Use environment variables or secure secret management.
</Warning>

***

## OAuth (Recommended)

Best for: production, multi-user, shared access

OAuth provides secure, token-based authentication with automatic refresh.

### How It Works

Most MCP clients (Claude, Cursor, Windsurf, ChatGPT) support adding custom MCP servers with just a URL. Simply enter:

```
https://api.wellapp.ai/v1/mcp
```

The client handles everything automatically:

1. Redirects you to Well's authorization page
2. You log in and authorize access
3. Redirects back to your client with tokens
4. Handles token refresh automatically

That's it - no manual configuration required.

***

## Which Should I Use?

| Use Case          | Recommended |
| ----------------- | ----------- |
| Personal testing  | API Key     |
| Development       | API Key     |
| Production app    | OAuth       |
| Multi-user access | OAuth       |
| Shared workspaces | OAuth       |

<Tip>Start with an API key for testing, then switch to OAuth for production deployments.</Tip>
