feat(mcp-hub): 精选连接——一键接入 Obsidian(Local REST API)#180
Open
Bsyy95 wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
Obsidian 是使用最广泛的本地知识库工具之一。这个 PR 让 LiveAgent 支持"一键连接 Obsidian":在 MCP Hub 的 Store 视图新增「精选连接」区,内置 Obsidian 连接卡片,填入 Local REST API 插件的 API Key 即可把 Obsidian 笔记库接入对话——读写笔记、全文检索、追加内容、管理 Vault 文件,工具以
mcp_obsidian_*形式自动暴露给模型。实现方式
完全沿用现有 MCP 基础设施,不新增网络请求,不触碰 Rust / Go 端:
lib/mcpRegistry/featured.ts(GUI/WebUI 字节级镜像,已登记进 mirror-manifest):本地内置的精选安装草稿。Obsidian 卡片生成uvx mcp-obsidian的 stdio server 草稿——OBSIDIAN_API_KEY为必填 secret(密码输入框)、OBSIDIAN_HOST/OBSIDIAN_PORT预填127.0.0.1/27124可改,OBSIDIAN_PROTOCOL=https与 Local REST API 插件默认监听一致(env 在进程启动时注入,host/port/protocol 预填即生效)。McpRegistrySource联合类型增加"featured":仅作卡片来源标识,不进入searchMcpRegistry的任何搜索分支。McpRegistryBrowser(双端)在 Store 结果区顶部渲染「精选连接」:仅在搜索框为空时展示,不挤占搜索结果;卡片复用现有RegistryCard→needs_config→ 配置弹窗 →applyMcpRegistryInstallConfig安装链路,必填校验、id 去重(冲突自动obsidian-2)、"已添加"状态与 Store 卡片行为完全一致。settings.mcp.servers,走既有持久化与网关设置同步路径,启用后动态工具自动进入对话。为什么走 MCP 预置而不是原生内置工具
mcp-obsidian(对接 Local REST API 插件)是社区事实标准,读写 / 检索 / 追加 / 批量列举能力完整。使用前提(已通过卡片「警告」与配置项说明展示给用户)
uvx(uv)——与 Store 中其它 pypi 类条目的前提一致。变更清单
crates/agent-gui/src/lib/mcpRegistry/featured.ts及 WebUI 镜像副本crates/{agent-gui,agent-gateway/web}/src/lib/mcpRegistry/index.ts:source 联合类型扩展 + re-export(保持字节一致)crates/{agent-gui,agent-gateway/web}/src/pages/mcp-hub/McpRegistryBrowser.tsx:精选连接区crates/{agent-gui,agent-gateway/web}/src/i18n/config.ts:中英文词条各 9 条scripts/mirror-manifest.json:登记lib/mcpRegistry/featured.tscrates/agent-gui/test/tools/mcp-registry.test.mjs:新增 2 个用例(草稿形状校验 / 配置应用后启用与保留预填值)docs/features/skills-and-mcp.md:MCP Registry 来源表补充 featured 行验证
pnpm build/pnpm lint/pnpm test:frontend(1068 全部通过,含新增 2 例)pnpm build/pnpm lint/pnpm test(367 全部通过)node scripts/check-mirror.mjs(88 个镜像文件全部一致)git diff --check无尾随空白Tauri Rust Check/Gateway门禁不受影响