USRCP — User Context Protocol

io.github.frank-bot07由 GitHub 账号 frank-bot07 发布v0.2.8更新于 Oct 24, 2026

Encrypted local ledger of structured user state, shared across every MCP-aware AI tool.

概览

AI 生成的概览

本地加密的 SQLite 账本,保存用户身份、偏好、项目与活动记录,任何支持 MCP 的 AI 工具都可读写,从而跨工具延续上下文。

可以做什么
  • 获取某一领域的精简启动简报与近期活动,或查询身份、偏好、项目与时间线
  • 记录交互事件,更新身份、偏好与领域范围内的上下文
  • 按领域、命名空间和键存取自由格式的事实
  • 以精确关键词检索时间线,并查看加密审计日志
  • 管理跟踪的项目、查看账本健康状况、轮换主加密密钥
适用场景
适合在多个支持 MCP 的助手或编辑器(Claude Desktop、Cursor、Cline、Continue、终端代理)之间切换,希望每个工具都了解你近期的工作、决定和偏好而无需重复背景说明的人。面向希望把这类连续性保存在本地加密存储、而非云端账号的开发者。
运行要求
以本地 stdio 进程运行,来自 npm 包 usrcp;需要 Node 22.13 或更高版本(推荐 24+),macOS/Linux 也可用 Homebrew 安装。需要口令来派生账本密钥,可通过 USRCP_PASSPHRASE 环境变量、命令行参数提供,或存入操作系统钥匙串(Windows 暂不支持)。初始化会向客户端配置文件写入 MCP 服务器条目。
安装前请注意
口令保护全部存储内容;写入配置文件的明文口令是磁盘上最薄弱的一环,建议使用系统钥匙串。服务器可写入、更新并重新加密账本,包括轮换密钥。可选适配器会从 GitHub、Linear、Obsidian、日历、邮件和聊天来源采集数据,各自需要令牌或 OAuth 客户端;可选流式层会把嵌入向量以明文存盘,并可能在同意后把内容发送给外部嵌入服务商。目前为早期测试版,自动采集与召回取决于具体集成。

安装

在 SourceWeft 中

  1. 打开 控制台中的 USRCP — User Context Protocol,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

USRCP — User Context Protocol

Switch AI tools without starting the conversation over.

You told Claude Desktop your stack on Tuesday. On Wednesday, Cursor doesn't know. Thursday, Codex asks again. Every AI tool you use has its own memory, or none.

USRCP is a local, encrypted SQLite ledger that any MCP-aware tool can read and write. Connect supported tools to the same local profile so they can share your recent work, decisions and preferences. USRCP is an early beta; automatic capture and recall depend on the integration.

Registers with Claude Desktop, Cursor, Continue, Cline, and terminal agents (Claude Code, Codex CLI, Copilot CLI, Aider, OpenCode, Antigravity). Captures structured activity from GitHub, Linear, Obsidian, Claude Code sessions, and Google Calendar — plus an experimental conversation-capture set.

bash
brew install frank-bot07/usrcp/usrcpusrcp init

→ See it work: the cross-editor demo, or check the protocol path on your own machine in one command — node scripts/cross-client-proof.mjs (uses two synthetic MCP clients and scans raw database cells for test content markers; it does not test actual AI hosts). → Apache 2.0 · 600+ tests · threat model in docs/SECURITY.md


Core and optional features: the structured core uses exact-keyword lookup. Optional usrcp-stream adds semantic recall with a different storage/privacy boundary; see the capability matrix below.

Protocol Stack

┌─────────────────────────────────┐│         Agent Layer             │  ← ACP (Agent-to-Agent)├─────────────────────────────────┤│         Model Layer             │  ← MCP (Model Context Protocol)├─────────────────────────────────┤│     >>> USRCP <<<               │  ← Structured User State (THIS PROTOCOL)├─────────────────────────────────┤│         User / Client           │└─────────────────────────────────┘

One human, many AI interfaces

USRCP is the human user's context layer. The launch workflow is live retrieval of a compact brief from one shared ledger. Your next assistant should know the relevant ongoing work, decisions, constraints and next steps.

Discuss your work in one connected tool, then ask another: “What was I just working on?” You should not have to select a project, copy a summary, or repeat the background.

Connected MCP clients can read recent activity across the profile with usrcp_get_state and request a focused live brief with usrcp_handoff. The local MCP server provides startup instructions, but clients must honor them; verify actual behavior with the two-client acceptance test. A shared ledger alone does not prove automatic retrieval.

Capability and privacy boundaries

