Repository navigation
Conversation
support validate/add/remove/sync/show/status/invoke/list/find mcp server.
support ov mcps mount/unmount/mounts and ov read live context node.
# Conflicts: # docs/en/guides/06-mcp-integration.md # docs/zh/guides/06-mcp-integration.md # openviking/server/mcp_endpoint.py
feat: vikingbot support mcps find and invoke. fix(studio): fix arrange studio. support get live context content. feat: add doc for live context arrangement.
# Conflicts: # docs/.vitepress/theme/docs-sections.ts # openviking/server/mcp_endpoint.py # sdk/go/types.go # web-studio/src/i18n/locales/en.ts # web-studio/src/i18n/locales/zh-CN.ts # web-studio/src/routeTree.gen.ts
|
Hi @vikinglbx, this PR currently has merge conflicts with |
fix(bot): distinguish mcp of openviking mcp interface、openviking registered mcp server、vikingbot connected mcp server.
# Conflicts: # web-studio/src/i18n/locales/en.ts # web-studio/src/i18n/locales/zh-CN.ts
qin-ctx
left a comment
There was a problem hiding this comment.
这套 MCP 和实时上下文能力有实际价值,但当前版本暂不建议合入。新增接口存在网络访问和私有节点信息越权,动态读取绕过已有只读能力限制,Studio 同路径移动会删除节点;Studio 构建及安装包的 SDK 依赖也需要修正。
本次提交 9 条行级评论:6 项 blocking、3 项 non-blocking。非阻塞问题涉及挂载状态的存储读写成本、工具定义同步和编辑时的配置保留。
| "tool": row["tool_name"], | ||
| "tool_uri": row["tool_uri"], | ||
| "revision": row["revision"], | ||
| "arguments": json.loads(row["args_json"]), |
There was a problem hiding this comment.
[Bug] (blocking)
Alice 将实时节点挂载到自己的私有目录后,同账号的 Bob 通过 GET /api/v1/mcps/mounts?mcp=demo 能拿到该节点的 URI 和完整预置参数,即使他无权读取节点。
已通过正常 mount 操作创建 viking://user/alice/resources/private.md 并隔离复现:Bob 直接读取被拒绝,挂载列表接口却返回 200 和 Alice 的私有参数。这里直接读取账号数据库中的全部匹配记录,没有检查调用方对节点的访问权限。挂载列表以及 sync 的受影响节点报告,都需要在返回信息前遵守节点可见范围;账号隔离不能替代用户和 ACL 隔离。
| limit=limit, | ||
| ) | ||
| if offset == 0 and limit == -1: | ||
| result = await service.mcps.read_live_context(content, ctx) |
There was a problem hiding this comment.
[Bug] (blocking)
读取实时节点现在可以执行有副作用的上游工具,但 MCP read 仍声明 readOnlyHint=true、destructiveHint=false、idempotentHint=true、openWorldHint=false。同样的 REST 读取行为还会被 VikingBot 的 openviking_multi_read 使用:READONLY 模式及 Studio 受管群聊虽然排除了显式 MCP 调用,仍允许这个读取工具,因此可以绕过原有能力限制。
对同一描述文件和 read 请求做 base/Head 对照,base 返回原文且没有上游调用,Head 则执行绑定工具一次;复现中的上游操作使用了无害记录器。当前没有检查绑定工具是否只读。动态读取可以保留,但合并前必须守住已有只读与群聊能力边界,并准确声明执行副作用。
|
|
||
| async def find_mcp_tools(self, query: str, limit: int = 10) -> Dict[str, Any]: | ||
| """Discover OpenViking-managed MCP tools with complete definitions.""" | ||
| return await self.client.find_mcp_tools(query, limit=limit) |
There was a problem hiding this comment.
[Bug] (blocking)
使用当前依赖范围允许的 SDK 版本安装 OpenViking 后,新增 VikingBot 工具会注册成功,但调用失败。主包仍接受 openviking-sdk>=0.1.15,锁文件选择的也是 0.1.15;该已发布版本没有 find_mcp_tools 和 invoke_mcp_tool,因此这里会在发出 HTTP 请求前报 AttributeError。
已直接检查 0.1.15 发布包确认。源码运行会由 _sdk_import 优先加载仓库内的 sdk/python,掩盖安装包场景,而主 wheel 并不包含这个源码目录。该集成发布时,依赖契约需要确保安装到已提供这两个方法的 SDK 版本。
| changed = sorted( | ||
| tool_name | ||
| for tool_name in existing_names & current_names | ||
| if existing_tools[tool_name]["revision"] != current_tools[tool_name]["revision"] |
There was a problem hiding this comment.
[Bug] (non-blocking)
上游只修改工具描述、annotations 或输出 schema 时,执行 sync 会报告工具未变化,并保留旧定义;后续 show、find 仍向 Agent 返回旧说明和能力信息。
当前 revision 有意只跟踪名称和 inputSchema,但这里又用同一个 revision 决定是否发布完整工具定义。模拟上游仅修改 description、inputSchema 不变时,实际待发布列表为空。保持挂载 revision 不变是合理取舍,但不应因此阻止工具定义本身更新。
| setName(source.name) | ||
| setToolUri(mount.tool_uri) | ||
| setServerName(mcpServerNameFromToolUri(mount.tool_uri) || mount.mcp) | ||
| setTitle(mount.title || nameFromVikingUri(source.uri)) |
There was a problem hiding this comment.
[Bug] (non-blocking)
用户打开“编辑挂载”,只修改工具参数再保存,也会把原有标题、描述、超时和标签覆盖成默认值。/mcps/mounts 没有返回这四个字段,编辑框却从该响应初始化为文件名、空描述、60 秒和空标签,随后 mount 请求会提交这些替换值。
已执行这里的初始化代码确认:原节点即使配置了自定义标题、描述和 120 秒超时,编辑框得到的仍是上述默认值。原描述文件中已有标题、描述和超时,但与复制、移动路径不同,编辑路径没有读取它。修改参数时应保留其他已有配置。
Description
Human Involvement
Related Issue
Type of Change
Changes Made
Testing
Checklist
Screenshots (if applicable)
Additional Notes