# Connecting your IDE

Connect Claude Code, Claude Desktop, Cursor, VS Code and Windsurf to the hosted MCP server, with one URL per indexed repo and one per workspace.

The hosted MCP endpoint has two shapes. One repo:

```
https://api.repowise.dev/mcp/{owner}/{repo}
```

The `{owner}/{repo}` segments are required. They are the GitHub
`owner/name` of a repo you've already indexed. Every editor that
supports MCP can talk to that URL once you've minted an API key.

One workspace, answering across its member repos:

```
https://api.repowise.dev/mcp/w/{workspace_id}
```

Both take the same account-scoped key, so there is nothing extra to
mint for the workspace shape. See
[across a whole workspace](https://docs.repowise.dev/hosted/connecting-ide#across-a-whole-workspace) below for what
changes.

## Mint an API key

1. Sign in at [repowise.dev](https://repowise.dev).
2. Open [**Settings → Coding agents (MCP)**](https://www.repowise.dev/settings?tab=editor).
3. Click **Generate key** and name it after the editor you'll use it from.
4. Pick the repo you're connecting, then copy the snippet for your editor.

Keys are revocable any time.

## Snippets

Replace `OWNER/REPO` with the repo you're connecting and
`YOUR_API_KEY` with the key you just minted. The same snippets are
generated for you, pre-filled, on **Settings → Coding agents (MCP)**.

### Claude Code

One command adds the server to your local Claude Code config:

```bash
claude mcp add --transport http repowise https://api.repowise.dev/mcp/OWNER/REPO \
  --header "Authorization: Bearer YOUR_API_KEY"
```

Restart Claude Code. Then ask: *"Give me a tour of this codebase."*
The agent should call `get_overview` against the hosted endpoint.

### Claude Web / Desktop

Claude on the web, desktop, and mobile connects over OAuth, so there
is no API key to copy and nothing to put in
`claude_desktop_config.json` (that file configures local stdio
servers only).

1. In Claude, open **Customize → Connectors**, click **+**, then
   **Add custom connector**.
2. Paste the server URL as the Remote MCP server URL and click **Add**:

   ```
   https://api.repowise.dev/mcp/OWNER/REPO
   ```

3. Click **Connect**. A Repowise sign-in window opens. Approve access.
4. Repowise's tools are now available in your Claude chats.

On a Team or Enterprise plan, an organization owner adds the connector
first under **Organization settings → Connectors** (**Add → Custom →
Web**, then the same URL). Members then connect to it from
**Customize → Connectors**.

### Cursor

Paste into `~/.cursor/mcp.json` (or your project's
`.cursor/mcp.json`):

```json
{
  "mcpServers": {
    "repowise": {
      "url": "https://api.repowise.dev/mcp/OWNER/REPO",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
```

Restart Cursor.

### VS Code

Paste into `.vscode/mcp.json` in your workspace. Note the key is
`servers`, not `mcpServers`:

```json
{
  "servers": {
    "repowise": {
      "type": "http",
      "url": "https://api.repowise.dev/mcp/OWNER/REPO",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
```

### Windsurf

Paste into `~/.codeium/windsurf/mcp_config.json`. Note the key is
`serverUrl`:

```json
{
  "mcpServers": {
    "repowise": {
      "serverUrl": "https://api.repowise.dev/mcp/OWNER/REPO",
      "headers": {
        "Authorization": "Bearer YOUR_API_KEY"
      }
    }
  }
}
```

Any other MCP client that speaks the Streamable HTTP transport works
with the same two values: the URL above and an
`Authorization: Bearer YOUR_API_KEY` header.

## Across a whole workspace

A [workspace](https://docs.repowise.dev/multi-repo/workspace-setup) groups several indexed
repos. Pointing a client at the workspace URL gives you one connection
that answers across all of them:

```
https://api.repowise.dev/mcp/w/{workspace_id}
```

Open the workspace and use its **Connect** tab, which builds the URL,
carries the same editor snippets as above, and lists the aliases below.
Everything else about the snippets is identical: swap the URL, keep the
`Authorization` header.

What changes on this shape:

- **An extra tool, `list_repos`.** Call it first. It returns each member
  repo with the alias to address it by.
- **Every federatable tool takes an optional `repo`.** Pass an alias to
  scope the call to one member; omit it, or pass `"all"`, and the tool
  answers across every member you can read. `get_symbol` always requires
  one, because a symbol id only means something inside one repo.
- **Read-only.** Write tools are refused here by design, so a re-index
  still goes through the per-repo endpoint even with a write-scoped key.
- **Pro, Teams, or Admin.** The per-repo endpoint above is not gated this
  way and stays available on every plan.

An alias comes from the alias you gave the repo when you added it to the
workspace. If you left it blank it falls back to the owner and name
joined by a hyphen, so `acme/billing-api` answers to
`acme-billing-api`. The workspace's **Connect** tab prints the exact
tokens.

> **Warning**
>
> Two members sharing an alias, compared without case, and any member
> aliased `all` both make the workspace endpoint refuse every call, because
> a `repo` argument naming one of them would silently answer from a single
> repo. The workspace pages flag this; fix it by removing the repo and
> adding it back under a distinct alias.

## Verify it works

Ask your agent something the model can't possibly know without
calling repowise:

> What are the current hotspot files in this repo?

The agent should call `get_overview` (or `get_risk`) and answer with
specific file names, churn percentiles, and owners. If it falls back
to greps and reads, the MCP connection isn't established.

## Rotate or revoke

[Settings → Coding agents (MCP)](https://www.repowise.dev/settings?tab=editor)
shows every active key. Click **Revoke** to invalidate. Generate a
new one, paste it in, restart your editor.

> **Note**
>
> **Self-hosted instead?** No API key needed. `repowise init` writes
> `.mcp.json` for you and the editor talks to a local stdio process.
> See [Quickstart → Self-hosted](https://docs.repowise.dev/getting-started/quickstart).