ComponentPurposeBoundary
Structured coreIdentity, preferences, projects, facts and timelineContent encrypted at rest; authorized agents receive decrypted context
Live context retrievalRecent work and compact context for connected agentsGenerated on demand from the local ledger; no file transfer required
Optional streamCapture and semantic recallLocal embedding vectors are plaintext on disk; optional external embedding providers receive content after consent
Optional device relayTimeline/stream event syncCiphertext content with visible metadata; the local client does not synchronize the entire structured profile

The initial beta focuses on people switching Claude Code, Codex and Cursor. Domain restrictions are optional access controls, not a required step in normal conversation. The broader goal remains continuity for the human user across tools. Read context ownership for inspection, correction, provenance, expiry and deletion alternatives.

Alternatives

OpenMemory also targets cross-tool coding context and automatic capture. Zep provides temporal knowledge graphs. These products overlap with parts of USRCP's workflow. USRCP's proposed advantage is a small, inspectable human-context brief backed by a local encrypted ledger, explicit sharing and no required cloud account for the core workflow. Compare current editions and test against your existing project notes; do not assume other products are merely vector storage or always require a particular provider.

Quickstart

Install

npm (recommended) — the usrcp CLI + encrypted ledger:

bash
npm install -g usrcp        # the `usrcp` command + local ledger# …or run without installing:npx usrcp init

No native build, no compiler, no postinstall — usrcp uses Node's built-in SQLite (node:sqlite), so npm install just works on any npm (including npm 12+, whose allowScripts default blocks native build scripts). Requires Node ≥ 22.13 (Node 24+ recommended).

Homebrew (macOS / Linux) — alternative for the core CLI:

bash
brew install frank-bot07/usrcp/usrcp

The CLI ships with the inline adapters (terminal, mcp-agent, openclaw). Capture adapters install as their own packages, then you configure each with the setup wizard:

bash
# structured-state adapters:npm install -g usrcp-github   # or usrcp-linear, usrcp-obsidian, usrcp-claude-code, usrcp-google-calendarusrcp setup --adapter=github
# experimental conversation-capture set:npm install -g usrcp-slack    # or usrcp-discord, usrcp-telegram, usrcp-imessage, usrcp-gmailusrcp setup --adapter=slack

See the Adapters table for the full list (the Chrome extension and VS Code viewer ship separately — see their package READMEs).

From source — for contributing or running unreleased changes:

bash
git clone https://github.com/frank-bot07/usrcp.git# Build the protocol core first — usrcp-local's build compiles it.cd usrcp/packages/usrcp-core && npm install && npm run buildcd ../usrcp-local && npm install && npm run build && npm link

First run

bash
# Interactive init — prompts for passphrase by defaultusrcp init
# Non-interactive:usrcp init --passphrase "your secret phrase"       # passphrase modeusrcp init --dev                                     # dev mode (key on disk)
# Start the serverusrcp serve

In passphrase mode, init offers to store the passphrase in the OS keychain (macOS Keychain / Linux Secret Service); pass --keychain / --no-keychain to decide non-interactively. With a keychain entry present, MCP clients auto-start the server with no plaintext passphrase in any config file. Manage the entry anytime:

bash
usrcp keychain store    # add/replace (verifies the passphrase unlocks this ledger first)usrcp keychain status   # show backend + whether an entry existsusrcp keychain clear    # remove it
# Prefer no keychain? The env var path still works:USRCP_PASSPHRASE="your secret phrase" usrcp serve

init creates ~/.usrcp/users/<slug>/ with an encrypted SQLite ledger and writes the MCP server entry to Claude Desktop's config:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

Single-user is the default and what every shared-machine consideration in the rest of this README assumes. If two people use the same OS account (or you run multiple identities side by side), see Multiple users on one machine below — each user gets an independent ledger and passphrase under a --user=<name> slug.

Adding capture adapters

Adapters watch a source (a GitHub org, an Obsidian vault, a Linear workspace, etc.) and append the activity you authored into the same ledger your local MCP server reads from. Install the adapter's package, then run the setup wizard to configure it:

bash
npm install -g usrcp-linear          # install the adapter you wantusrcp setup --adapter=linear         # configure it (validates credentials, picks scope)# or, to browse what's installed:usrcp setup                          # interactive picker

See the Adapters tables below for the full list.

Multiple users on one machine

bash
usrcp init --user=frankusrcp init --user=jessusrcp serve --user=frank   # or rely on --user in the registered MCP entryusrcp users                # list available slugs

Each user gets an independent ledger, passphrase, and MCP server entry.

Passphrase mode and terminal agents

