# Connect Windsurf to Repowise

Wire Windsurf's Cascade agent to the local or hosted Repowise MCP server, see which file changes, verify the connection and remove it.

Windsurf reads MCP servers from one file per machine. Repowise writes its
server entry there, for the local index or the hosted one.

## Install

**Local, with your agent.** Paste this into Cascade:

```text
Read https://docs.repowise.dev/setup.md and set up Repowise in this repository.
```

**Local, by hand.** `repowise init` wires Windsurf when it is installed. To
wire it later, from the repository it should serve:

```bash
repowise agents add --target=windsurf
```

**Hosted.** Run in the repository, then approve the sign-in in Windsurf:

```bash
repowise agents add --target=windsurf --hosted
```

## What gets written where

| File | Scope | What repowise writes |
|---|---|---|
| `~/.codeium/windsurf/mcp_config.json` | user | `mcpServers.repowise`: `command` and `args`, naming the repository it serves |

Windsurf has no project MCP file, so the local entry names one repository.
`repowise init` never moves an entry that serves another repository;
`repowise agents add --target=windsurf` does. The hosted entry uses
`serverUrl` (Windsurf's key for a remote server, not `url`) and is named
`repowise-hosted` when a local `repowise` exists.

## Restart

Open **Windsurf Settings > Cascade > MCP servers** and refresh. For a hosted
entry, approve the `repowise` sign-in in the browser when Windsurf asks.

## Verify

```bash
repowise agents
```

You should see `windsurf` with status `configured`. In Cascade, ask "What
are the hotspot files in this repo?" and check that it calls a Repowise
tool.

## Uninstall

```bash
repowise agents remove --target=windsurf
```

This drops the local `repowise` entry and keeps every other server in the
file.

## Troubleshooting

| Symptom | Fix |
|---|---|
| `it serves another repo` | The single entry points at a different repository. Run `repowise agents add --target=windsurf` from the one you want. |
| Windsurf loads no MCP servers | `mcp_config.json` is not valid JSON. `repowise doctor` reports it. Fix the file, then run `repowise agents add --target=windsurf --scope=user`. |
| `"repowise" entry names a remote server` | Rename the hosted entry to `repowise-hosted` and re-run the add command. |
| Only five Repowise tools are listed | Windsurf gets the core profile by default. See [Tool profiles](https://docs.repowise.dev/agents/tool-profiles). |

## Next
- [Connecting your IDE](https://docs.repowise.dev/hosted/connecting-ide) for the hosted URL.
- [Tool profiles](https://docs.repowise.dev/agents/tool-profiles) to list all ten tools.
- [repowise agents](https://docs.repowise.dev/cli/agents) for every flag.
