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

# Connect your AI

> Give Claude Code, Cursor, ChatGPT, or any other agent its own Gorkmail inbox in minutes.

# Connect your AI

Connect is the fastest way to give an external AI agent its own mailbox. From
the console you pick an AI, choose (or create) an inbox, and Gorkmail
provisions an **inbox-scoped API key** — it can only read, send, and thread
mail for that one address. You copy one config block and your agent is live.

Head to [Connect in the console](https://gork.email/dashboard/connect), then
pick the destination that matches your agent.

## Runs 24/7 vs on-demand

| Destination                       | Transport    | Mail delivery model                                                  |
| --------------------------------- | ------------ | -------------------------------------------------------------------- |
| Claude Code                       | MCP (stdio)  | **Pushed** — the agent sees mail the moment it arrives while running |
| Cursor                            | MCP (stdio)  | **Pushed** — same, while Cursor is open                              |
| ChatGPT (custom GPT)              | REST Actions | **On demand** — acts on the inbox when you prompt it                 |
| Any other agent (Grok, your bot…) | REST or MCP  | **On demand** (or 24/7 if it hosts the MCP server itself)            |

Hosted chat products cannot receive webhooks into themselves, so their model
is "check the inbox when asked." Coding agents that run an MCP server locally
get real push behavior.

## Claude Code

Connect generates a single command. Run it in your project terminal:

<CodeGroup>
  ```bash One command theme={null}
  claude mcp add gork -- npx -y @gork/mcp-server --api-key=gork_live_YOUR_KEY
  claude mcp list   # verify "gork" is connected
  ```
</CodeGroup>

Then ask: *"check my inbox and summarize new mail."* The agent can send,
reply, read threads, and read OTP / magic-link codes.

## Cursor

Create `.cursor/mcp.json` at your project root (or merge into the existing
one):

```json .cursor/mcp.json theme={null}
{
  "mcpServers": {
    "gork": {
      "command": "npx",
      "args": ["-y", "@gork/mcp-server"],
      "env": { "GORK_API_KEY": "gork_live_YOUR_KEY" }
    }
  }
}
```

Refresh MCP servers in Cursor (Settings → Features → MCP) and the `gork`
server appears.

## ChatGPT (custom GPT)

1. Create a GPT → **Configure**.
2. Paste the generated instruction block (it includes your inbox address and
   API key) into **Instructions**.
3. Under **Actions**, add an API with the same key and import the OpenAPI
   spec from `https://api.gork.email/openapi.json`.

ChatGPT acts on your inbox when prompted — it does not receive pushes.

## Any other agent

Connect outputs an env block:

```bash .env theme={null}
GORK_API_KEY=gork_live_YOUR_KEY
GORK_BASE_URL=https://api.gork.email
GORK_INBOX_ADDRESS=agent@try.gork.email
```

Point your agent at `https://api.gork.email` with Bearer auth. MCP-native
agents (Claude Code, Cursor, OpenCode, Zed, Warp…) can instead run
`npx -y @gork/mcp-server --api-key=…` directly.

## Tools your agent gets

| Tool                    | Purpose                                      |
| ----------------------- | -------------------------------------------- |
| `gork_list_inboxes`     | See the inboxes the key can access           |
| `gork_read_emails`      | List mail with snippets (clean, sanitized)   |
| `gork_get_thread`       | Full conversation history                    |
| `gork_send_email`       | Send from the inbox                          |
| `gork_reply_email`      | Reply (threaded correctly)                   |
| `gork_get_verification` | Read OTP codes / magic links with confidence |
| `gork_create_inbox`     | Provision more inboxes (console-bound keys)  |

## Security notes

* Connect keys are **scoped to one inbox** with mail-only scopes — they cannot
  manage keys, webhooks, or other inboxes.
* The raw key is shown **once** at provisioning. Store it in your agent's
  environment; it cannot be recovered later (rotate from **API Keys**).
* Inbound mail is sanitized and prompt-injection-screened before your agent
  ever reads it.
