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

# Connect MCP servers

> Add your favorite MCP servers like Linear, Notion, Granola, and more to Corbits Code

Corbits Code reaches Model Context Protocol servers two ways: a remote HTTP endpoint authorized over OAuth, or a local process launched over stdio. Linear ships a hosted OAuth server, so it is the fastest add. Slack has no hosted MCP endpoint, so it runs as a local process you configure with your own bot token. Working through both here covers the two shapes you will hit for any other server.

**You need** a repository you are running Corbits Code in and, before the Slack step, a Slack app with a bot token.

<Warning>
  **Alt+A**, **Alt+D**, and **Alt+R** only work when your terminal sends Option or Alt as a modifier. A terminal that swallows the chord shows no error; the keypress just does nothing, or types a character such as `å`. On macOS in VS Code's integrated terminal, set `"terminal.integrated.macOptionIsMeta": true` and reopen the terminal first. ([`MCP key handling`](https://github.com/corbitsdev/corbits-code/blob/main/src/tui/command-surfaces.ts#L1553-L1589))
</Warning>

<Steps>
  <Step title="Add Linear from the TUI">
    Run `/mcp`, press **Alt+A**, and enter a name and URL:

    ```text theme={null}
    name: linear
    url:  https://mcp.linear.app/mcp
    ```

    A server name takes letters, numbers, and single underscores or hyphens; `__` is reserved for tool namespacing. Alt+A only takes a name and a URL, so it only reaches remote HTTP servers, and it always writes to your global `~/.corbits/settings.json`, never the current repo's local file. ([`name and URL validation`](https://github.com/corbitsdev/corbits-code/blob/main/src/mcp/add-server.ts#L196-L266); [`Alt+A row`](https://github.com/corbitsdev/corbits-code/blob/main/src/tui/command-surfaces.ts#L1338))
  </Step>

  <Step title="Authorize Linear">
    After the first connection attempt, `/mcp` shows `linear` with the status `needs auth`. Select that row and press **Enter**. Corbits Code opens Linear's consent page in your browser and copies its URL to the clipboard automatically. Approve in the browser; a loopback server on your machine catches the redirect and exchanges the code for tokens with no paste-back. The row changes to `connected` when authorization completes. ([`authorization action`](https://github.com/corbitsdev/corbits-code/blob/main/src/tui/command-surfaces.ts#L1534-L1551); [`authorization flow test`](https://github.com/corbitsdev/corbits-code/blob/main/src/tui/command-surfaces.test.ts#L1216-L1240); [`HTTP OAuth connection`](https://github.com/corbitsdev/corbits-code/blob/main/src/mcp/client.ts#L645-L698))

    The token is written under `~/.corbits/mcp-auth/`, with its file identity derived from the server name and normalized URL, never into `settings.json`. ([`token file identity`](https://github.com/corbitsdev/corbits-code/blob/main/src/mcp/auth-store.ts#L36-L65))
  </Step>

  <Step title="Get a Slack bot token">
    Create a Slack app at [api.slack.com/apps](https://api.slack.com/apps), install it to your workspace, and grant it the bot scopes it needs to read and post messages, for example `channels:history`, `channels:read`, and `chat:write`. Copy the bot token (`xoxb-...`) and the team ID from OAuth & Permissions.
  </Step>

  <Step title="Add Slack alongside Linear">
    Alt+A cannot add a stdio server, since it only ever writes a name and a URL. Open `~/.corbits/settings.json`, the same file Alt+A wrote Linear into, and replace its `mcpServers` value with this combined map:

    ```jsonc theme={null}
    {
      "mcpServers": {
        "linear": { "url": "https://mcp.linear.app/mcp" },
        "slack": {
          "command": "npx",
          "args": ["-y", "@modelcontextprotocol/server-slack"],
          "env": {
            "SLACK_BOT_TOKEN": "xoxb-...",
            "SLACK_TEAM_ID": "T0..."
          }
        }
      }
    }
    ```

    Confirm the package name and required scopes against whichever Slack MCP server you actually install; the one above is the long-standing community reference implementation, not one Corbits maintains or vets. Corbits Code passes an entry's `env` map to that server's process only, so keep the token inside the `slack` entry. That holds in a repo's local `.corbits/settings.json` too, where a token-shaped key at the top level is ignored with a diagnostic instead. Settings are read at startup, so exit and start Corbits Code again after saving the file. ([`MCP entry schema`](https://github.com/corbitsdev/corbits-code/blob/main/src/config/settings.ts#L594-L603); [`stdio process environment`](https://github.com/corbitsdev/corbits-code/blob/main/src/mcp/client.ts#L604-L611); [`local credential-key guard`](https://github.com/corbitsdev/corbits-code/blob/main/src/config/settings.ts#L1115-L1126); [`startup resolution`](https://github.com/corbitsdev/corbits-code/blob/main/src/config/index.ts#L1103-L1119))
  </Step>
</Steps>

**You will know it worked when** `/mcp` lists both `linear` and `slack` as connected rows. Select a row and press **Alt+D** to disable that server without deleting its configuration. Press **Alt+R** to open a confirmation, then confirm to remove the configuration. When the removed entry is an HTTP server, Corbits Code also attempts to delete its saved OAuth state. ([`MCP management actions`](https://github.com/corbitsdev/corbits-code/blob/main/src/tui/command-surfaces.ts#L1343-L1378); [`MCP shortcut handling`](https://github.com/corbitsdev/corbits-code/blob/main/src/tui/command-surfaces.ts#L1562-L1589); [`disable and removal persistence`](https://github.com/corbitsdev/corbits-code/blob/main/src/mcp/add-server.ts#L281-L442))

<Warning>
  Keep every server in one file. A repo's local `.corbits/settings.json` does not merge its `mcpServers` list with the global one, it replaces it outright while that file is in effect, and it blocks Alt+A from reaching global settings at all until the local list is removed and Corbits Code restarts. Adding Slack locally in one repository while Linear lives only in the global file means Linear silently stops connecting in that repository. If you want a project-scoped list instead of the global one, move every server you want there into that repo's `.corbits/settings.json` together, including the ones Alt+A already wrote to global. A server added this way also needs a one-time trust approval in the TUI on first connect, and a headless run with no trust callback will not connect it at all, so local MCP fails closed rather than launching an untrusted process. An untrusted server shows in `/mcp` as `failed` with "Not trusted for this project". ([`local list replaces global`](https://github.com/corbitsdev/corbits-code/blob/main/src/config/index.ts#L190-L199); [`local list precedence`](https://github.com/corbitsdev/corbits-code/blob/main/src/config/index.ts#L1103-L1119); [`local add restriction`](https://github.com/corbitsdev/corbits-code/blob/main/src/tui/command-surfaces.ts#L1287-L1289); [`trust-on-first-use gate`](https://github.com/corbitsdev/corbits-code/blob/main/src/trust/project-trust.ts#L457-L492); [`untrusted status`](https://github.com/corbitsdev/corbits-code/blob/main/src/agent/tools.ts#L1153-L1165))
</Warning>

<CardGroup cols={2}>
  <Card title="Corbits Code in full" icon="terminal" href="/platform/corbits-code">
    The specialist fleet, the permission and secret guards, hooks, plugins, and what to do once one repository is not enough.
  </Card>

  <Card title="The Corbits platform" icon="layer-group" href="/platform/overview">
    The runtime primitives Corbits Code is assembled from, and what else you can build on them.
  </Card>
</CardGroup>

***

## Support

<Card title="Help Center" icon="circle-question" color="#e98428" href="https://t.me/+JnlJ64eDGuNkM2Nh">
  Join hundreds of developers building with Corbits and speak with the team directly.
</Card>
