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

# Connect your agent

> Add the lettuce cloud MCP server to your coding agent.

The lettuce cloud MCP endpoint is
`https://diet.uselettuce.dev/mcp`, authenticated with a `cwz_…` API
key. Any MCP-capable agent can connect to it.

If you don't have an API key yet, grab one from
[uselettuce.dev/keys](https://uselettuce.dev/keys)
(see [Quickstart, step 2](/quickstart) for screenshots).

<Note>
  Replace `cwz_<your-key>` in every snippet below with the value you copied
  from the API keys page. The configs differ mostly in *where the file
  lives*.
</Note>

## Claude Code

The `claude` CLI registers the server for you — no file editing.

<Steps>
  <Step title="Run">
    ```bash theme={null}
    claude mcp add --transport http lettuce https://diet.uselettuce.dev/mcp \
      --header "Authorization: Bearer cwz_<your-key>"
    ```
  </Step>

  <Step title="Confirm">
    ```bash theme={null}
    claude mcp list
    ```

    `lettuce` should appear with status `connected`.
  </Step>
</Steps>

## Cursor

<Steps>
  <Step title="Open Cursor settings">
    `Cmd/Ctrl + ,` → search **MCP** → **Edit in mcp.json**. Or edit
    `.cursor/mcp.json` in your project (project-scoped) or
    `~/.cursor/mcp.json` (global).
  </Step>

  <Step title="Add the server">
    ```json theme={null}
    {
      "mcpServers": {
        "lettuce": {
          "url": "https://diet.uselettuce.dev/mcp",
          "headers": { "Authorization": "Bearer cwz_<your-key>" }
        }
      }
    }
    ```
  </Step>

  <Step title="Reload">
    Open the Cursor command palette → **Reload Window**, or restart Cursor.
    The new tools appear in the Composer model picker.
  </Step>
</Steps>

## VS Code (GitHub Copilot)

Copilot's agent mode reads `.vscode/mcp.json`. Note the top-level key is
`servers`, not `mcpServers`.

<Steps>
  <Step title="Create the file">
    In your project, create `.vscode/mcp.json`.
  </Step>

  <Step title="Add the server">
    ```json theme={null}
    {
      "servers": {
        "lettuce": {
          "type": "http",
          "url": "https://diet.uselettuce.dev/mcp",
          "headers": { "Authorization": "Bearer cwz_<your-key>" }
        }
      }
    }
    ```
  </Step>

  <Step title="Switch Copilot to agent mode">
    Open Chat → mode dropdown → **Agent**. The `lettuce` tools appear in
    the tools picker.
  </Step>
</Steps>

## Windsurf

<Steps>
  <Step title="Open the config">
    Settings → **Cascade** → **MCP**, or edit
    `~/.codeium/windsurf/mcp_config.json` directly.
  </Step>

  <Step title="Add the server">
    ```json theme={null}
    {
      "mcpServers": {
        "lettuce": {
          "serverUrl": "https://diet.uselettuce.dev/mcp",
          "headers": { "Authorization": "Bearer cwz_<your-key>" }
        }
      }
    }
    ```
  </Step>

  <Step title="Restart Cascade">
    Click **Refresh** in the MCP settings panel, or restart Windsurf.
  </Step>
</Steps>

## Cline

<Steps>
  <Step title="Open MCP settings">
    In the Cline side panel, click the **MCP** icon → **Configure**.
  </Step>

  <Step title="Add a remote server">
    Choose **Remote (HTTP)**.
    URL: `https://diet.uselettuce.dev/mcp`.
    Add a header: name `Authorization`, value `Bearer cwz_<your-key>`.
  </Step>

  <Step title="Save">
    Cline reconnects automatically; the `lettuce` tools appear in the
    tools list.
  </Step>
</Steps>

## OpenCode

OpenCode reads `mcp.json` from the project or user config directory.

```json theme={null}
{
  "mcpServers": {
    "lettuce": {
      "url": "https://diet.uselettuce.dev/mcp",
      "headers": { "Authorization": "Bearer cwz_<your-key>" }
    }
  }
}
```

Restart the agent after saving.

## Codex CLI / other stdio-only clients

Some MCP clients only speak stdio. Bridge them to the HTTP endpoint with
[`mcp-remote`](https://www.npmjs.com/package/mcp-remote):

```json theme={null}
{
  "mcpServers": {
    "lettuce": {
      "command": "npx",
      "args": [
        "-y", "mcp-remote", "https://diet.uselettuce.dev/mcp",
        "--header", "Authorization: Bearer cwz_<your-key>"
      ]
    }
  }
}
```

## Verify

Ask the agent a question about your codebase — *"where is the auth
middleware?"* — and confirm it calls a `lettuce` tool (Claude Code shows
this in the tool-use box; Cursor shows it in the Composer log).

## Next: nudge the agent to use it

Installing the MCP gives the agent the *tools*. It still needs a line in
its system prompt telling it *when* to use them. See
[Agent instructions](/agent-instructions) for the snippet and where to
paste it for each agent (CLAUDE.md, `.cursor/rules`, Copilot
instructions, Windsurf rules, Cline custom instructions).
