# Claude Code

Claude Code uses the `claude mcp add` command to register MCP servers. One command points Claude Code at the Cakewalk gateway. OAuth runs in your browser on the first connection.

## Install Method

CLI command. Claude Code stores the server config in `~/.claude.json` (local or user scope) or `.mcp.json` in the project root (project scope).

## Step 1: Run claude mcp add

In your terminal, run:

```bash
claude mcp add --transport http cakewalk https://mcp-gateway.getcakewalk.io/mcp
```

By default this registers the server at **local scope**: available only in the current project, private to you, stored in `~/.claude.json`.

To change scope, add the `--scope` flag:

* **Project scope** (shared via Git):

  ```bash
  claude mcp add --transport http cakewalk https://mcp-gateway.getcakewalk.io/mcp --scope project
  ```

  Stored in `.mcp.json` in the project root. Anyone who clones the project inherits the server.
* **User scope** (cross project, personal):

  ```bash
  claude mcp add --transport http cakewalk https://mcp-gateway.getcakewalk.io/mcp --scope user
  ```

  Stored in `~/.claude.json`. Available in every project you open.

## Step 2: Authenticate

Start a Claude Code session in the project where you added the server. Run:

```
/mcp
```

Claude Code lists the cakewalk server and shows that authentication is required. Follow the prompt to open the OAuth flow in your browser. Sign in with your Cakewalk account and approve the Connection. Tokens are stored securely and refreshed automatically.

## Verifying It Works

Run `claude mcp list` from your terminal to confirm cakewalk appears. Inside a Claude Code session, run `/mcp` to see live status and the tool count for the server. In Cakewalk, the Claude Code card on **My Agents** flips to **Connected** after the first agent call.

## Troubleshooting

* **Server is missing from /mcp:** confirm the scope. A server added at local scope inside one project does not appear in others. Run the `claude mcp add` command again at the right scope, or use `--scope user` for cross project availability.
* **OAuth callback fails:** if the browser redirect errors out after sign in, copy the full callback URL from your browser's address bar and paste it back into the Claude Code prompt. Claude Code recovers the flow from the pasted URL.
* **"Incompatible auth server" error:** Cakewalk's gateway supports the standard MCP OAuth flow. If you see this error, confirm the gateway URL is correct and report it.

## Removing the Connection

Run `claude mcp remove cakewalk` to deregister the server. To revoke the OAuth token without removing the server, use the in-session `/mcp` menu and pick **Clear authentication**.

## Learn more

* [Connect Claude Code to tools via MCP](https://code.claude.com/docs/en/mcp) from Anthropic.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://www.cakewalk.security/docs/ai-agent-access/connections-and-integrations/agent-platforms/claude-code.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
