Skip to content

[Request] MCP tool support info tracing #3043

@SimengBian

Description

@SimengBian

Feature Description

MCP检索工具支持信息溯源。
┌─────────────────────────────────────────────────────────────────────────┐
│ 阶段 1: MCP 服务添加 │
└─────────────────────────────────────────────────────────────────────────┘
用户在前端添加 MCP 服务

├── 检索开关 OFF ──────────────────────────┐
│ │
└── 检索开关 ON ──► 发送测试检索请求 ──► MCP 服务

┌────────┴────────┐
│ │
返回结果 返回错误
│ │
▼ ▼
┌───────────┐ ┌───────────┐
│ 格式验证通过 │ │ 格式验证失败 │
│ │ │ │
│ 分配toolsign │ │ 提示错误 │
│ 存入 DB │ │ 不允许添加│
└───────────┘ └───────────┘
┌─────────────────────────────────────────────────────────────────────────┐
│ 阶段 2: Agent 运行 │
└─────────────────────────────────────────────────────────────────────────┘
Agent 调用 MCP 知识检索工具


┌─────────────────────────────┐
│ MCP 适配器 │
│ │
│ 1. 调用原始工具获取结果 │
│ 2. 解析结果 │
│ 3. 分配 cite_index (自增) │
│ 4. 标准化格式 │
│ 5. 发送 SEARCH_CONTENT │
│ (observer) │
│ 6. 返回给 LLM: │
│ [{"title": "...", │
│ "text": "...", │
│ "index": "l1"}] │
└─────────────────────────────┘


┌─────────────────────────────┐
│ LLM 生成回答 │
│ │
│ "根据文档 [[l1]] 的信息..." │
└─────────────────────────────┘


┌─────────────────────────────┐
│ 前端渲染 │
│ │
│ 解析 [[l1]] │
│ 匹配 searchResults │
│ 显示 CitationBadge + Tooltip │
└─────────────────────────────┘

Proposed Solution

No response

Additional Information

No response

Metadata

Metadata

Assignees

Labels

LowLow priority
No fields configured for Feature.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions