
XMemo
io.github.yonro由 GitHub 账号 yonro 发布v0.4.346更新于 Nov 2, 2026
Shared, governed long-term memory for AI agents across tools and sessions via MCP and REST.
概览
XMemo 为 AI 助手提供跨工具、跨会话的共享受管长期记忆,并提供 CLI 将记忆接入多种 MCP 客户端。
- 可以做什么
- 新增、搜索、读取、列出、删除与恢复记忆,并可从文件导入
- 按任务召回上下文,保存与恢复代理状态及重启快照
- 在知识库中新增、搜索、读取与更新条目
- 预览并应用记忆整理运行,管理云端技能
- 为受支持的客户端安装并配置 MCP 连接、行为配置、技能与插件
- 适用场景
- 适合希望助手跨会话记住事实、笔记与任务状态,或在多个编码代理之间共享记忆的场景;也适合在同一台机器上让多个 MCP 客户端共用一个记忆服务。
- 运行要求
- 可使用托管的 Streamable HTTP 端点,或通过 npx 运行本地 stdio 包(需要 Node.js)。执行工具需要 XMemo 账号与 bearer 令牌(XMEMO_KEY 或 Authorization 头);支持 OAuth 的客户端可在浏览器中登录。可选的归属头用于标识代理、设备与安装。
安装
在 SourceWeft 中
- 打开 控制台中的 XMemo,将其添加到工作区。
- 连接 所需的 凭据。它们会被私密存储,绝不会在公开页面上展示。
- 为需要使用其工具的对话启用该服务。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
交给智能体安装
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/io.github.yonro%2Fxmemo/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。其他 MCP 客户端
把它添加到你客户端的 mcpServers 配置中。 客户端会在首次连接时完成 OAuth 登录。
{
"mcpServers": {
"xmemo": {
"type": "http",
"url": "https://xmemo.dev/mcp"
}
}
}README
XMemo: Memory OS for AI Agents
[CI] [npm version] [Skill version] [Node.js version] [MIT license] [MCP compatible] [MCP Badge] [Glama quality score]
XMemo is a user-owned Memory OS for AI agents: persistent memory, project context and session continuity with agent identity, provenance and governed access, shared across AI clients through MCP, the CLI and a public REST API surface.
English · 简体中文 | Documentation · Hosted MCP
Quick start · What this repo contains · Beyond MCP · Integrations · Connection modes · Plugins · Commands · Versioning · Security
What this repository contains
@xmemo/client: the officialxmemoCLI for setup, diagnostics, behavior profiles, and memory commands.- MCP distribution: hosted Streamable HTTP configuration (
https://xmemo.dev/mcp) and the localxmemo-mcpstdio server. - XMemo Skill & native integrations:
skills/xmemofor agent platforms and the native plugin index (src/plugins/index.json). - Marketplace and registry metadata: canonical descriptors for MCP Registry (
server.json), LobeHub (lhm.plugin.json), and AI agents (context7.json).
The hosted service implementation is private.
Beyond MCP
MCP is one access surface of XMemo, not the product boundary. XMemo provides a persistent, governed memory operating layer across AI tools and agents:
- Persistent Memory: store, search, list, and soft-delete durable facts, preferences, and operational knowledge across sessions.
- Context Recall: retrieve focused, relevant context on demand with token-budget controls and document expansions.
- Session Continuity & Working State: restart snapshots and state save/restore so agents resume context across process restarts.
- Project Context & Decisions: track project-scoped facts, TODOs, and durable decisions across agent workflows.
- Agent Identity & Provenance: track authorship and origin per memory record via agent instance attribution without conflating credentials.
- Governed Access: scoped tokens, OAuth where the client supports it, soft/hard deletion and sensitive-memory handling (governance details).
- Native Integrations & Skill: dedicated integration for OpenClaw, Hermes, XMemo Skill (ClawHub), and DeepSeek DSH (available, released and pilot-tested; integration maturity Preview).
- Access Surfaces: unified via Model Context Protocol, the local CLI (
xmemo), and the public REST API.
Preview: Cloud Skills; Dream (off by default); Teams (Business plan not yet available). Knowledge Bases are available where enabled for the account.
XMemo CLI
@xmemo/client is the official control plane for connecting AI tools to XMemo. It makes setup repeatable, keeps credentials out of project files, and gives every supported client a consistent path to durable, user-owned memory.
The package is deliberately small: the CLI runtime, safe client configuration, behavior profiles, XMemo skills, and marketplace metadata. Server code, databases, deployment files, logs, and internal operations remain outside the npm distribution.
Architecture
Why XMemo CLI
- One control plane — login, diagnostics, configuration, profiles, updates, and smoke checks share one predictable interface.
- Private by design — generated project configuration references a credential; it never embeds the credential value.
- Native where it matters — OpenClaw and Hermes use dedicated memory integrations instead of duplicating the same capability through MCP.
- Portable everywhere else — hosted Streamable HTTP MCP and local stdio cover modern editors, terminals, and agent runtimes.
- Safe automation — supported setup and removal paths offer preview, dry-run, or explicit confirmation before making changes.
- Small supply-chain surface — the npm package is governed by an explicit file allowlist and release provenance.
Quick start
Guided onboarding (xmemo init)
For an interactive first-run experience across account authentication, detected clients, agent behavior instructions, MCP server setup, skills, and plugins, run:
Flags and options:
xmemo init --dry-run: View the full onboarding plan without performing network calls or disk writes.xmemo init --yes: Automatically accept and apply all onboarding steps without interactive prompts.xmemo init --json: Emit structured JSON for the plan or result envelope.xmemo init --client <id>...: Restrict onboarding to specific clients (e.g.,cursor,codex,claude-code).xmemo start: Alias forxmemo initwith quick-start walkthrough steps.
Global installation exposes xmemo as the primary command, and also provides client and memory-os as aliases.
Manual step-by-step setup
Replace codex with your client. Preview a configuration before writing it:
Running with npx
You can also run any CLI command directly without a global install via npx @xmemo/client <command>:
[!TIP] Start with
xmemo init(orxmemo account login,xmemo doctor, andxmemo setup <client>). Hand-edit MCP configuration only when a client has no verified setup path.
How the commands fit together
The XMemo CLI architecture is built on four core design principles:
1. Unified Resource Grammar (xmemo <resource> <action>)
Every integration component is a first-class resource with predictable lifecycle actions:
- Composite commands:
xmemo setup [<client>...],xmemo uninstall [<client>...], andxmemo status [<client>]orchestrate these resources in a single step according to the client's declarative profile. - Backward-compatible aliases: Familiar commands such as
xmemo mcp add(alias formcp install),xmemo profile uninstall(alias forprofile remove), andxmemo skill uninstall(alias forskill remove) remain fully functional and print a helpful one-line hint in interactive terminals.
2. Unified Target Resolver
When no client is explicitly passed, the CLI uses a deterministic three-tier precedence resolution model:
- Explicit flag or argument:
--client <id>, positional client argument, or--all. - Calling agent environment: Automatically identifies the calling agent runtime when running inside an agent session (e.g.,
CLAUDECODE/CLAUDE_CODE_ENTRYPOINTmaps toclaude-code, andCODEX_THREAD_ID/CODEX_SESSION_IDmaps tocodex). - Detected installed clients: Inspects local configuration paths and markers. If exactly one matching client is found, it is automatically selected; if multiple clients are found in interactive mode, an interactive picker is presented. The CLI never silently writes configuration to arbitrary unverified paths.
3. Plan, Confirm Once, Apply (PlanRunner)
Mutating commands follow a strict, atomic execution pattern:
- Build Plan: Assemble an ordered sequence of actions across resources (e.g. plugin install followed by skill configuration).
- Preview: Print the entire plan (including modified paths, commands, and unified diffs) to the terminal.
- Confirm Once: Prompt
[y/N]exactly once for the entire sequence. Re-running with--yesor-ybypasses the prompt;--dry-rundisplays the preview without mutation. - Apply Sequentially: Steps run in dependency order, stopping immediately upon first failure. Re-running an already configured client detects that all components are up to date and reports
Nothing to do.
4. Declarative Client Registry
All client configurations, recipes, and capabilities are declared centrally in src/clients/registry.js. Command implementations are purely generic orchestrators with zero hardcoded client ID strings. Platforms can also be added dynamically at runtime via registerClient().
Supported integrations
The client registry also covers Devin Desktop (formerly Windsurf), Cline, Continue, Claude Desktop,
Claude Code, Kimi Code, Muse Code, Zed, JetBrains, OpenCode, Qwen, Trae, and compatible
MCP hosts. Run xmemo mcp list for the current machine-readable catalog.
For VS Code users looking for the dedicated editor extension, see the yonro/xmemo-vscode repository. For Cursor users looking for the dedicated plugin, see the yonro/xmemo-cursor-plugin repository. For Claude users looking for the dedicated plugin, see the yonro/xmemo-claude-plugin repository.
Connection modes
Hosted MCP
The recommended universal path is the XMemo Streamable HTTP endpoint:
OAuth-capable clients complete authentication in the browser. Other clients
reference XMEMO_KEY without copying its value into repository files.
Generic configuration shape:
Client configuration keys differ; prefer xmemo setup <client> over copying
this generic example directly.
Local stdio MCP
xmemo-mcp is the dedicated stdio entry point for marketplaces and clients
that launch a local process. Safe discovery exposes 20 tools, three prompts,
and two documentation resources without a token. Tool execution still requires
authentication.
After a global installation:
Install-free MCP configuration:
xmemo mcp serve is equivalent when the CLI is already installed.
Native integrations
OpenClaw and Hermes have dedicated memory providers. Their default setup avoids installing a second, duplicate XMemo tool surface:
- OpenClaw: installs the pinned plugin
clawhub:@xmemo/[email protected]without--forceby default. Re-running setup gracefully detects existing installations; use--forceto reinstall or overwrite. - Hermes: installs the pinned provider package
hermes-xmemo==1.1.3viapip installwithout-U. - Every install command prints the exact command before executing. Use
--dry-runto preview actions without installing.
Add hosted MCP only when an explicit fallback is desired:
Use --mcp-only to skip the native integration and install only the hosted MCP
fallback.
XMemo Skill install
The CLI installs the verified XMemo Skill locally into agent skill folders or a target directory:
- Installs into client skill directories:
- Claude Code:
~/.claude/skills/xmemo-memory(global) or.claude/skills/xmemo-memory(project with--project) - Codex:
~/.codex/skills/xmemo-memory - OpenClaw:
~/.openclaw/skills/xmemo-memory - All other 21 clients remain
nulluntil officially documented.
- Claude Code:
- Defaults to the pinned
@xmemo/[email protected]release from npm and verifies tarball integrity (sha512 SRI) before extraction. - Override version with
--version <semver>or explicitly opt into the latest release via--version latest. - For air-gapped or offline installations, install from a local directory or packed tarball with
--from <dir|tgz>(optional--integrity <sha512>). - Manage client skills with
skill status,skill update, andskill remove. - Preview actions without writing files using
--dry-run. - Safety & Consent:
- Interactive install prompts
[y/N]before writing (Enter, EOF, or empty input cancels) unless--yesis specified. - Existing installs refuse overwrite without
--force; when--forceis used, a backup is created in~/.xmemo/backups/skills/<client>/(outside the agent skills directory). skill removeonly removes verified XMemo skill directories, refusing foreign folders, and reports the preserved backup location.
- Interactive install prompts
Standalone curl & PowerShell installers
For environments without Node.js or @xmemo/client, XMemo provides standalone HTTPS installers at https://xmemo.dev/skill/install (POSIX sh) and https://xmemo.dev/skill/install.ps1 (PowerShell).
The installer is agent-aware and automatically resolves the correct target directory for your active agent:
[!TIP] Prompt for your AI Agent (copy and paste directly into Claude Code, Codex, or another agent):
Target resolution precedence (first match wins):
XMEMO_SKILL_DIR: Installs to the specified directory.XMEMO_SKILL_AGENT=claude-code|codex: Installs to the explicit agent's skills directory (openclawredirects toopenclaw skills install xmemo).- Auto-detection: Automatically detects Claude Code (
CLAUDECODE=1) or Codex (CODEX_THREAD_ID,CODEX_SESSION_ID, orCODEX_HOME). - Home directory discovery: If only
~/.claudeor only~/.codexexists in HOME, selects that agent. - Fallback: Installs to
./xmemo-skillwith a warning on stderr explaining that AI agents will not automatically load the skill from this directory.
Safety & Replacement:
- Refuses to overwrite existing installations unless
XMEMO_SKILL_FORCE=1is provided. - When replacing, moves the previous installation to
~/.xmemo/backups/skills/<agent>/<name>-<timestamp>(safely outside agent skill search paths). - After installation, prints the absolute install path, the verification doctor command (
node <path>/scripts/xmemo-skill.mjs doctor --anonymous), and a prompt to reload your agent.
Agent plugins
The CLI provides a curated, static index of verified agent plugins shipped directly in @xmemo/client. Each entry contains a pinned version, release tag, and exact Git commit SHA resolved at release time.
ℹ️ Strict Separation Rule:
xmemo plugininstalls agent plugins only (e.g.@xmemo/openclaw-memory). Skills are installed exclusively viaxmemo skill install(e.g.@xmemo/xmemo).
Commands:
Security & Consent:
- Only verified plugin IDs from the static index are accepted; arbitrary URLs and unknown IDs are rejected with exit code 2.
- Interactive install always displays the execution plan and requires explicit consent (
[y/N], defaulting to Cancel on empty input or EOF). --dry-runguarantees zero disk writes and zero spawned processes.- Marketplace and manual plugins display exact step-by-step instructions from the plugin repository during
plugin install <id>(pass--opento open docs in browser). - Git directory plugins (
claude-code) clone into a stable per-user location (~/.xmemo/plugins/<id>), support--dir <path>override, verify the checked-outHEADcommit byte-for-byte, and output the exact load command (claude --plugin-dir <dir>). On commit mismatch, the directory is immediately removed. - Plugin child processes run in an isolated environment with authentication tokens (
XMEMO_KEY,MEMORY_OS_MCP_TOKEN,XMEMO_TOKEN) scrubbed from argv and env.
Account and authentication
Account commands
Manage local authentication, stored credentials, and tokens through the account command family:
Safe account logout (xmemo account logout)
- Target removal: Removes only the user-scoped credential file owned by the CLI (
~/.config/xmemo/credentials.jsonor OS config root). - Explicit confirmation: Displays the target credential path and prompts
Proceed with logout? [y/N](defaulting to No) unless--yesis specified. - Client & Agent Isolation: Preserves all client MCP configuration files (Cursor, Claude, VS Code, etc.) and agent-managed OAuth sessions.
- Privacy: Never displays or leaks token values in stdout, stderr, or JSON envelopes.
- Scripting: Requires
--yeswhen--jsonis specified to prevent accidental headless logout.
Legacy authentication aliases
The legacy commands remain fully supported as backward-compatible aliases:
xmemo login(alias forxmemo account login)xmemo auth status(alias forxmemo account status)xmemo auth-status(alias forxmemo account status)xmemo token <status|add|set>(alias forxmemo account token <status|add|set>)
In interactive human mode, legacy aliases emit a one-line deprecation hint to stderr. When run with --json or --help, the deprecation hint is suppressed.
Existing token import
Pipe an existing token through stdin so it does not appear in command history:
PowerShell:
For CI and managed workstations, expose XMEMO_KEY through the platform's
secret manager. Do not commit it to .env, MCP configuration, logs, issue
reports, or chat transcripts.
Universal --json output
Every command and subcommand supports --json for predictable scripting:
- On success: Outputs valid JSON on
stdoutwith exit code0. - On error: Outputs a structured JSON error envelope
{ schemaVersion, ok: false, command, data: null, error: { code, message, ... } }onstdoutwith a non-zero exit code (e.g. exit code2for usage/input errors,1for internal/network errors).
Command reference
1. Get started
2. Connect agents
3. Skill
4. Plugins
5. Memory
All direct service commands support a single machine-readable JSON envelope.
Knowledge update, Dream apply, and Cloud Skill run use the readReceipt from a
saved read/show result so the CLI never silently substitutes a newer revision.
Set XMEMO_KNOWLEDGE_BASE_ID for a non-interactive default knowledge base.
For a long knowledge item, continue the same fixed revision with
xmemo knowledge read <item-id> --from knowledge-view.json --offset <n>.
Run xmemo doctor --services --json for read-only Knowledge, Dream, and Cloud
Skill diagnostics; it deliberately does not claim write or production readiness.
Cloud Skill add/update already target the safe create-only and content-CAS
contracts. They fail with SERVER_CONTRACT_REQUIRED on older services and do
not fall back to legacy upsert routes. Binary Knowledge item updates similarly
require a new version of the same server Document; use --document and
--document-version after that version has been uploaded.
The normal login scopes remain unchanged. Request additional service scopes explicitly when needed, for example:
6. Account
7. Maintenance
Run xmemo help or xmemo <command> --help for complete, version-matched
options.
Client notes
Codex and Cursor
Both setup paths write a user-scoped MCP entry and can install a marker-scoped
memory behavior profile. Use --no-profile to configure MCP only. Cursor's
public marketplace plugin remains OAuth-first and contains no bearer-token
configuration.
Gemini CLI and Antigravity
These clients use hosted MCP OAuth. Their generated configuration carries no token value; restart the client and complete the browser login on first use.
OpenClaw
The setup command installs or updates @xmemo/openclaw-memory, installs the
XMemo Skill, reuses the shared XMemo credential, and checks plugin status.
Hermes
The setup command installs or updates hermes-xmemo, configures the native
provider, and synchronizes the user-scoped XMemo credential with Hermes.
Copilot CLI
Copilot CLI receives a local proxy entry. The proxy reads the credential from user-scoped storage, adds identity metadata, and forwards requests to hosted MCP without writing secrets into Copilot configuration.
Security by default
Credential precedence and compatibility aliases are documented by:
For private or self-hosted deployments, set XMEMO_URL or pass
--url <service-url>. MEMORY_OS_URL remains a compatibility alias.
Package boundary
Published to npm:
Not published:
Development
Before proposing a release, run the complete package gate:
The local stdio server can be inspected directly:
Versioning
This repository distributes two independent products with decoupled version tracks:
- CLI (
@xmemo/client): Published to npm.- Version source:
package.json. - Tag convention:
cli-v*(legacy tags through version 0.4.181 usedv0.4.xxx). - View versions on npm (@xmemo/client).
- Version source:
- Skill (
xmemo): Published to ClawHub and distributed via xmemo.dev.- Version source:
skills/xmemo/scripts/xmemo-skill.mjs(SKILL_VERSION). - Tag convention:
skill-v*. - View versions on ClawHub (xmemo). GitHub Releases for skill releases explicitly carry the
Latestrelease badge to support automated installer and server fallback downloads.
- Version source:
Release model
Normal releases are produced by GitHub Actions from the exact tagged commit, not from a mutable branch checkout or a developer workstation:
The CLI package and hosted MCP service intentionally have separate version streams:
- CLI/npm version:
package.json,package-lock.json, and the npm package entry inserver.json. - Hosted MCP/Registry version: the top-level
server.json.versionandlhm.plugin.json. This version follows the deployed XMemo service.
node scripts/check-release-version.mjs verifies both contracts. A
cli-vX.Y.Z tag must equal the CLI/npm version and publishes only npm. The
MCP Registry is published separately with the Publish MCP Registry metadata
workflow using mcp-vX.Y.Z, which must equal the hosted MCP/Registry version.
The separate npm publish workflow is manual recovery only, so creating a
GitHub Release cannot publish twice. CLI npm publishing uses OIDC trusted
publishing (environment: npm, id-token: write); static NPM_TOKEN is no
longer used. Manual recovery via .github/workflows/publish.yml requires its
own trusted publisher entry on npmjs.com.
Documentation and support
Canonical service documentation lives at docs.xmemo.dev. This repository documents the client; the pages below document the hosted service it connects to.
License
MIT © 2025–2026 Yonro
来源:README.md,提交 22aac5b
工具
0版本历史
2- v0.4.346最新Sep 25, 2026
- v0.4.345Sep 16, 2026
评分
已满足适用检查项的 85%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
- 近 30 天内可连通必需25 分
- 已声明认证方式必需10 分
- 已列出工具15 分
请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。
- 描述必需15 分
- 图标10 分
- 文档15 分
- 许可证10 分