---
title: "Connect other agents"
description: "Connection settings for Cursor, VS Code, Codex, Gemini CLI, Claude Desktop and any other MCP client."
canonical_url: "https://trytree.house/docs/agents/connect/other-agents"
last_updated: "2026-09-29"
---

# Connect other agents

Connection settings for Cursor, VS Code, Codex, Gemini CLI, Claude Desktop and any other MCP client.

Any agent that can open a folder can use a [synced workspace](https://trytree.house/docs/desktop) straight away: point it at the folder. To connect over MCP instead, every client needs the same three things:

| Setting | Value |
| --- | --- |
| Server URL | `https://api.trytree.house/api/mcp` |
| Transport | Streamable HTTP |
| Header | `x-api-key: <your key>` |

Create the key in the web app: account menu, **API keys**, set **Used by** to **Agent (MCP)**, then **Create key**. Give each agent its own key so you can tell them apart in the [activity feed](https://trytree.house/docs/sharing/activity) and revoke one without affecting the others. [Manage API keys](https://trytree.house/docs/agents/connect/api-keys) has the details.

> **Use x-api-key, not Bearer**
>
> Treehouse reads the key from the `x-api-key` header. A client that only offers a "bearer token" field sends `Authorization: Bearer ...`, which Treehouse rejects with a 401. Look for a custom headers setting instead.

MCP client settings change often. If an example below doesn't match your version, look in your client's docs for "remote" or "Streamable HTTP" servers with custom headers.

## Cursor

Add Treehouse to `~/.cursor/mcp.json` (every project) or `.cursor/mcp.json` in a project:

**mcp.json**

```json
{
  "mcpServers": {
    "treehouse": {
      "url": "https://api.trytree.house/api/mcp",
      "headers": {
        "x-api-key": "<your key>"
      }
    }
  }
}
```

## VS Code

Add a server to `.vscode/mcp.json`. The `inputs` block makes VS Code ask for the key once and store it securely, so it never lands in a file you might commit:

**.vscode/mcp.json**

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "treehouse-key",
      "description": "Treehouse API key",
      "password": true
    }
  ],
  "servers": {
    "treehouse": {
      "type": "http",
      "url": "https://api.trytree.house/api/mcp",
      "headers": {
        "x-api-key": "${input:treehouse-key}"
      }
    }
  }
}
```

## Codex

Add a server to `~/.codex/config.toml`. `env_http_headers` reads the header value from an environment variable, which keeps the key out of the file:

**config.toml**

```toml
[mcp_servers.treehouse]
url = "https://api.trytree.house/api/mcp"
env_http_headers = { "x-api-key" = "TREEHOUSE_API_KEY" }
```

Then set `TREEHOUSE_API_KEY` in the environment Codex runs in.

## Gemini CLI

Add Treehouse to `mcpServers` in `~/.gemini/settings.json`:

**settings.json**

```json
{
  "mcpServers": {
    "treehouse": {
      "httpUrl": "https://api.trytree.house/api/mcp",
      "headers": {
        "x-api-key": "<your key>"
      }
    }
  }
}
```

## Claude Desktop

Claude Desktop's custom connectors sign in with OAuth, which Treehouse doesn't offer yet. Connect through the `mcp-remote` bridge instead, which needs [Node.js](https://nodejs.org) installed. Open **Settings**, then **Developer**, then **Edit Config**, and add:

**claude_desktop_config.json**

```json
{
  "mcpServers": {
    "treehouse": {
      "command": "npx",
      "args": [
        "mcp-remote",
        "https://api.trytree.house/api/mcp",
        "--header",
        "x-api-key:${TREEHOUSE_API_KEY}"
      ],
      "env": {
        "TREEHOUSE_API_KEY": "<your key>"
      }
    }
  }
}
```

Restart Claude Desktop. Treehouse appears in the tools menu of a new chat.

## Web chat apps

Chat apps in the browser, such as claude.ai and ChatGPT, only connect to remote MCP servers that sign in with OAuth, so they can't connect to Treehouse directly yet. The setup card's **Claude** and **ChatGPT** buttons still help: the agent talks you through a structure, and you (or a connected agent) create it.

## Check it worked

Ask your agent to list your Treehouse workspaces. It should call `list_workspaces` and reply with their names. If it reports a 401, check the header name and the key; if it can't see the server at all, restart the client after editing its config.

## Related

- [Connect Claude Code](https://trytree.house/docs/agents/connect/claude-code): Give Claude Code access to a workspace through your synced folder, the Treehouse MCP server, or both.
- [Manage API keys](https://trytree.house/docs/agents/connect/api-keys): Create a key for each agent, see which keys can reach your workspaces, and revoke the ones you no longer need.
- [MCP server](https://trytree.house/docs/agents/reference/mcp-server): Every tool the Treehouse MCP server exposes, with parameters, outputs, limits and the instructions it gives connected agents.
