Ricursor documentation v1
Long-term project memory, self-correction and MCP/API integration for AI coding agents.
Cursor MCP: setup, context checks and troubleshooting →Claude Code: project memory and verified corrections →Long-term, rotatable project memory
Ricursor stores architectural rules and evidence-linked corrections for vibecoders and developers using AI coding agents. Relevant memory is retrieved for each task; version deltas refresh changes and remove deleted rules across sessions and model switches. Project learning means accumulating and reusing saved memory, not retraining model weights. It targets model drift, repeated hallucinated assumptions and unnecessary context/token burn; results depend on the integration and are not guaranteed. Repository structure is extracted locally, not uploaded as source. Hosted AI prompts and replies pass to Cloudflare in transit only and are not stored, logged or used for policy checks. MCP and the HTTP context API are documented below; this guide does not claim a separate published SDK or universal native-edit enforcement.
MCP: ricursor_context({project:"APP",task:"implement auth"})
HTTP: GET /v1/agent/context?project=APP&task=implement%20authExport rules for Lovable / AGENTS.md
Install or update Ricursor from your project folder with its workspace key and exact project name. Run ricursor rules export: it reads the saved machine key and .ricursor.json project, prints every applicable project and workspace-wide rule, and never uploads repository files. Pass a project name to override the configured project. Save to a separate Markdown file, then paste the Ricursor section into existing AGENTS.md or Lovable Project settings → Knowledge; preserve existing instructions. This is a point-in-time snapshot, not automatic synchronization, model retraining or mandatory enforcement of Lovable edits. Re-export when rules change. Missing projects, revoked keys and unavailable APIs exit with an error; never paste an unsuccessful export.
curl -fsSL https://ricursor.com/install.sh | sh -s -- rcsk_YOUR_KEY "YOUR_PROJECT_NAME" ricursor rules export ricursor rules export "YOUR_PROJECT_NAME" > ricursor-rules.md # If ricursor is not on PATH: ~/.ricursor/bin/ricursor rules export
Cursor setup: MCP tools, not model routing
Run the installer in your project folder with your Ricursor workspace key and project name, then restart Cursor. It writes .cursor/mcp.json with the local ricursor_broker server; the key stays in your machine configuration, outside the repository. The broker exposes project context and checked JS/TS changes. Confirm that Cursor discovers ricursor_broker and can call ricursor_context for your project. This does not replace Cursor’s model or prove that Cursor’s native edits cannot bypass the broker.
curl -fsSL https://ricursor.com/install.sh | sh -s -- rcsk_YOUR_KEY YOUR_PROJECT_NAME
Cursor MCP server: ricursor_broker
Context tool: ricursor_context({project:"YOUR_PROJECT_NAME",task:"your coding task"})Cursor authentication & automatic-routing status
Automatic Cursor → Ricursor → Cloudflare Qwen routing remains required, but is not delivered or verified. A Ricursor workspace key authenticates Ricursor tools and its hosted AI relay; it is not a Cursor login or Cursor API key. Cursor CLI coding requests require Cursor authentication. The tested CLI stopped at Authentication required before running tools; signing in alone does not establish Qwen routing. Its endpoint override targets Cursor’s service protocol, not an OpenAI-compatible model URL. Cursor documents that IDE custom-key requests pass through Cursor servers, which cannot reach your local gateway. No supported automatic installer configuration for that routing was established. Claude Code’s verified Qwen adapter is separate and is not evidence of Cursor support.
Verified: installer writes Cursor broker MCP configuration Not verified: Cursor coding through Ricursor Qwen Not guaranteed: mandatory checks for Cursor native edits Requirement remains open: automatic routing with a successful real Cursor coding session
Semantic retrieval & version deltas
Pass task to rank saved constraints using Cloudflare Workers AI and Vectorize. Keep the returned cursor and pass since on the next request with the same key, project and task: constraints contains changed rules and delta.removed contains IDs to remove. Expired or mismatched cursors return 409; fetch without since to reset. Tokens measure rule payloads with cl100k_base, not model billing. Indexing is eventually consistent; retrieval labels recent fallback explicitly. This indexes saved rules, not your repository.
GET https://api.ricursor.com/v1/agent/context?project=APP&task=implement%20auth
GET https://api.ricursor.com/v1/agent/context?project=APP&task=implement%20auth&since=RETURNED_CURSOR
MCP: ricursor_context({project:"APP",task:"implement auth",since:cursor})Connect over MCP
Create a workspace and project in Console, then open Connections for your host-specific MCP configuration. The MCP server authenticates with a workspace key (rcsk_…) sent as a Bearer token. Pass your workspace ID and project name when calling its tools; it does not automatically index a repository.
claude mcp add --transport http ricursor https://api.ricursor.com/v1/mcp --header "Authorization: Bearer rcsk_YOUR_KEY"
Context API
Create an API key in Connections. GET /v1/agent/context serves stored constraints and recent state for the key’s workspace. The optional project query is a project name. This is a context API, not an OpenAI-compatible model proxy.
GET https://api.ricursor.com/v1/agent/context?project=YOUR_PROJECT_NAME Authorization: Bearer YOUR_API_KEY
Memory and reported activity
Add constraints in Console → Elastic memory. Connected agents can report usage and file-change, delta or alert events using ricursor_report or POST /v1/agent/ingest. The Playground is illustrative. Connected agents can save corrections with ricursor_correct or POST /v1/agent/corrections, linked to a recent blocked or review action from the same key and project. The local broker checks supported writes and the Claude Code adapter routes model calls through Ricursor. This evidence link does not prove arbitrary code correctness, and native edits in other clients may bypass checks.
POST https://api.ricursor.com/v1/agent/ingest
Idempotency-Key: UNIQUE_REPORT_ID
[{"type":"state","project":"YOUR_PROJECT_NAME","kind":"file_change","path":"src/auth.ts","detail":"file_updated"}]Guardrails & retry safety
Reports are atomic and tenant-scoped. Reuse the same Idempotency-Key (API) or request_id (MCP) with unchanged data when retrying; changed data with the same ID is rejected. Use a new ID for each new logical report. Batches accept at most 200 events and 256 KiB, real calendar dates, integer tokens up to one billion, and safe relative paths. Named projects must exist; nothing silently falls back to another project. Each workspace accepts 60 new reports per minute; retries of already recorded IDs do not consume this allowance. Receipts persist until the workspace is deleted. These are ingestion safeguards, not an autonomous model safety guarantee.
Success: {"ok":true,"inserted":1,"replayed":false}
Retry: {"ok":true,"inserted":1,"replayed":true}
Conflict: HTTP 409
MCP: ricursor_report({workspace, project, request_id, usage, state})API reference
Base address https://api.ricursor.com/v1. Requests and replies are JSON. Errors return {"error": { "code", "message", "requestId" }}. Members of other workspaces get 404; weaker roles get 403.
Agent API
Authorization: Bearer rcsk_… (workspace key)
| GET | /agent/context?project=NAME | key | Saved constraints and recent state for the key's workspace |
| GET | /agent/rules/export?project=NAME | key | Full project and workspace-wide saved rules for AGENTS.md export; no top-K limit |
| GET | /agent/context?project=NAME&task=TASK&since=CURSOR | key | Semantic memory retrieval and version deltas; cursor bound to key/project/task |
| POST | /agent/ingest | key | Report usage and state events; requires Idempotency-Key |
| POST | /agent/snapshot | writer key | Versioned JS/TS metadata snapshots; automatically queue proactive checks |
| GET | /agent/snapshot?project=NAME | key | Tracked metadata, hashes and versions for the selected project |
| POST | /agent/check | key | Pre-write guard: blocks stale versions, missing exports and accepted import-boundary violations |
| GET | /agent/ledger?project=NAME | key | Shared structure, rule versions and task handoffs; stale decisions tell the agent to refresh |
| POST | /agent/handoff | writer key | Versioned structured task IDs and constraint decisions; no prompts or code |
| POST | /agent/actions/check | writer key | Metadata-only write/delete proposal; returns allow or block with reasons and a one-use receipt |
| POST | /agent/actions/consume | writer key | Atomically consumes a receipt right before the local broker executes |
| POST | /agent/actions/check-group | writer key | Up to 20 related changes judged on their combined end state; 3rd identical block is final |
| POST | /agent/actions/consume-group | writer key | All-or-nothing, one-use consumption of a group receipt |
| POST | /agent/gateway/reserve | writer key | Idempotent token reservation for a local gateway call against the daily budget |
| POST | /agent/gateway/reconcile | writer key | Records locally reported token usage for a reserved call |
| POST | /mcp | key | MCP JSON-RPC endpoint (ricursor_context, ricursor_report) |
Sign-in
Public, then Authorization: Bearer SESSION
| GET | /health | public | Backend status |
| POST | /auth/sign-up | public | Create an account and personal workspace; returns a session |
| POST | /auth/sign-in | public | Email + password; returns a session |
| POST | /auth/password-reset | public | Request a password reset email (one-time link, 1 hour, 3/hour) |
| POST | /auth/password-reset/confirm | public | Set a new password with the emailed token; ends all sessions |
| GET | /auth/me | signed in | Current account |
| POST | /auth/sign-out | signed in | End this session |
| POST | /auth/sign-out-others | signed in | End every other session |
| POST | /auth/password | signed in | Change password (needs current password) |
| POST | /auth/email | signed in | Request an email change; applies after the new address is verified |
| POST | /auth/email/verify | public | Confirm an email with the one-use link token |
| POST | /auth/email/verify/resend | signed in | Resend verification for the current address |
Workspaces, team & invites
Authorization: Bearer SESSION
| GET | /workspaces | signed in | Workspaces you belong to |
| POST | /workspaces | signed in | Create a workspace (you become owner) |
| PATCH | /workspaces/:ws | admin | Rename |
| GET | /workspaces/:ws/members | member | List members |
| POST | /workspaces/:ws/members | admin | Add a member |
| PATCH | /workspaces/:ws/members/:user | admin | Change role (never owner) |
| DELETE | /workspaces/:ws/members/:user | admin | Remove a member |
| GET | /workspaces/:ws/invites | admin | Pending invites |
| POST | /workspaces/:ws/invites | admin | Create invite link |
| DELETE | /invites/:id | admin | Revoke invite |
| GET | /invites/:token | public | Preview invite |
| POST | /invites/:token/accept | signed in | Accept once |
Projects, memory & keys
Authorization: Bearer SESSION
| GET | /workspaces/:ws/projects | member | List projects |
| POST | /workspaces/:ws/projects | writer | Create project |
| PATCH | /projects/:id | writer | Rename project |
| DELETE | /projects/:id | admin | Delete project |
| GET | /workspaces/:ws/constraints?project=ID | member | Saved constraints |
| POST | /workspaces/:ws/constraints | writer | Add constraint |
| DELETE | /constraints/:id | writer | Delete constraint |
| PATCH | /constraints/:id | writer | Update rule with optimistic version; stale edits return 409 |
| POST | /workspaces/:ws/memory-index | writer | Process pending Cloudflare memory indexing (up to 20 rules) |
| GET | /workspaces/:ws/projects/:p/constraints | writer | Constraints applying to a project |
| GET | /workspaces/:ws/keys | admin | List workspace keys |
| POST | /workspaces/:ws/keys | admin | Create key (secret shown once) |
| DELETE | /keys/:id | admin | Revoke key |
State, activity, usage, AI & CI
Authorization: Bearer SESSION
| GET | /workspaces/:ws/state?project=ID | member | Live state events |
| GET | /workspaces/:ws/intent?project=ID | member | Tracked modules, pending checks, architecture suggestions and drift alerts |
| POST | /workspaces/:ws/intent | writer | Accept architecture suggestion into memory or dismiss finding |
| GET/PUT | /workspaces/:ws/middleware | member / admin | Optional override: Enforce (default) or Observe and daily gateway token budget; changes are audited and invalidate receipts |
| GET | /workspaces/:ws/actions | member | Recent broker decisions and mode-change audit |
| POST | /workspaces/:ws/state | writer | Record state events |
| GET | /workspaces/:ws/activity | member | Activity history |
| POST | /workspaces/:ws/activity | member | Record a switch/recovery entry |
| GET | /workspaces/:ws/usage?project=ID | member | Token usage rows |
| POST | /workspaces/:ws/projects/:p/review | writer | Disabled (410): remote source uploads violate the code-free boundary |
| POST | /workspaces/:ws/projects/:p/analyze | writer | Disabled (410): raw log uploads violate the code-free boundary |
| POST | /workspaces/:ws/projects/:p/analyses | writer | Disabled (410): legacy finding evidence may contain source |
| GET | /workspaces/:ws/ci | member | CI analyses and applied fixes |
| POST | /workspaces/:ws/ci/fixes | writer | Mark a finding as fixed (once) |
Profile & account
Authorization: Bearer SESSION
| GET | /profile | signed in | Your profile |
| PATCH | /profile | signed in | Update name |
| GET | /preferences | signed in | Your preferences |
| PUT | /preferences | signed in | Save preferences |
| PUT | /avatar | signed in | Upload photo (PNG/JPEG/WebP) |
| DELETE | /avatar | signed in | Remove photo |
| GET | /avatars/:user | signed in | Photo of someone you share a workspace with |
| GET | /account/export | signed in | Download your data |
| DELETE | /account | signed in | Delete account (password + "DELETE") |
Staff (administration)
Session + staff role + authenticator code
| GET | /admin/access | staff | Your staff role and 2FA state |
| POST | /admin/mfa/enroll | staff | Start authenticator setup |
| POST | /admin/mfa/verify | staff | Verify a 6-digit code |
| GET | /admin/sections/:name | staff | Read-only staff section (audited) |
| GET | /admin/accounts | staff | Account directory |
| POST | /admin/accounts | owner + recent 2FA | Change an account's name or plan |
| GET | /admin/ci | staff | CI trends across workspaces |