Cursor supports both install paths. The OAuth path is preferred — Cursor manages the token for you and there’s no key handling.
OAuth install (preferred)
In Cursor, open Settings → Tools & MCP → New MCP Server (or edit .cursor/mcp.json directly) and add the Within server:
Save and reload MCP servers. Cursor detects that the server requires OAuth and shows a Connect button in the MCP panel. Click it — you’ll be redirected to Within to sign in, and Cursor stores the resulting credentials for you.
API key install
Use this for long-running background agents. Generate an API key from Settings → MCP in your Within workspace (see Authentication) and add it as a Bearer header:
Reload MCP servers from the settings panel. The Within tools should appear in the MCP tool list.
Treat the API key like a password. Don’t commit .cursor/mcp.json with a live key — use a global config (~/.cursor/mcp.json) or env-var reference instead. Rotate keys from Settings → MCP in Within if exposed.
Verify
In a Cursor chat, ask:
The assistant should call search and return process results from your workspace.