
# Connect Muse Code

This guide supports a personal access token or browser OAuth with the registered callback `http://127.0.0.1:4322/callback`. See [client compatibility](../connect-ai-agents.md#client-compatibility).

Create a token with the **MCP** scope in [Reconstruct Platform settings](https://reconstruct.dev/platform/), as described in [Personal access token](../connect-ai-agents.md#personal-access-token).

## Configure the server

Edit `~/.config/muse/settings.json` (or `$XDG_CONFIG_HOME/muse/settings.json` if set). Preserve existing settings and servers; add `reconstruct` to `mcpServers`:

```json
{
  "schema_version": 1,
  "mcpServers": {
    "reconstruct": {
      "type": "streamable-http",
      "url": "https://reconstruct.dev/mcp",
      "headers": {
        "Authorization": "Bearer <your MCP token>"
      }
    }
  }
}
```

Replace `<your MCP token>` with the token you created. Keep this user configuration private and out of version control. Muse Code 1.3.0 does not expand environment variables in HTTP headers; `${CR_RECONSTRUCT_MCP_TOKEN}` would be sent literally. Keep `schema_version: 1` and use only one root key for servers: `mcpServers`, without a second `mcp_servers` key.

## Check the connection

Start a new `muse` process after saving. Run `/mcp` and check that `reconstruct` is connected, then ask Muse Code to call `mcp__reconstruct__list_products` to confirm access. Configuration changes require a new process.

## Optional OAuth browser sign-in

Remove the `Authorization` header and sign in with the public client ID `reconstruct-mcp`, scopes `openid` and `aud-mcp`, and registered callback `http://127.0.0.1:4322/callback`. Keep this port available:

```bash
muse mcp login reconstruct --oauth-client-id reconstruct-mcp \
  --scope openid --scope aud-mcp --callback-port 4322
```

Use the user settings entry for OAuth; CLI login does not support a server configured only in a project `.mcp.json`. Leave the client secret empty. Use `--oauth-client-id` for this pre-registered loopback callback; other ports are not allowed.

See the official [Muse Code MCP guide](https://meta-models.github.io/muse-code-sdk/next/guides/extend/mcp-servers/). If connection fails, check [troubleshooting](../connect-ai-agents.md#troubleshooting). Next, try the [prompt examples](../prompt-examples.md).
