Guides

Connecting your agent

Connect a coding agent to Carrick's hosted MCP tools, and see what each client gets: tools, hooks and task skills.

When your agent asks, Carrick answers through its hosted MCP tools at https://api.carrick.tools/mcp. The answers cover every repository in your workspace, including repositories not checked out on your machine. carrick init also installs hooks and task skills for your agent, and the extension covers your editor.

What each client gets

Client MCP tools Hooks Task skills
Claude Code Added by carrick init Yes Yes
Codex Added by carrick init in a terminal, otherwise by one command below Yes Yes
Cursor Added by carrick init when found, or with --mcp No No
Windsurf Added by carrick init when found, or with --mcp No No
VS Code Added by carrick init when found, or with --mcp No No

An editor counts as found when its command is on your PATH and its settings folder exists. carrick init --mcp EDITOR adds one that exists on your machine but whose command is not on PATH. carrick init also writes Carrick’s rules into AGENTS.md, whichever clients you use (see Agent usage rules).

Connect with the CLI

Run carrick init in the folder that holds your repositories, as in the Quickstart. It connects every client in the table that it finds. On the first tool call the client opens a browser page to approve access, and the approval lasts across sessions. You do not need a key for this.

An entry that already exists is left as it is.

Connect by hand

Use these steps for a client carrick init did not configure, or where you cannot run the CLI. Adding only the MCP server installs no hooks, skills or rules.

Each client has two ways to authenticate. Browser sign-in needs no key. A key suits a client that cannot open a browser: create one on the Account page under “Create a key by hand”, then replace <YOUR_MCP_KEY> below.

Claude Code

claude mcp add --scope user --transport http carrick https://api.carrick.tools/mcp

On the first tool call, Claude Code opens the browser to approve access. --scope user makes the server available in every local project.

To use a key instead:

claude mcp add --scope user --transport http carrick https://api.carrick.tools/mcp \
  --header "Authorization: Bearer <YOUR_MCP_KEY>"

Codex

carrick init runs codex mcp add when it has a terminal, and prints the command when it does not. Run it yourself:

codex mcp add carrick --url https://api.carrick.tools/mcp
codex mcp login carrick

To use a key instead:

export CARRICK_MCP_TOKEN='<YOUR_MCP_KEY>'
codex mcp add carrick --url https://api.carrick.tools/mcp \
  --bearer-token-env-var CARRICK_MCP_TOKEN

After carrick init, open codex in the folder once and trust the project’s hooks. Only the Codex terminal app asks. Until you do, Codex skips the hooks without saying so.

Cursor

Add this to ~/.cursor/mcp.json, then restart Cursor. The first tool call opens the browser to approve access.

{
  "mcpServers": {
    "carrick": {
      "url": "https://api.carrick.tools/mcp"
    }
  }
}

To use a key, add a header:

{
  "mcpServers": {
    "carrick": {
      "url": "https://api.carrick.tools/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_MCP_KEY>"
      }
    }
  }
}

Windsurf

Add this to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "carrick": {
      "serverUrl": "https://api.carrick.tools/mcp"
    }
  }
}

To use a key, add a header:

{
  "mcpServers": {
    "carrick": {
      "serverUrl": "https://api.carrick.tools/mcp",
      "headers": {
        "Authorization": "Bearer <YOUR_MCP_KEY>"
      }
    }
  }
}

VS Code

Add this to your user mcp.json:

  • macOS: ~/Library/Application Support/Code/User/mcp.json
  • Linux: ~/.config/Code/User/mcp.json
  • Windows: %APPDATA%\Code\User\mcp.json
{
  "servers": {
    "carrick": {
      "type": "http",
      "url": "https://api.carrick.tools/mcp"
    }
  }
}

To use a key, add an Authorization: Bearer <YOUR_MCP_KEY> header as your VS Code version supports.

Other clients

A client that supports HTTP transport targets https://api.carrick.tools/mcp, with an Authorization: Bearer <YOUR_MCP_KEY> header if it cannot sign in through a browser. A client that needs stdio transport needs an HTTP-to-stdio MCP bridge.

Agent usage rules

carrick init writes a short section into the folder’s AGENTS.md that points your agent to .carrick/RULES.md. Those rules tell the agent to ask Carrick before it writes a helper, changes a shared shape, or calls another service. If you connect without the CLI, add this section to your repository’s AGENTS.md or CLAUDE.md:

## Carrick: use it while you work, not only at the end

This workspace is indexed by Carrick. The `mcp__carrick__*` tools answer questions about code outside the file you are editing more completely than grep. Pass `project` or `repo` on every Carrick call.

1. Before you write a new function, helper or utility, call `search_by_intent` (or `find_similar`) with a plain-English description of what it does. If something in any package already does the job, import it and call it instead of writing your own.
2. Before you change a route, a request or response shape, an event payload or an exported function, call `get_operation` or `get_callers`, and update or explicitly clear every consumer it lists, in every repository.
3. Before you write code that calls another service's endpoint or handles its event, call `get_endpoint_types` (or `get_contract_pair`) and use the real request and response types it returns.
4. Use grep and Read to confirm and to read code once Carrick has told you where to look.
5. In your final summary, say what Carrick found and what you changed because of it.

Carrick is read-only; data reflects each repo's last scan.

Hooks and the language server

The hooks carrick init installs for Claude Code and Codex are described in While your agent edits. Terminal agents without MCP support can run carrick check <file> --json to read a file’s contract verdicts.

To run Carrick’s language server inside Claude Code, install the plugin:

claude plugin marketplace add carrick-tools/carrick
claude plugin install carrick@carrick

Or load the bundled plugin for one session:

claude --plugin-dir "$(npm root -g)/carrick/plugin"

Authentication and keys

The CLI and the MCP clients sign in separately. carrick login signs in the CLI, which downloads and syncs the index. Each MCP client signs in through the browser or with a key. Both are read-only and scoped to your Carrick workspace. An agent cannot change index records, start scans or change workspace settings.

Disconnect a client or revoke a key on the Account page. The client loses access within one minute.

Install id

carrick init adds an X-Carrick-Install-Id header to the Claude Code and editor entries it writes. It is a random UUID kept in ~/.carrick/install-id, and it identifies neither your machine nor you. It lets Carrick tell a slow session from a busy one. carrick uninstall deletes it (see the CLI), and the next carrick init generates a new one. Codex entries carry no install id.