Skip to content

Commit 297bec8

Browse files
matthallett1justfinethanku
authored andcommitted
[primitives] Fix Cursor MCP connection docs (NateBJones-Projects#123)
* [docs] Fix Cursor MCP connection — use native url field, not mcp-remote mcp-remote@latest now attempts OAuth client registration before sending custom headers, which breaks against Open Brain's simple key-based auth. Cursor supports remote MCP servers natively via the url field, so mcp-remote is unnecessary. Changes: - Add dedicated Cursor section to getting-started guide (7.5) and remote-mcp primitive with native url config - Update mcp-remote examples to pass key via ?key= query parameter instead of --header to avoid OAuth discovery issues - Clarify x-brain-key (core) vs x-access-key (extensions) in troubleshooting guides Made-with: Cursor * [primitives] Bring remote MCP docs in line with repo format --------- Co-authored-by: Jonathan Edwards <justfinethanku@gmail.com>
1 parent 20c8310 commit 297bec8

2 files changed

Lines changed: 36 additions & 14 deletions

File tree

primitives/remote-mcp/README.md

Lines changed: 34 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,15 @@
33
A guide to connecting your Open Brain extensions to any AI client. Deploy once as a Supabase Edge Function, connect from anywhere.
44

55
**Jump to your client:**
6-
[Claude Desktop](#claude-desktop) | [ChatGPT](#chatgpt) | [Claude Code](#claude-code) | [Cursor / Windsurf / VS Code / Zed](#other-clients-cursor-windsurf-vs-code-zed) | [Troubleshooting](#troubleshooting)
6+
[Claude Desktop](#claude-desktop) | [ChatGPT](#chatgpt) | [Claude Code](#claude-code) | [Cursor](#cursor) | [Other Clients](#other-clients-windsurf-vs-code-zed) | [Troubleshooting](#troubleshooting)
77

8-
## What You Need
8+
## Prerequisites
99

1010
- Your **MCP Connection URL** (from the extension's credential tracker — looks like `https://YOUR_REF.supabase.co/functions/v1/extension-mcp?key=your-access-key`)
1111
- The AI client you want to connect
1212

13+
## Step-by-step Instructions
14+
1315
## Claude Desktop
1416

1517
1. Open Claude Desktop → **Settings****Connectors**
@@ -55,34 +57,48 @@ claude mcp add --transport http extension-name \
5557

5658
Replace `extension-name` with a short name (e.g., `household-knowledge`, `family-calendar`), the URL with your MCP Server URL (without the `?key=` part), and `your-access-key` with your MCP Access Key.
5759

58-
## Other Clients (Cursor, Windsurf, VS Code, Zed)
60+
## Cursor
61+
62+
Cursor supports remote MCP servers natively. Add this to your `~/.cursor/mcp.json`:
63+
64+
```json
65+
{
66+
"mcpServers": {
67+
"extension-name": {
68+
"url": "https://YOUR_PROJECT_REF.supabase.co/functions/v1/extension-mcp?key=your-access-key"
69+
}
70+
}
71+
}
72+
```
73+
74+
Restart Cursor and the extension's tools should appear in Settings → Features → MCP.
75+
76+
> Do **not** use `mcp-remote` for Cursor. Newer versions of `mcp-remote` attempt OAuth client registration, which fails against Open Brain's simple key-based auth. Cursor's native `url` field works directly.
77+
78+
## Other Clients (Windsurf, VS Code, Zed)
5979

6080
Every MCP client handles remote servers slightly differently. Your extension accepts the access key two ways — pick whichever your client supports:
6181

6282
**Option A: URL with key (easiest).** If your client has a field for a remote MCP server URL, paste the full MCP Connection URL including `?key=your-access-key`. This works for any client that supports remote MCP without requiring headers.
6383

64-
**Option B: mcp-remote bridge.** If your client only supports local stdio servers (configured via a JSON config file), use `mcp-remote` to bridge to the remote server. This requires Node.js installed.
84+
**Option B: mcp-remote bridge (if your client only supports stdio).** Use `mcp-remote` to bridge to the remote server. This requires Node.js installed. Pass the access key via the URL query parameter (not a header) to avoid OAuth discovery issues with newer versions of `mcp-remote`:
6585

6686
```json
6787
{
6888
"mcpServers": {
6989
"extension-name": {
7090
"command": "npx",
7191
"args": [
92+
"-y",
7293
"mcp-remote",
73-
"https://YOUR_PROJECT_REF.supabase.co/functions/v1/extension-mcp",
74-
"--header",
75-
"x-access-key:${ACCESS_KEY}"
76-
],
77-
"env": {
78-
"ACCESS_KEY": "your-access-key"
79-
}
94+
"https://YOUR_PROJECT_REF.supabase.co/functions/v1/extension-mcp?key=your-access-key"
95+
]
8096
}
8197
}
8298
}
8399
```
84100

85-
> Note: no space after the colon in `x-access-key:${ACCESS_KEY}`. Some clients have a bug where spaces inside args get mangled.
101+
> Older examples pass the access key via `--header`. This breaks with `mcp-remote@latest` because it now attempts OAuth client registration before sending custom headers. Pass the key via the `?key=` query parameter instead.
86102
87103
## Troubleshooting
88104

@@ -99,13 +115,18 @@ Every MCP client handles remote servers slightly differently. Your extension acc
99115
**Getting 401 errors**
100116
- The access key doesn't match what's stored in Supabase secrets
101117
- Double-check that the `?key=` value in your URL matches your MCP Access Key exactly
102-
- If using the header approach (Claude Code or mcp-remote), the header must be `x-access-key` (lowercase, with the dash)
118+
- If using the header approach (Claude Code), the core Open Brain server uses `x-brain-key` while extension servers use `x-access-key`
119+
- Prefer the `?key=` query parameter approach to avoid header name confusion
103120

104121
**Tools work but responses are slow**
105122
- First request on a cold Edge Function takes a few seconds to warm up
106123
- Subsequent calls are faster
107124
- Check your Supabase project region — pick the one closest to you
108125

126+
## Expected Outcome
127+
128+
After following the steps for your client, your Open Brain extension should appear as a connected MCP server and its tools should be available inside that AI client without needing a local MCP bridge.
129+
109130
## Extensions That Use This
110131

111132
- [Household Knowledge Base](../../extensions/household-knowledge/) (Extension 1)

primitives/troubleshooting/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ Solutions for issues that come up across any Open Brain extension. If your probl
1313
**"Getting 401 Unauthorized"**
1414
- The access key doesn't match what's stored in Supabase secrets
1515
- Double-check that the `?key=` value in your Connection URL matches your MCP Access Key exactly
16-
- If using header-based auth (Claude Code or mcp-remote), the header must be `x-access-key` (lowercase, with the dash)
16+
- If using header-based auth (Claude Code), the core Open Brain server expects `x-brain-key` while extension servers expect `x-access-key` — prefer using the `?key=` query parameter to avoid confusion
17+
- Do not use `mcp-remote` with `--header` for Cursor — use Cursor's native `url` field instead (see [Remote MCP Connection](../remote-mcp/))
1718
- Verify the secret is set: `supabase secrets list` should show `MCP_ACCESS_KEY`
1819
- Try regenerating the key: `openssl rand -hex 32`, then `supabase secrets set MCP_ACCESS_KEY=new-key` and update your Connection URL
1920

0 commit comments

Comments
 (0)