If you initialized USRCP in passphrase mode (usrcp init with the default), the MCP server needs the passphrase to decrypt the ledger. The terminal-adapter register() writes only command + args to each agent's config — it never bakes the passphrase in.

Recommended: the OS keychain. One command covers every agent — shell-launched and GUI alike — with nothing in plaintext on disk:

sh
usrcp keychain store

The server checks USRCP_PASSPHRASE, then --passphrase, then the keychain, so existing setups keep working unchanged. (Windows: keychain support isn't wired up yet — use the env-var paths below.)

Env-var alternatives, if you'd rather not use the keychain:

  • Shell-launched agents (claude-code, codex, copilot-cli, aider, opencode) — add to ~/.zshrc / ~/.bashrc and restart your shell:

    sh
    export USRCP_PASSPHRASE="your secret phrase"
  • GUI/IDE-launched agents (cursor, cline, continue, antigravity) do not inherit shell environment. Either add an env block under the usrcp server entry in the agent's config file (JSON for Cursor/Cline/Continue, TOML for Codex), or set a system-wide GUI env on macOS with launchctl setenv USRCP_PASSPHRASE "..." (persists until reboot; use a ~/Library/LaunchAgents/ plist for permanence).

Treat any config file you bake the passphrase into as a secret — it sits in plaintext on disk and is the weakest link in an otherwise-encrypted setup. This is exactly what usrcp keychain store exists to avoid.

The wizard prints this same guidance after registration, so you can also re-run usrcp setup or usrcp adapter add terminal --targets=<list> for a reminder.

Capture Adapters

Adapters are independent processes that read from a source and append events to the local ledger via the same encrypted-at-rest pipeline as the MCP server. Each adapter handles its own auth, idempotency, and cursor persistence.

Structured-state adapters

These are the headline adapters: they capture genuinely structured dev/work state — issues, PRs, notes, calendar events, coding-session context — the kind of data USRCP's schema and exact-keyword search are built for.

AdapterWhat it capturesModeRequirements
usrcp-githubPRs you opened / merged / closed, issues you opened, comments + reviews you authored, in optional org allowlistCapture-only (v0)GitHub personal access token (repo + read:user scopes)
usrcp-linearIssues + comments you author in LinearCapture-only (v0)Linear personal API key
usrcp-obsidianNotes you create or edit in an Obsidian vaultCapture-only (v0)A local vault directory
usrcp-claude-codeUser / assistant turns from your Claude Code CLI sessions, tailed from ~/.claude/projects/<cwd>/*.jsonlCapture-only (stream)Claude Code CLI installed; allowlisted_projects in ~/.usrcp/claude-code-config.json
usrcp-google-calendarTimed events on your primary calendar that have already endedCapture-only (v0)Google Cloud OAuth client + Calendar API enabled

Alongside these, the inline adapters that ship with the brew CLI (terminal, mcp-agent, openclaw) wire the same structured state into terminal agents and agent harnesses — see Editor & CLI Integrations and Agent harness integrations. The VS Code viewer browses the resulting ledger read-only.

Conversation capture adapters (experimental)

These adapters capture allowlisted activity into the local ledger. The optional stream layer includes semantic retrieval and has a different storage boundary from the core: consult security boundaries before enabling it. Capture is not proof that another assistant retrieved or correctly understood the context. The initial product test is live cross-interface continuity using concise checkpoints.

AdapterWhat it capturesModeRequirements
usrcp-imessageMessages you sent in Apple iMessageCapture + readermacOS only. Full Disk Access for Messages.app; brew install steipete/tap/imsg
usrcp-slackMessages you sent in Slack; @usrcp queries from chatCapture + reader + botPaid Slack tier (Pro/Business+/Enterprise) — bot APIs are restricted on free; Anthropic API key for @usrcp replies
usrcp-discordMessages you sent in Discord; @usrcp queries from chatCapture + reader + botA Discord server you control; Anthropic API key for @usrcp replies
usrcp-telegramMessages you sent in Telegram; @usrcp queries from chatCapture + reader + botA Telegram bot token (BotFather); Anthropic API key for @usrcp replies
usrcp-gmailMessages you sent in Gmail (subject, body, recipients, labels)Capture-only (v0)Google Cloud OAuth client + Gmail API enabled
usrcp-extensionConversations on claude.ai; /usrcp slash-command for ledger lookupCapture + injectorChrome only. Manual unpacked load (Developer Mode → Load Unpacked)

Install an adapter's package (npm install -g usrcp-<value>), then configure it with usrcp setup --adapter=<value> (e.g. npm i -g usrcp-linear && usrcp setup --adapter=linear). Run usrcp setup alone for an interactive picker over the adapters you've installed.

All adapters write under a configurable domain (default matches the source name) and use stable, source-side IDs as idempotency keys, so re-polling or re-watching the same window cannot double-write. Capture-only adapters do not reply; bot adapters reply only to explicit @usrcp / /usrcp mentions and answer using the same ledger the user sees.

Agent harness integrations

These adapters expose USRCP's tools to a third-party AI agent harness. They don't capture new events on their own — capture from external surfaces (Discord, Slack, iMessage, etc.) still goes through the dedicated capture adapters above. Install the harness first, then run the USRCP setup route.

IntegrationPurposeModeRequirements
usrcp-hermesMemory-provider plugin for Hermes Agent. Adds USRCP as a 9th external memory provider; system-prompt context, prefetch, sync_turn capture.Bidirectional pluginHermes installed; usrcp CLI on PATH; mcp Python package
openclawRegisters usrcp serve as an MCP server in your OpenClaw config. OpenClaw agents get all 12 USRCP tools via the same path Claude Code uses.Read-side (MCP server)OpenClaw already installed — install first at https://docs.openclaw.ai/start/getting-started, then usrcp setup --adapter=openclaw

Ledger viewers

Read-only clients that browse the encrypted ledger via a local usrcp serve subprocess. No network calls; the viewer never sees plaintext outside the host process.

ViewerSurfaceModeRequirements
usrcp-vscodeVS Code activity-bar USRCP view — Facts tree by domain, status indicator, "Open Ledger Directory" command.Read-only clientVS Code; usrcp CLI on PATH (or set usrcp.binaryPath)

Cross-device sync

usrcp-cloud is an optional experimental ciphertext relay. The local sync client currently transfers timeline events and domain maps only. Full structured-state synchronization is outside the launch workflow; agents on the same machine and profile already share a live ledger; cross-device continuity needs separate validation. Relay metadata remains visible.

MCP Tools (12)

ToolDescription
usrcp_handoffCondensed domain-specific startup brief with reviewed facts and recent work
usrcp_get_stateQuery identity, preferences, projects, timeline
usrcp_append_eventRecord an interaction event
usrcp_update_identityUpdate user roles, expertise, communication style (with optional expected_version for read-modify-write)
usrcp_update_preferencesUpdate language, timezone, verbosity
usrcp_update_domain_contextStore domain-scoped key-value context
usrcp_set_factStore a free-form schemaless fact under (domain, namespace, key)
usrcp_get_factsRead one fact or list all facts in a domain / namespace
usrcp_search_timelineSearch via blind index tokens (exact keyword, not semantic)
usrcp_manage_projectCreate/update tracked projects
usrcp_audit_logView encrypted audit trail
usrcp_rotate_keyRotate master encryption key (re-encrypts all data)
usrcp_statusLedger stats and health (scope-aware: scoped agents see only their domains)

What's Encrypted

All your content. Every field that carries what you said, did, or stored is ciphertext at rest. What stays in the clear is structural metadata — opaque identifiers and timestamps that reveal when, never what. An attacker reading the SQLite file sees:

ColumnWhat they see
event_idOpaque ULID (plaintext — random identifier, no content)
timestampWhen, not what (plaintext)
domainHMAC pseudonym (d_1ac6397ab4d2)
summaryenc:base64ciphertext...
intentenc:base64ciphertext...
outcomeenc:base64ciphertext...
platformenc:base64ciphertext...
detailenc:base64ciphertext...
tagsenc:base64ciphertext...
audit_log.*enc:base64ciphertext...

The same rule holds in the other tables: in active_projects, the content fields (name, domain, status, summary) are enc: ciphertext; the project_id you choose is stored as an HMAC (with the original encrypted in project_ref_enc), and only last_touched (a timestamp) stays plaintext. No field that holds user content is ever stored in the clear.

In passphrase mode, no key file exists on disk. The key is derived via scrypt on startup and zeroed on shutdown.

Each adapter's test suite includes a ciphertext-at-rest check: it captures real activity, then opens the SQLite file with raw better-sqlite3 and asserts no plaintext markers (titles, bodies, URLs, IDs) appear in any encrypted column.

Security Architecture

  • AES-256-GCM encryption at rest for all content fields
  • Domain-scoped keys via HKDF-SHA256 — coding key cannot decrypt health data
  • scrypt passphrase derivation (N=131072, r=8, p=2) — key never on disk
  • HMAC domain pseudonyms — domain names are opaque identifiers
  • Blind index search with n-gram tokens and noise injection
  • Encrypted audit log — access patterns are ciphertext
  • Atomic key rotation — re-encrypts all data in a single transaction
  • secure_delete pragma — SQLite zero-fills deleted pages
  • Master key zeroed on process shutdown
  • Scope enforcement — agents registered with a --scope flag see only the domains they're authorized for; usrcp_status and timeline queries filter accordingly

Full model in docs/SECURITY.md.

Editor & CLI Integrations

USRCP works with any MCP-compatible client. The usrcp init wizard registers the server entry for editor clients:

Editor--client= valueSetup doc
Claude Desktopclaude (default)This README
Cursorcursordocs/INTEGRATIONS/cursor.md
Continue.devcontinuedocs/INTEGRATIONS/continue.md
Cline (VS Code)clinedocs/INTEGRATIONS/cline.md

Register with multiple clients at once: usrcp init --client=claude,cursor or --client=all.

For terminal-based MCP-aware CLI agents (Claude Code, Cursor CLI, Codex, Copilot CLI, Cline, Continue, Aider, Antigravity, OpenCode), a single wizard wires them all up:

bash
usrcp setup --adapter=terminal

No external accounts or bot tokens required — every terminal session in those agents gets cross-platform memory through the same local ledger.

All clients share the same local ledger per user.

Other Consumers

  • usrcp-hermes — Python memory-provider plugin for Hermes Agent. Adds USRCP as a memory backend so Hermes runs share state with Claude Code, Cursor, etc. Thin wrapper — ledger logic stays in TypeScript.

Project Structure

usrcp/├── spec/│   └── PROTOCOL.md                  # Protocol specification├── schemas/                          # JSON schemas (get_state, append_event, handshake)├── docs/│   ├── SECURITY.md                   # Security & privacy model│   └── INTEGRATIONS/                 # MCP client integration guides├── strategy/                         # GTM, pitch, positioning├── packages/│   ├── usrcp-core/                   # Framework-agnostic protocol core (ledger, crypto, encryption, pairing, rotation, scope)│   ├── usrcp-local/                  # Local MCP server + CLI│   ├── usrcp-cloud/                  # Hosted ledger for ciphertext-only sync│   ├── usrcp-discord/                # Discord capture+reader adapter│   ├── usrcp-extension/              # Chrome extension (claude.ai capture)│   ├── usrcp-hermes/                 # Hermes Agent memory plugin (Python)│   ├── usrcp-imessage/               # iMessage capture+reader (macOS)│   ├── usrcp-linear/                 # Linear issues + comments capture│   ├── usrcp-obsidian/               # Obsidian vault capture│   ├── usrcp-slack/                  # Slack capture+reader│   └── usrcp-telegram/               # Telegram capture+reader└── sdk/                              # Legacy prototype (Jan-Feb 2026); not the reference impl

The legacy sdk/ was a pre-protocol exploration — see sdk/README.md for the historical context. New work should target the usrcp-core ledger directly.

Tests

Current snapshot (per-package npm test):

PackageTests
usrcp-local321
usrcp-core230
usrcp-stream125
usrcp-github90
usrcp-obsidian65
usrcp-imessage54
usrcp-telegram53
usrcp-linear52
usrcp-slack52
usrcp-extension46
usrcp-discord45
usrcp-gmail41
usrcp-google-calendar33
usrcp-adapter-kit32
usrcp-cloud30
usrcp-claude-code28
Total~1297

Plus a Python suite in usrcp-hermes (pytest).

Run a package's suite with npm test from inside its directory. Cross-package prebuild/pretest hooks build usrcp-core (and other siblings) first so types stay in sync. Coverage spans: ledger CRUD, crypto roundtrips, tamper detection, domain isolation, audit log, ULID, pruning, multi-user isolation, optimistic concurrency, schemaless facts, scope enforcement (all in usrcp-core); sync push/pull, Ed25519 signed-request auth (usrcp-local/usrcp-cloud); and per-adapter capture/idempotency/ciphertext-at-rest checks.

Business Model

Open-source protocol (Apache 2.0). The reference implementation is free and local-first. Potential paid offerings will be tested with users; reliable managed handoff/sync and team controls are hypotheses, not shipped commercial or compliance guarantees.

The wedge isn't "every AI-using human." It's security-conscious developers and regulated enterprises who can't adopt an AI state store that phones a third party with plaintext. See strategy/PITCH.md and strategy/GTM.md for the full positioning.

License

Apache 2.0

来源:README.md,提交 9860845

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

2
  1. v0.2.8最新Oct 16, 2026
  2. v0.2.7Sep 16, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分