Skip to content

feat: 添加 MCP 本地 AI 协作能力#2

Open
sunyonghuan wants to merge 3 commits into
dotnet9:mainfrom
sunyonghuan:main
Open

feat: 添加 MCP 本地 AI 协作能力#2
sunyonghuan wants to merge 3 commits into
dotnet9:mainfrom
sunyonghuan:main

Conversation

@sunyonghuan

Copy link
Copy Markdown

修改内容

  • 在帮助菜单中增加 MCP 设置入口和设置窗体,支持启用状态、监听地址、端口、授权 Token、访问范围和确认策略配置。
  • 新增本机 HttpListener MCP Server,支持 initializepingtools/listtools/call 等基础 JSON-RPC 调用。
  • 暴露当前文档读取、选区读取、大纲读取、文档编辑、保存、预览刷新、渲染 HTML 读取、应用状态读取、操作审计读取等工具。
  • 暴露基础界面操作工具,包括主题、排版、语言、布局、侧边栏页签、基础面板、常用编辑命令、导出和复制富 HTML。
  • 工具名使用 OpenAI function calling 兼容的下划线格式,例如 vex_get_current_document,并兼容旧的 vex.get_current_document 调用。
  • 新增 MCP 操作确认、内存审计和访问范围校验,避免 AI 任意读写磁盘。
  • 使用 System.Text.Json source generation 和手写工具分发,避免反射扫描工具方法,保持 Native AOT 兼容。
  • 补充 MCP 功能实现方案和 README 功能说明。

验证

  • dotnet build src\Vex\Vex.csproj -c Debug -f net10.0-windows --no-incremental
  • dotnet build Vex.slnx -c Release --no-incremental
  • dotnet publish src\Vex\Vex.csproj -c Release -f net10.0-windows -r win-x64 /p:PublishProfile=FolderProfile__win-x64

说明:构建和发布仍存在项目既有的 NU1507 包源映射警告,以及 Avalonia / Prism / ReactiveUI / DryIoc / Ursa 等依赖链的 Native AOT/trim 警告;新增 MCP 代码未引入反射式 JSON 序列化告警。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant