xmark-mcp
v1.0.3Model Context Protocol (MCP) server for XMark bookmark manager
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
list_bookmarks
获取项目所有书签或按分组筛选书签,可附带检测代码漂移状态
| Parameter | Type | Description |
|---|---|---|
checkDrift | boolean | 可选:是否同时比对磁盘代码检测代码漂移 (默认 false) |
groupId | string | 可选:指定筛选的分组 ID,如不提供则返回全部 |
add_bookmark
在指定代码文件和行号添加书签,自动读取目标代码行内容、计算 16 位短哈希与 Git 提交,并安全原子落盘
| Parameter | Type | Description |
|---|---|---|
filePath * | string | 目标代码文件相对路径 (统一使用正斜杠 /,如 src/index.ts) |
line * | integer | 目标行号 (从 1 开始的正整数) |
groupId | string | 可选:所属分组 ID,缺省加入 default 默认分组 |
groupName | string | 可选:所属分组名称 (若不存在将自动创建该分组) |
name | string | 可选:书签显示标题,缺省默认为 "filePath:line" |
update_bookmark
更新已有书签信息 (名称、行号、所属分组),支持在代码重构行号位移后自动重算短哈希
| Parameter | Type | Description |
|---|---|---|
id * | string | 书签唯一 ID |
groupId | string | 可选:移动到的目标分组 ID |
line | integer | 可选:更新后的行号 (1-based) |
name | string | 可选:更新后的书签名 |
refreshHash | boolean | 可选:是否按照当前磁盘代码行内容刷新 lineHash 解决漂移 (默认自动推断) |
delete_bookmark
按书签唯一 ID 删除书签
| Parameter | Type | Description |
|---|---|---|
id * | string | 待删除的书签 ID |
list_groups
获取当前所有书签分组及各组内包含的书签数量
create_group
创建新的书签分组 (分组 ID 由系统统一自动生成)
| Parameter | Type | Description |
|---|---|---|
name * | string | 分组显示名称 |
update_group
通过分组 ID 更新分组名称
| Parameter | Type | Description |
|---|---|---|
id * | string | 待更新的分组 ID |
name * | string | 更新后的分组名称 (不能为空) |
delete_group
删除指定分组 (注:默认分组 default 受保护不可删除,删除其他组时其内书签将自动归入 default 分组)
| Parameter | Type | Description |
|---|---|---|
id * | string | 待删除的分组 ID (不能是 default) |
get_drift_status
精准检查指定书签是否存在代码漂移 (对比 lineHash 与磁盘当前行内容的 16 位短哈希)
| Parameter | Type | Description |
|---|---|---|
id * | string | 书签 ID |
get_bookmark_by_location
按文件路径与行号高性能查找对应书签 (O(1) 索引查询)
| Parameter | Type | Description |
|---|---|---|
filePath * | string | 代码文件相对路径或绝对路径 (如 src/index.ts) |
line * | integer | 代码行号 (1-based) |
search_by_name
按名称模糊查找书签或分组 (高性能原生子串匹配,支持类型筛选)
| Parameter | Type | Description |
|---|---|---|
query * | string | 搜索名称关键词 (大小写不敏感模糊匹配) |
target | string | 可选:搜索范围,可选 all(默认) | bookmark | group |
get_by_id
按唯一 ID 高性能查找书签或分组 (O(1) 索引查询)
| Parameter | Type | Description |
|---|---|---|
id * | string | 待查找的书签 ID 或分组 ID |