Fix Cursor MCP deeplinks: encode transport-only config so command is not empty.

This commit is contained in:
Dominic Gundel committed 2026-10-19 23:37:04 +02:00
1 parent 4c7e3ff720
commit 694de7d1d7
5 files changed
+68 -22

No files matched your search

+5 -2
View File
@@ -56,8 +56,11 @@ for a in man["server"]["mcp_config"].get("args") or []:
args.append("${userHome}/Documents/Claude")
else:
args.append(s)
payload = {sk: {"command": cmd, "args": args}}
b64 = base64.urlsafe_b64encode(json.dumps(payload, separators=(",", ":")).encode()).decode().rstrip("=")
# Forward slashes; config = transport only (name= is separate).
if len(cmd) >= 3 and cmd[1] == ":" and "\\" in cmd:
cmd = cmd.replace("\\", "/")
transport = {"command": cmd, "args": args}
b64 = base64.urlsafe_b64encode(json.dumps(transport, separators=(",", ":")).encode()).decode().rstrip("=")
link = f"cursor://anysphere.cursor-deeplink/mcp/install?name={urllib.parse.quote(sk)}&config={b64}"
print(f"[Add to Cursor]({link})")
PY