# Connect this Claude to the GTM OS

Workspace: the one you sign in to

The address is `https://crm-builder.com/api/mcp` for every workspace. You sign
in in your browser with your GTM OS account. There is no key to copy. If an app
asks for a key or a token, the setting is wrong.

Only a workspace admin can connect an agent. After you sign in, the GTM OS
shows its own page: choose the workspace, tick what the agent may do, and push
Allow. Read is always on. You can change the ticks later on Settings > MCP
access. If you are an admin of more than 1 workspace, the agent can call
`list_workspaces` and `use_workspace` to change to another one.

No workspace yet? Sign in and push Allow. The agent then has 1 tool,
`create_workspace`. Give it your invite code, your company name and the CRM
that you use now, and accept the terms. You become the admin of the new
workspace, and the agent gets every permission there. You can remove
permissions on Settings > MCP access.

## Claude Code

1. Add the server. The command holds no secret, so you can run it in a
   terminal or in a Claude session with `!`:

       claude mcp add --scope user --transport http gtm-os https://crm-builder.com/api/mcp

2. In Claude Code, type `/mcp`. If `gtm-os` is not in the list, restart with
   `claude -c`, which keeps the conversation, and type `/mcp` again.
3. Choose `gtm-os` and push Authenticate. Your browser opens.
4. Sign in, choose the workspace and the ticks, and push Allow. The server `gtm-os` shows as connected.

In a plain terminal, `claude mcp login gtm-os` does the same sign-in. It does
not work with `!`, because it needs a real terminal.

## claude.ai

1. Go to Customize > Connectors. Click "+ Add", then "Add custom connector".
2. In "Name", type "GTM OS". In the URL, type
   `https://crm-builder.com/api/mcp`. Click "Add".
3. Click "Connect" and sign in. Choose the workspace and the ticks, and push Allow.
4. In a chat, click "+" > "Connectors" and turn it on.

## Codex

    codex mcp add gtm-os --url https://crm-builder.com/api/mcp
    codex mcp login gtm-os

## For scripts: a workspace key

A script that has no browser uses a workspace key on the address of 1
workspace: https://crm-builder.com/api/mcp/<workspace id>

An admin makes the key on Settings > MCP access, under "Advanced: a key for a
script". The key is shown 1 time.
Never paste it into a chat message, a command or a file. On a Mac:

1. Put the key in the macOS Keychain. The command asks for the key, so the
   key does not go into your shell history:

       security add-generic-password -s gtm-os-mcp -a "$USER" -w

2. Add this line to `~/.zshrc`, then open a new terminal:

       export GTM_OS_MCP_KEY=$(security find-generic-password -s gtm-os-mcp -w)

3. Send the header `Authorization: Bearer <your key>` from the variable. For
   Claude Code, the single quotes keep `${GTM_OS_MCP_KEY}` as text, so the
   config holds no key:

       claude mcp add --transport http gtm-os-key https://crm-builder.com/api/mcp/<workspace id> --header 'Authorization: Bearer ${GTM_OS_MCP_KEY}'

The address refuses a request from a web browser.
