USRCP — User Context Protocol
v0.2.8Encrypted local ledger of structured user state, shared across every MCP-aware AI tool.
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
usrcp_handoff
Load a concise startup context packet for the human user when switching AI interfaces: relevant projects, facts with review status and recent work. Call at session start and refresh before consequential work; another agent may have updated the plan.
| Parameter | Type | Description |
|---|---|---|
domain * | string | |
max_chars | integer |
usrcp_get_state
Query the user's identity, preferences, active projects, domain context, and recent interaction timeline from their USRCP State Ledger. Use this at the start of a session to understand who the user is and what they've been working on across all AI platforms.
| Parameter | Type | Description |
|---|---|---|
caller | string | Identifying name of the calling agent/platform |
scopes | array | Which facets of user state to retrieve |
timeline_domains | array | Filter timeline to specific domains (e.g., ['coding', 'writing']) |
timeline_last_n | number | Number of recent timeline events to retrieve |
timeline_since | string | ISO 8601 timestamp — retrieve timeline events after this time |
usrcp_append_event
Record an interaction event to the user's USRCP State Ledger. Call this when a meaningful interaction completes — a task finished, a decision made, a file created, a bug fixed. This builds the user's cross-platform interaction history.
| Parameter | Type | Description |
|---|---|---|
domain * | string | Semantic domain: coding, writing, research, design, personal, health, finance, etc. |
intent * | string | What the user was trying to accomplish |
outcome * | string | How the interaction resolved |
summary * | string | Concise summary of what happened |
artifacts | array | References to outputs (files, commits, URLs) |
detail | object | Structured detail blob — varies by domain |
idempotency_key | string | Client-generated key to prevent duplicate writes on retry |
platform | string | Platform this event originated from (e.g., 'claude_code', 'cursor') |
session_id | string | Session identifier to group related events |
tags | array | Freeform tags for filtering and search |
usrcp_update_identity
Update the user's core identity in the USRCP State Ledger. Use when you learn new information about the user — their role, expertise, or communication preferences.
| Parameter | Type | Description |
|---|---|---|
caller | string | Identifying name of the calling agent/platform |
communication_style | string | How the user prefers AI to communicate |
display_name | string | User's display name |
expected_version | integer | Optional: version from a prior read. If the stored version differs, the update is rejected with VERSION_CONFLICT. Use for read-modify-write flows. |
expertise_domains | array | User's expertise areas and levels |
roles | array | User's roles (e.g., ['founder', 'software_engineer']) |
usrcp_update_preferences
Update the user's global preferences in the USRCP State Ledger. These preferences apply across all AI platforms.
| Parameter | Type | Description |
|---|---|---|
caller | string | Identifying name of the calling agent/platform |
custom | object | Custom key-value preferences |
expected_version | integer | Optional: version from a prior read. If the stored version differs, the update is rejected with VERSION_CONFLICT. |
language | string | Preferred language code (e.g., 'en') |
output_format | string | Preferred output format |
timezone | string | IANA timezone (e.g., 'America/Los_Angeles') |
verbosity | string | Preferred verbosity level |
usrcp_update_domain_context
Store or update domain-scoped context in the USRCP State Ledger. Use this to persist domain-specific knowledge that should be available to any agent working in that domain (e.g., coding preferences, writing style notes, research topics).
| Parameter | Type | Description |
|---|---|---|
context * | object | Key-value context to merge into the domain (e.g., { preferred_framework: 'nextjs', css: 'tailwind' }) |
domain * | string | Domain name (e.g., 'coding', 'writing', 'research', 'design') |
caller | string | Identifying name of the calling agent/platform |
expected_version | integer | Optional: version from a prior read (0 = domain does not yet exist). If the stored version differs, the update is rejected with VERSION_CONFLICT. |
usrcp_search_timeline
Search the user's interaction timeline by keyword. Useful for finding past interactions, decisions, or context about specific topics.
| Parameter | Type | Description |
|---|---|---|
query * | string | Search query — matches against summary, intent, and tags |
caller | string | Identifying name of the calling agent/platform |
domain | string | Filter to a specific domain |
limit | number | Max results |
usrcp_manage_project
Create or update a project in the user's USRCP State Ledger. Projects track what the user is actively working on across platforms.
| Parameter | Type | Description |
|---|---|---|
domain * | string | Project domain (coding, writing, research, etc.) |
name * | string | Human-readable project name |
project_id * | string | Stable handle for the project (the upsert key). Stored as an opaque HMAC — the id itself is never persisted or synced in the clear — so any string is safe. The human-readable title goes in `name`. |
summary * | string | Brief project description or current state |
caller | string | Identifying name of the calling agent/platform |
status | string | Project status |
usrcp_audit_log
View the USRCP audit log — every read, write, search, and delete operation recorded with timestamps, agent identity, and scopes accessed.
| Parameter | Type | Description |
|---|---|---|
limit | number | Number of audit log entries to retrieve |
usrcp_rotate_key
Rotate the master encryption key. IRREVERSIBLE: replaces the on-disk master key and re-encrypts every row. DO NOT call this on your own initiative — only when the user has explicitly asked to rotate, or to respond to a confirmed key-compromise event. Rate-limited to once per 24h by default; rows that fail MAC verification under the current key are NOT silently dropped (the call will return an error and refuse to advance unless force_skip_damaged=true).
| Parameter | Type | Description |
|---|---|---|
force_rate_limit | boolean | Bypass the 24h rate limit (USRCP_ROTATE_KEY_MIN_INTERVAL_HOURS). Set true only when the user has explicitly asked to rotate again sooner. |
force_skip_damaged | boolean | Proceed even when rows fail to decrypt under the current key. Those rows become permanently unreadable. Set true only after taking a snapshot and confirming the data loss is acceptable. |
new_passphrase | string | New passphrase for key derivation. If omitted, generates a random key (dev mode). |
usrcp_set_fact
Store a free-form fact in a domain namespace. Use for data the fixed schema doesn't model (habits, relationships, recurring tasks, mood, goals, etc.). Upserts one row per (domain, namespace, key) — re-calling with the same key overwrites. All values are encrypted with the domain-scoped key.
| Parameter | Type | Description |
|---|---|---|
domain * | string | Semantic domain (coding, personal, health, etc.) |
key * | string | Key within the namespace (e.g., 'morning_routine') |
namespace * | string | Namespace within the domain (e.g., 'habits', 'relationships') |
value * | Free-form value — any JSON-serializable data | |
caller | string | Identifying name of the calling agent/platform |
expected_version | integer | Optional: version from a prior read (0 = fact does not yet exist). If the stored version differs, the write is rejected with VERSION_CONFLICT. |
usrcp_get_facts
Read schemaless facts. If `key` is provided, returns a single fact; otherwise lists all facts in the domain (optionally filtered by namespace).
| Parameter | Type | Description |
|---|---|---|
domain * | string | Domain to read from |
key | string | Optional: fetch a single fact by key (namespace required if set) |
namespace | string | Optional: filter by namespace |
usrcp_status
Get the status and statistics of the local USRCP ledger — total events, domains, platforms, and projects.