@xuanling-rs/xuanling-mcp 0.6.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README-ZH.md +143 -48
  2. package/README.md +172 -59
  3. package/package.json +5 -5
package/README-ZH.md CHANGED
@@ -2,20 +2,64 @@
2
2
 
3
3
  [English](README.md) | 简体中文
4
4
 
5
- `@xuanling-rs/xuanling-mcp` 是面向编码 Agent 的跨平台本地 Model Context Protocol 服务器。它通过
6
- stdio 提供 42 个类型化工具,覆盖文件系统操作、进程执行、项目探测、Artifact、Session 和
7
- proposal-first SQLite Memory。
5
+ `@xuanling-rs/xuanling-mcp` 是面向编码 Agent 的本地跨平台 Model Context Protocol
6
+ (MCP)服务器。它通过 stdio 提供 43 个类型化工具,覆盖文件系统操作、进程与项目执行、
7
+ Artifact、Session 和 proposal-first 的 Memory v2,并提供确定性 schema、结构化失败和显式
8
+ 文件系统边界。
9
+
10
+ ## 这是什么、为什么用它
11
+
12
+ XuanLing 让 MCP Host 获得一个本地、可预测的统一工具面,而不必为每个平台维护一套脚本。
13
+ 它的主要特点:
14
+
15
+ - **43 个类型化工具,可按 profile 组合。** Host 可以暴露完整 catalog,也可以只暴露需要
16
+ 的工具族;未暴露的工具无法按名称调用。
17
+ - **文件操作带显式安全前置条件。** 修改类工具支持 SHA-256 preimage 校验;支持窗口输出
18
+ 的读取和搜索返回类型化 cursor,而不是静默截断;路径访问由显式 capability root 控制。
19
+ - **proposal-first 的 Memory v2。** Memory 写入先停留在 pending proposal,只有显式
20
+ `memory_review` 决策才会推进不可变 canonical record,Agent 无法静默改写持久化 Memory。
21
+ - **直接的进程与项目执行。** 命令以 program + argv 形式运行,不经过隐式 shell;取消操作
22
+ 会作用于整个子进程树。
23
+ - **原生 npm 分发。** 安装过程不运行 `postinstall`、不编译 Rust、不从远程 URL 下载
24
+ binary;启动器会校验平台 package metadata 和原生 binary 的 SHA-256。
25
+
26
+ **该用哪个?** 当 MCP Host 可以直接启动 stdio 服务器时,使用
27
+ `@xuanling-rs/xuanling-mcp`。使用 DeepSeek Harness 时,请安装对应 bundle:推荐用
28
+ `@xuanling-rs/xuanling-dsh-memory` 获得 Memory v2 profile;需要增量挂载完整 catalog 用
29
+ `@xuanling-rs/xuanling-dsh-tools`;需要替换 DSH 文件系统工具用
30
+ `@xuanling-rs/xuanling-dsh-tools-replace`。`@xuanling-rs/xuanling-dsh-skills` 只增加
31
+ 工作流 Skill,不挂载 MCP 工具。[DeepSeek Harness 集成 README](https://github.com/umbrella22/xuanling/blob/main/integrations/deepseek-harness/README-ZH.md)
32
+ 说明了 bundle 的选择与安装。
33
+
34
+ ## 环境要求
35
+
36
+ - Node.js 18.17 或更高版本。
37
+ - 支持 stdio 的 MCP Host。
38
+ - 受支持平台之一:
8
39
 
9
- ## 安装
40
+ | 操作系统 | 架构 | 运行时要求 |
41
+ | --- | --- | --- |
42
+ | macOS | Apple Silicon(`arm64`) | 原生二进制 |
43
+ | Linux | `x64` | glibc 2.35 或更高版本 |
44
+ | Windows | `x64` | MSVC runtime |
45
+
46
+ 不需要 Rust 工具链或编译器。不支持的 OS、CPU 或 libc 组合会由启动器返回明确错误。
10
47
 
11
- 启动器要求 Node.js 18.17 或更高版本。
48
+ ## 安装
12
49
 
13
50
  ```sh
14
- npm install --global @xuanling-rs/xuanling-mcp@0.6.0
51
+ npm install --global @xuanling-rs/xuanling-mcp@0.7.0
15
52
  xuanling-mcp --version
16
53
  ```
17
54
 
18
- MCP Client 也可以使用 `npx` 固定版本:
55
+ 频繁启动服务器时,全局安装或项目内安装可以省去 package 解析步骤。偏好按需执行的 Host
56
+ 可以使用[快速开始](#快速开始)中的固定版本 `npx` 配置。
57
+
58
+ 固定精确版本可以让活动项目发现的 MCP 合同保持稳定。已发布的 npm 版本不可变。
59
+
60
+ ## 快速开始
61
+
62
+ 把服务器加入 MCP Client 配置:
19
63
 
20
64
  ```json
21
65
  {
@@ -24,88 +68,139 @@ MCP Client 也可以使用 `npx` 固定版本:
24
68
  "command": "npx",
25
69
  "args": [
26
70
  "-y",
27
- "@xuanling-rs/xuanling-mcp@0.6.0",
71
+ "@xuanling-rs/xuanling-mcp@0.7.0",
28
72
  "--workspace-root",
29
- "/absolute/path/to/project",
30
- "--tool-profile",
31
- "core",
32
- "--tool-profile",
33
- "fs",
34
- "--tool-profile",
35
- "memory"
73
+ "/absolute/path/to/project"
36
74
  ]
37
75
  }
38
76
  }
39
77
  }
40
78
  ```
41
79
 
42
- 固定版本可以保持活动项目发现的 MCP 合同稳定。频繁启动服务器时,全局安装或项目内安装可以
43
- 省去 package 解析过程。
80
+ 重启 Host,让它启动服务器并完成 MCP `initialize`。初始化 metadata 会发布所选 catalog
81
+ 的 `xuanling.tool_count` 和模型可见定义的 `xuanling.catalog_sha256`。重复添加
82
+ `--tool-profile` 可以让服务器只暴露 Host 需要的工具族;见[工具 Profile](#工具-profile)。
44
83
 
45
- ## 支持平台
84
+ ## 使用与配置
46
85
 
47
- | 操作系统 | 架构 | 运行时要求 |
48
- | --- | --- | --- |
49
- | macOS | Apple Silicon (`arm64`) | 原生二进制 |
50
- | Linux | `x64` | glibc 2.35 或更高版本 |
51
- | Windows | `x64` | MSVC runtime |
52
-
53
- 不支持的 OS、CPU 或 libc 组合会返回明确错误。安装过程不编译 Rust、不运行 `postinstall`,
54
- 也不下载可执行文件。启动器会在启动前校验 package metadata 和所选原生 binary 的 SHA-256。
86
+ ### 工具 Profile
55
87
 
56
- ## 工具 Profile
57
-
58
- 默认 catalog 暴露全部 42 个工具。重复使用 `--tool-profile` 可以组合多个较小的工具组:
88
+ 默认 catalog 暴露全部 43 个工具。重复使用 `--tool-profile` 可以组合较小的工具组:
59
89
 
60
90
  | Profile | 工具数 | 能力族 |
61
91
  | --- | ---: | --- |
62
92
  | `core` | 3 | 系统信息与可移植路径检查 |
63
- | `fs` | 16 | 文件读取、搜索、预览与修改 |
93
+ | `fs` | 17 | 文件读取、搜索、预览与修改 |
64
94
  | `process` | 5 | 直接进程执行与项目探测/执行 |
65
95
  | `memory` | 9 | Memory v2 提案、评审、召回与反馈 |
66
96
  | `advanced` | 9 | Artifact、ChangeSet、Pipeline 与 Session |
67
- | `all` | 42 | 完整 catalog 和默认选择 |
97
+ | `all` | 43 | 完整 catalog 和默认选择 |
98
+
99
+ `all` 与其他 profile 同时出现时优先。发现与调用使用同一份选择,未暴露的工具无法按名称
100
+ 调用。修改 profile 后需要重启服务器进程。
68
101
 
69
- ## 文件系统能力
102
+ ### 文件系统边界
70
103
 
71
104
  - `--workspace-root <PATH>` 可重复,允许读取、写入、删除,并允许在该 root 内设置子进程
72
105
  工作目录。
73
106
  - `--read-root <PATH>` 可重复,只允许读取、列出、搜索和计算 hash;拒绝写入、删除和设置
74
107
  子进程工作目录。
75
- - 两个 flag 都未提供时,XuanLing 文件系统访问不受限制。仅提供 `--read-root` 时为只读部署。
108
+ - 两个 flag 都未提供时,XuanLing 文件系统访问不受限制。仅提供 `--read-root` 时为只读
109
+ 部署。
110
+ - 在配置了 capability root 的部署中,`--base-dir` 默认取第一个 `--workspace-root`;
111
+ `--base-dir` 只是相对路径解析上下文,不是 sandbox。
76
112
 
77
113
  修改类工具支持 SHA-256 preimage 校验。支持窗口输出的工具可以设置显式 byte budget,并返回
78
114
  类型化 cursor 或 resume token,不会静默截断结果。
79
115
 
80
116
  路径能力不是子进程的 OS sandbox。工具审批和恶意进程隔离由 MCP Host 与执行环境负责。
81
117
 
82
- ## Memory v2
118
+ ### Memory v2
119
+
120
+ Memory v2 把提案(proposal)与 canonical record 分开:
83
121
 
84
- Create、replace 和 archive 调用只产生 pending proposal。只有显式 `memory_review` 决策才能
85
- 原子推进不可变的 canonical record。严格的 `global`、`project` 和 `workspace` scope 防止
86
- sibling project 之间发生召回泄漏。
122
+ 1. `memory_search` 与 `memory_get` 检查 active record。
123
+ 2. `memory_candidate_create`、`memory_candidate_replace` 和
124
+ `memory_candidate_archive` 产生 pending proposal。
125
+ 3. `memory_review` 接受或拒绝特定 proposal revision;只有 review 被接受才会原子推进
126
+ canonical record head。
127
+ 4. 不可变版本、终态 review 和 append-only feedback 保留审计与恢复所需的历史。
128
+
129
+ `global`、`project` 和 `workspace` scope 严格执行;sibling project 之间不会互相
130
+ 召回。召回使用 SQLite FTS5 上的确定性词法查询计划,不要求也不下载 embedding 模型。默认
131
+ 数据库为 `~/.xuanling/memory.db`;可用 `--memory-db <PATH>` 覆盖。服务器在第一次有效
132
+ Memory 工具调用时才惰性打开数据库,因此启动、discovery 和非 Memory 工具不会创建或迁移它。
133
+
134
+ canonical 数据可以导出、导入空数据库,并用于重建派生搜索投影:
135
+
136
+ ```sh
137
+ xuanling-mcp --memory-db /path/to/memory.db memory export --output backup.jsonl
138
+ xuanling-mcp --memory-db /path/to/empty.db memory import --input backup.jsonl
139
+ xuanling-mcp --memory-db /path/to/memory.db memory rebuild-index
140
+ ```
87
141
 
88
- 召回使用确定性 SQLite FTS5 query plan 和稳定词法重排,不要求或下载 embedding 模型。默认
89
- 数据库路径为 `~/.xuanling/memory.db`;使用 `--memory-db <PATH>` 可以覆盖该路径。
142
+ 导出会写入带版本的 JSONL;导入会先完整校验,再以单个事务写入;`rebuild-index` 不会改变
143
+ canonical row。
90
144
 
91
- ## Server 选项
145
+ ### 服务器选项
92
146
 
93
147
  ```text
94
- --base-dir <PATH> 相对路径解析上下文
95
- --workspace-root <PATH> 可重复的读写 capability root
148
+ --base-dir <PATH> 相对工具路径的解析上下文(不是 sandbox)
149
+ --workspace-root <PATH> 可重复的读写删除 capability root
96
150
  --read-root <PATH> 可重复的只读 capability root
97
- --memory-db <PATH> 共享 SQLite Memory 数据库
98
- --default-namespace <VALUE> 默认 Memory namespace
151
+ --memory-db <PATH> 共享 SQLite Memory 数据库(默认:~/.xuanling/memory.db)
152
+ --default-namespace <VALUE> Memory 请求省略 namespace 时使用的默认值
99
153
  --sqlite-busy-timeout-ms <NUMBER> SQLite busy timeout(默认 5000)
100
154
  --tool-profile <PROFILE> 可重复工具组;默认 all
101
- --compat-lenient-object-params 受影响 Host 的可选兼容模式
155
+ --compat-lenient-object-params 面向会把 object 参数转成字符串的 Host 的可选兼容模式
102
156
  ```
103
157
 
104
- ## 源码与文档
158
+ `xuanling-mcp memory export|import|rebuild-index` 是维护子命令,不会启动 stdio 服务器
159
+ 会话。
160
+
161
+ ## 工作原理
162
+
163
+ - npm package 是 Node.js 启动器:解析平台原生 package,校验版本 metadata 与 binary
164
+ SHA-256,然后把 argv、stdio、signal 和退出状态透传给原生服务器。
165
+ - 原生服务器只通过 stdin/stdout 承载 MCP,不监听网络端口,也不发起远程调用。
166
+ - 工具 catalog 在服务器进程生命周期内保持不变。`tools/list` 使用不透明 cursor 分页,
167
+ Host 必须持续跟随 `nextCursor` 直到其消失。
168
+ - Memory 是本地 SQLite 数据库,惰性打开;召回过程不访问网络。
169
+
170
+ ## 兼容性与限制
171
+
172
+ - 受支持的 npm 目标为 macOS Apple Silicon、glibc 2.35 或更高版本的 Linux x64,以及
173
+ Windows x64 MSVC。Intel macOS、ARM Linux、glibc 2.34 及更早版本、musl Linux 和
174
+ ARM Windows 不在发布范围内。
175
+ - 支持的 MCP 协议版本为 `2024-11-05`、`2025-03-26`、`2025-06-18` 和
176
+ `2025-11-25`。
177
+ - 0.7.0 的原生 binary 没有 Developer ID 或 Authenticode 签名;package 完整性合同由
178
+ npm provenance 和启动器的 SHA-256 校验保证。
179
+ - 文件系统 capability 不是 XuanLing 工具所启动进程的 OS sandbox。
180
+ - catalog 在服务器进程内不变,服务器不会声明 `tools.listChanged`。修改 profile 或
181
+ catalog 配置后需要重启服务器。
182
+ - Memory 在每个服务器进程中使用单个本地 SQLite 数据库,需要可写的数据库路径,或可解析的
183
+ `HOME`/`USERPROFILE`。
184
+ - 服务器只使用 stdio transport,不提供 HTTP 或远程模式。
185
+
186
+ ## 故障排查
187
+
188
+ | 现象 | 原因与处理 |
189
+ | --- | --- |
190
+ | `Unsupported platform: <os>/<arch>` | 该目标未发布。请使用 macOS Apple Silicon、glibc 2.35 或更高版本的 Linux x64,或 Windows x64。 |
191
+ | `Unsupported Linux libc` 或 `Unsupported Linux glibc` | XuanLing 只发布 glibc 构建,并要求 glibc 2.35 或更高版本。 |
192
+ | `Missing optional dependency` 或 `Native binary checksum mismatch` | 重新安装固定版本,例如 `npm install --global @xuanling-rs/xuanling-mcp@0.7.0`。已发布的 npm 版本不可变。 |
193
+ | Memory 工具报告 `memory store unavailable` 或 `cannot resolve the default memory DB path` | 传入可写的 `--memory-db <PATH>`,或设置 `HOME`/`USERPROFILE` 以便解析默认的 `~/.xuanling/memory.db`。非 Memory 工具仍可正常使用。 |
194
+ | Host 看到的工具比预期少 | 当前启用了 `--tool-profile` 选择。组合多个 profile 或使用 `--tool-profile all`,然后重启服务器进程。 |
195
+ | Host 在 `initialize` 前退出 | 检查 Node.js 版本(18.17 或更高)以及 Host 的 stdio 启动配置。 |
196
+
197
+ ## 链接
105
198
 
106
199
  - 源码:<https://github.com/umbrella22/xuanling>
107
- - 集成指南:<https://github.com/umbrella22/xuanling/blob/main/docs/guides/xuanling-mcp-integration.md>
108
- - DeepSeek Harness 集成:<https://github.com/umbrella22/xuanling/tree/main/integrations/deepseek-harness>
200
+ - 产品文档:<https://github.com/umbrella22/xuanling/blob/main/README-ZH.md>
201
+ - DeepSeek Harness 集成:<https://github.com/umbrella22/xuanling/blob/main/integrations/deepseek-harness/README-ZH.md>
202
+ - Changelog:<https://github.com/umbrella22/xuanling/blob/main/CHANGELOG.md>
109
203
  - Issues:<https://github.com/umbrella22/xuanling/issues>
204
+ - npm package:<https://www.npmjs.com/package/@xuanling-rs/xuanling-mcp>
110
205
 
111
206
  本项目采用 [MIT License](LICENSE)。
package/README.md CHANGED
@@ -2,21 +2,75 @@
2
2
 
3
3
  English | [Simplified Chinese](README-ZH.md)
4
4
 
5
- `@xuanling-rs/xuanling-mcp` is a cross-platform local Model Context Protocol server for
6
- coding agents. It exposes 42 typed tools over stdio for filesystem work,
7
- process execution, project discovery, artifacts, sessions, and proposal-first
8
- SQLite memory.
5
+ `@xuanling-rs/xuanling-mcp` is a local, cross-platform Model Context Protocol
6
+ (MCP) server for coding agents. It exposes 43 typed tools over stdio for
7
+ filesystem work, process and project execution, artifacts, sessions, and
8
+ proposal-first Memory v2, with deterministic schemas, structured failures, and
9
+ explicit filesystem boundaries.
10
+
11
+ ## What and Why
12
+
13
+ XuanLing gives an MCP host one local, predictable tool surface instead of a
14
+ collection of OS-specific scripts. Its main properties are:
15
+
16
+ - **43 typed tools with combinable profiles.** A host can expose the complete
17
+ catalog or only the families it needs, and a hidden tool cannot be called by
18
+ name.
19
+ - **Filesystem work with explicit safety preconditions.** Mutations support
20
+ SHA-256 preimage checks, window-capable reads and searches return typed
21
+ cursors instead of silently truncating, and path access is controlled by
22
+ explicit capability roots.
23
+ - **Proposal-first Memory v2.** Memory writes stay pending until an explicit
24
+ `memory_review` decision advances an immutable canonical record, so an agent
25
+ cannot silently rewrite persistent memory.
26
+ - **Direct process and project execution.** Commands run as program + argv
27
+ without an implicit shell, and cancellation applies to the descendant process
28
+ tree.
29
+ - **Native npm distribution.** Installation runs no `postinstall`, compiles no
30
+ Rust, and downloads no binary from a remote URL; the launcher verifies the
31
+ platform package metadata and the native binary's SHA-256.
32
+
33
+ **Which package do I need?** Use `@xuanling-rs/xuanling-mcp` when an MCP host can
34
+ launch a stdio server directly. For DeepSeek Harness, install a bundle instead:
35
+ `@xuanling-rs/xuanling-dsh-memory` for the recommended Memory v2 profile,
36
+ `@xuanling-rs/xuanling-dsh-tools` for the additive full catalog, or
37
+ `@xuanling-rs/xuanling-dsh-tools-replace` to replace DSH filesystem tools.
38
+ `@xuanling-rs/xuanling-dsh-skills` adds workflow Skills and no MCP tools. The
39
+ [DeepSeek Harness integration README](https://github.com/umbrella22/xuanling/blob/main/integrations/deepseek-harness/README.md)
40
+ covers bundle selection and setup.
41
+
42
+ ## Requirements
43
+
44
+ - Node.js 18.17 or newer.
45
+ - An MCP host that can start a stdio server.
46
+ - One of the supported platforms:
9
47
 
10
- ## Install
48
+ | Operating system | Architecture | Runtime requirement |
49
+ | --- | --- | --- |
50
+ | macOS | Apple Silicon (`arm64`) | native binary |
51
+ | Linux | `x64` | glibc 2.35 or newer |
52
+ | Windows | `x64` | MSVC runtime |
11
53
 
12
- The launcher requires Node.js 18.17 or newer.
54
+ No Rust toolchain or compiler is required. Unsupported OS, CPU, or libc
55
+ combinations fail with an explicit launcher error.
56
+
57
+ ## Install
13
58
 
14
59
  ```sh
15
- npm install --global @xuanling-rs/xuanling-mcp@0.6.0
60
+ npm install --global @xuanling-rs/xuanling-mcp@0.7.0
16
61
  xuanling-mcp --version
17
62
  ```
18
63
 
19
- MCP clients can also pin the version with `npx`:
64
+ A global or project-local installation avoids the package resolution step when
65
+ the host starts the server frequently. Hosts that prefer on-demand execution can
66
+ use the pinned `npx` configuration in [Quickstart](#quickstart).
67
+
68
+ Pinning the exact version keeps the discovered MCP contract stable for an
69
+ active project. Published npm versions are immutable.
70
+
71
+ ## Quickstart
72
+
73
+ Add the server to the MCP client configuration:
20
74
 
21
75
  ```json
22
76
  {
@@ -25,98 +79,157 @@ MCP clients can also pin the version with `npx`:
25
79
  "command": "npx",
26
80
  "args": [
27
81
  "-y",
28
- "@xuanling-rs/xuanling-mcp@0.6.0",
82
+ "@xuanling-rs/xuanling-mcp@0.7.0",
29
83
  "--workspace-root",
30
- "/absolute/path/to/project",
31
- "--tool-profile",
32
- "core",
33
- "--tool-profile",
34
- "fs",
35
- "--tool-profile",
36
- "memory"
84
+ "/absolute/path/to/project"
37
85
  ]
38
86
  }
39
87
  }
40
88
  }
41
89
  ```
42
90
 
43
- Pinning the version keeps the discovered MCP contract stable for an active
44
- project. A global or project-local installation avoids the package resolution
45
- step when the host starts the server frequently.
91
+ Restart the host so it launches the server and completes MCP `initialize`.
92
+ Initialization metadata publishes `xuanling.tool_count` for the selected catalog
93
+ and `xuanling.catalog_sha256` for the model-visible definitions. Add repeatable
94
+ `--tool-profile` entries to expose only the families the host needs; see
95
+ [Tool profiles](#tool-profiles).
46
96
 
47
- ## Supported Platforms
97
+ ## Usage and Configuration
48
98
 
49
- | Operating system | Architecture | Runtime requirement |
50
- | --- | --- | --- |
51
- | macOS | Apple Silicon (`arm64`) | native binary |
52
- | Linux | `x64` | glibc 2.35 or newer |
53
- | Windows | `x64` | MSVC runtime |
99
+ ### Tool profiles
54
100
 
55
- Unsupported OS, CPU, and libc combinations fail with an explicit error. The
56
- package does not compile Rust, run a `postinstall` script, or download
57
- executables. The launcher validates package metadata and the selected native
58
- binary's SHA-256 before startup.
59
-
60
- ## Tool Profiles
61
-
62
- The default catalog exposes all 42 tools. Repeat `--tool-profile` to combine
101
+ The default catalog contains all 43 tools. Repeat `--tool-profile` to combine
63
102
  smaller groups:
64
103
 
65
104
  | Profile | Tools | Capability family |
66
105
  | --- | ---: | --- |
67
106
  | `core` | 3 | system and portable path inspection |
68
- | `fs` | 16 | filesystem read, search, preview, and mutation |
107
+ | `fs` | 17 | filesystem read, search, preview, and mutation |
69
108
  | `process` | 5 | direct processes and project detection/execution |
70
109
  | `memory` | 9 | Memory v2 proposal, review, recall, and feedback |
71
110
  | `advanced` | 9 | artifacts, ChangeSets, pipelines, and sessions |
72
- | `all` | 42 | complete catalog and default selection |
111
+ | `all` | 43 | complete catalog and default selection |
112
+
113
+ `all` takes precedence when combined with another profile. Discovery and
114
+ dispatch use the same selection, so a hidden tool cannot be called by name.
115
+ Changing profiles requires restarting the server process.
73
116
 
74
- ## Filesystem Capabilities
117
+ ### Filesystem boundaries
75
118
 
76
119
  - `--workspace-root <PATH>` is repeatable and grants read/write/delete access
77
120
  plus child-process working-directory admission inside the root.
78
121
  - `--read-root <PATH>` is repeatable and grants read/list/search/hash access
79
122
  while rejecting writes, deletion, and child-process working directories.
80
- - With neither flag, XuanLing filesystem access is unrestricted. With only
81
- `--read-root`, the deployment is read-only.
123
+ - With neither flag, XuanLing filesystem access is unrestricted. Supplying only
124
+ `--read-root` creates a read-only deployment.
125
+ - In a contained deployment, `--base-dir` defaults to the first
126
+ `--workspace-root`; `--base-dir` is a relative-path context, not a sandbox.
82
127
 
83
- Mutating tools support SHA-256 preimage checks. Window-capable tools support
128
+ Mutating tools support SHA-256 preimage checks. Window-capable tools accept
84
129
  explicit byte budgets and return typed cursors or resume tokens instead of
85
130
  silently truncating results.
86
131
 
87
- The pathname capability is not an OS sandbox for child programs. Tool
88
- approval and hostile process isolation belong to the MCP host and execution
89
- environment.
132
+ The pathname capability is not an OS sandbox for child programs. Tool approval
133
+ and hostile process isolation belong to the MCP host and execution environment.
90
134
 
91
- ## Memory v2
135
+ ### Memory v2
92
136
 
93
- Create, replace, and archive calls produce pending proposals. Only an explicit
94
- `memory_review` decision can atomically advance an immutable canonical record.
95
- Strict `global`, `project`, and `workspace` scopes prevent sibling-project
96
- recall.
137
+ Memory v2 separates proposals from canonical records:
138
+
139
+ 1. `memory_search` and `memory_get` inspect active records.
140
+ 2. `memory_candidate_create`, `memory_candidate_replace`, and
141
+ `memory_candidate_archive` produce pending proposals.
142
+ 3. `memory_review` accepts or rejects a specific proposal revision. Only an
143
+ accepted review atomically advances the canonical record head.
144
+ 4. Immutable versions, terminal reviews, and append-only feedback keep the
145
+ history needed for audit and recovery.
146
+
147
+ `global`, `project`, and `workspace` scopes are strict; sibling projects are
148
+ never searched. Recall uses a deterministic lexical query plan over SQLite FTS5
149
+ and does not require or download an embedding model. The default database is
150
+ `~/.xuanling/memory.db`; override it with `--memory-db <PATH>`. The server opens
151
+ the database lazily on the first valid Memory tool call, so startup, discovery,
152
+ and non-memory tools never create or migrate it.
153
+
154
+ Canonical data can be exported, imported into an empty database, and used to
155
+ rebuild the derived search projection:
156
+
157
+ ```sh
158
+ xuanling-mcp --memory-db /path/to/memory.db memory export --output backup.jsonl
159
+ xuanling-mcp --memory-db /path/to/empty.db memory import --input backup.jsonl
160
+ xuanling-mcp --memory-db /path/to/memory.db memory rebuild-index
161
+ ```
97
162
 
98
- Recall uses deterministic SQLite FTS5 query planning and stable lexical
99
- reranking. It does not require or download an embedding model. The default
100
- database is `~/.xuanling/memory.db`; use `--memory-db <PATH>` to override it.
163
+ Export writes a versioned JSONL stream, import validates the complete stream
164
+ before one transactional write, and `rebuild-index` never changes canonical
165
+ rows.
101
166
 
102
- ## Server Options
167
+ ### Server options
103
168
 
104
169
  ```text
105
- --base-dir <PATH> Relative-path resolution context
106
- --workspace-root <PATH> Repeatable read/write capability root
170
+ --base-dir <PATH> Base directory for relative tool paths (not a sandbox)
171
+ --workspace-root <PATH> Repeatable read/write/delete capability root
107
172
  --read-root <PATH> Repeatable read-only capability root
108
- --memory-db <PATH> Shared SQLite memory database
109
- --default-namespace <VALUE> Default memory namespace
173
+ --memory-db <PATH> Shared SQLite memory database (default: ~/.xuanling/memory.db)
174
+ --default-namespace <VALUE> Namespace used when a memory request omits one
110
175
  --sqlite-busy-timeout-ms <NUMBER> SQLite busy timeout (default: 5000)
111
176
  --tool-profile <PROFILE> Repeatable tool group; default: all
112
- --compat-lenient-object-params Opt-in compatibility for affected hosts
177
+ --compat-lenient-object-params Opt-in compatibility for hosts that stringify object parameters
113
178
  ```
114
179
 
115
- ## Source and Documentation
180
+ `xuanling-mcp memory export|import|rebuild-index` are maintenance subcommands;
181
+ they do not start a stdio server session.
182
+
183
+ ## How it works
184
+
185
+ - The npm package is a Node.js launcher. It resolves the platform-specific
186
+ native package, validates its version metadata and binary SHA-256, then
187
+ forwards argv, stdio, signals, and exit status to the native server.
188
+ - The native server speaks MCP over stdin/stdout only. It opens no network
189
+ listener and makes no remote calls.
190
+ - The tool catalog is static for the lifetime of the server process.
191
+ `tools/list` is paginated with opaque cursors, and the host must follow
192
+ `nextCursor` until it is absent.
193
+ - Memory is a local SQLite database. It is opened lazily, and recall performs no
194
+ network access.
195
+
196
+ ## Compatibility and limits
197
+
198
+ - Supported npm targets are macOS Apple Silicon, Linux x64 with glibc 2.35 or
199
+ newer, and Windows x64 MSVC. Intel macOS, ARM Linux, glibc 2.34 or older,
200
+ musl Linux, and ARM Windows are not published.
201
+ - Supported MCP protocol revisions are `2024-11-05`, `2025-03-26`,
202
+ `2025-06-18`, and `2025-11-25`.
203
+ - The native binaries in 0.7.0 are not Developer ID or Authenticode signed.
204
+ npm provenance and the launcher's SHA-256 check provide the package integrity
205
+ contract.
206
+ - The filesystem capability is not an OS sandbox for processes started by
207
+ XuanLing tools.
208
+ - The catalog does not change during a server process, and the server does not
209
+ advertise `tools.listChanged`. Restart the server to change profiles or
210
+ catalog configuration.
211
+ - Memory is a single local SQLite database per server process. It requires a
212
+ writable database path or a resolvable `HOME`/`USERPROFILE`.
213
+ - The server uses stdio transport only; there is no HTTP or remote mode.
214
+
215
+ ## Troubleshooting
216
+
217
+ | Symptom | Cause and fix |
218
+ | --- | --- |
219
+ | `Unsupported platform: <os>/<arch>` | The target is not published. Use macOS Apple Silicon, Linux x64 with glibc 2.35 or newer, or Windows x64. |
220
+ | `Unsupported Linux libc` or `Unsupported Linux glibc` | XuanLing publishes a glibc build only and requires glibc 2.35 or newer. |
221
+ | `Missing optional dependency` or `Native binary checksum mismatch` | Reinstall the pinned version, for example `npm install --global @xuanling-rs/xuanling-mcp@0.7.0`. Published npm versions are immutable. |
222
+ | Memory tools report `memory store unavailable` or `cannot resolve the default memory DB path` | Pass an explicit writable `--memory-db <PATH>`, or set `HOME`/`USERPROFILE` so the default `~/.xuanling/memory.db` can be resolved. Non-memory tools keep working. |
223
+ | The host sees fewer tools than expected | A `--tool-profile` selection is active. Combine profiles or use `--tool-profile all`, then restart the server process. |
224
+ | The host exits before `initialize` | Check the Node.js version (18.17 or newer) and the host's stdio launch configuration. |
225
+
226
+ ## Links
116
227
 
117
228
  - Source: <https://github.com/umbrella22/xuanling>
118
- - Integration guide: <https://github.com/umbrella22/xuanling/blob/main/docs/guides/xuanling-mcp-integration.md>
119
- - DeepSeek Harness integration: <https://github.com/umbrella22/xuanling/tree/main/integrations/deepseek-harness>
229
+ - Product documentation: <https://github.com/umbrella22/xuanling/blob/main/README.md>
230
+ - DeepSeek Harness integration: <https://github.com/umbrella22/xuanling/blob/main/integrations/deepseek-harness/README.md>
231
+ - Changelog: <https://github.com/umbrella22/xuanling/blob/main/CHANGELOG.md>
120
232
  - Issues: <https://github.com/umbrella22/xuanling/issues>
233
+ - npm package: <https://www.npmjs.com/package/@xuanling-rs/xuanling-mcp>
121
234
 
122
235
  Licensed under the [MIT License](LICENSE).
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xuanling-rs/xuanling-mcp",
3
- "version": "0.6.0",
3
+ "version": "0.7.0",
4
4
  "description": "Cross-platform stdio MCP server for XuanLing typed filesystem, process, project, artifact, session, and memory tools.",
5
5
  "license": "MIT",
6
6
  "author": "umbrella22 and XuanLing contributors",
@@ -35,9 +35,9 @@
35
35
  "directory": "npm/packages/xuanling-mcp"
36
36
  },
37
37
  "optionalDependencies": {
38
- "xuanling-mcp-darwin-arm64": "npm:@xuanling-rs/xuanling-mcp-darwin-arm64@0.6.0-darwin-arm64",
39
- "xuanling-mcp-linux-x64-gnu": "npm:@xuanling-rs/xuanling-mcp-linux-x64-gnu@0.6.0-linux-x64-gnu",
40
- "xuanling-mcp-win32-x64-msvc": "npm:@xuanling-rs/xuanling-mcp-win32-x64-msvc@0.6.0-win32-x64-msvc"
38
+ "xuanling-mcp-darwin-arm64": "npm:@xuanling-rs/xuanling-mcp-darwin-arm64@0.7.0-darwin-arm64",
39
+ "xuanling-mcp-linux-x64-gnu": "npm:@xuanling-rs/xuanling-mcp-linux-x64-gnu@0.7.0-linux-x64-gnu",
40
+ "xuanling-mcp-win32-x64-msvc": "npm:@xuanling-rs/xuanling-mcp-win32-x64-msvc@0.7.0-win32-x64-msvc"
41
41
  },
42
42
  "publishConfig": {
43
43
  "access": "public",
@@ -45,6 +45,6 @@
45
45
  "registry": "https://registry.npmjs.org"
46
46
  },
47
47
  "xuanlingRelease": {
48
- "sourceCommit": "1aecd89c696404d6d4c0e9e6e0ad92ad94f33efe"
48
+ "sourceCommit": "c95f1e8fa6b744b479a6ffc48839ff90151389f5"
49
49
  }
50
50
  }