KineX · 开发者文档 · 03

本机 MCP 服务端与双向研究工作流

通过 Streamable HTTP(http://127.0.0.1:45129/mcp)连接本地桌面 IDE 与终端 AI 助手,安全读取书籍摘录、一键导出整个主题的笔记精华,并将助手调研整理的阅读资料包直接导入工作区。

适用于 KineX 0.1.0-beta.8+(默认关闭 · 127.0.0.1 回环监听 · Bearer Token 鉴权 · 23 个内置 MCP 工具)

章节导航 · 03 本机 MCP 与研究工作流
  1. 01插件生态与开放能力总览
  2. 02Plugin API v1.2 接口手册
  3. 03本机 MCP 与研究工作流
← 返回用户手册

01一键连接 11 款助手 + TRAE / Zed 等通用 HTTP 客户端

在设置 -> AI 与 Agent 下启用本机 MCP 服务并一键写入外部助手配置

在 设置 → AI 与 Agent → 连接本机外部 AI 客户端与桌面中继 中开启服务开关、管理独立客户端令牌(read-only / read-propose / trusted-direct),并对本机助手一键写入配置或复制标准 Streamable HTTP 片段。

接入特性 工程规格
监听地址 仅绑定本机回环 http://127.0.0.1:45129/mcp(Streamable HTTP JSON-RPC 2.0),校验 Host / Origin
原生一键支持(11 款) 5 款桌面 IDE / GUI(Cursor、Claude Desktop、VS Code、Windsurf、Antigravity) + 6 款终端 CLI Agent(Claude Code、Codex CLI、Gemini CLI、OpenCode、OpenClaw、Hermes Agent),自动备份原配置(*.kinex.bak)后无损写入
通用 Streamable HTTP 客户端 支持 TRAE、Cherry Studio、Zed、Cline、Roo Code 等标准 MCP 客户端直接粘贴 URL 与独立 Bearer Token;配合 clipboard-only 预置可随时跨工具粘贴口令
权限与凭据隔离 每个注册客户端持有独立 Bearer Token(存入系统 Keychain),可单独降权、禁用或吊销

原生一键配置客户端清单(11 款)

类型 客户端 默认配置文件路径 一键接入动作
桌面 IDE / GUI Cursor ~/.cursor/mcp.json 合并 JSON 配置 + Deep Link 授权 + 切窗前置
桌面 GUI Claude Desktop Windows %APPDATA%\Claude\claude_desktop_config.json
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
合并 JSON 配置(*.kinex.bak 自动备份)+ 切窗
桌面 IDE VS Code(Copilot MCP) Windows %APPDATA%\Code\User\mcp.json
macOS ~/Library/Application Support/Code/User/mcp.json
写入 servers JSON 配置 + vscode:mcp/install 链接
桌面 IDE Windsurf ~/.codeium/windsurf/mcp_config.json 合并 JSON 配置 + 自动切窗前置
桌面 IDE / Agent Antigravity ~/.gemini/config/mcp_config.json 合并 JSON 配置 + 自动切窗前置
终端 CLI Agent Claude Code ~/.claude.json 写入 JSON 配置 + 打开终端带入任务口令
终端 CLI Agent OpenAI Codex CLI ~/.codex/config.toml 写入 [mcp_servers.kinex] TOML + 打开终端带入任务
终端 CLI Agent Gemini CLI(Google) ~/.gemini/settings.json 写入 JSON 配置 + 打开终端(-i 交互参数)
终端 CLI Agent OpenCode ~/.config/opencode/opencode.json 写入 mcp.kinex 远程 HTTP 配置 + --prompt 启动
终端 CLI Agent OpenClaw ~/.openclaw/openclaw.json 写入 JSON 配置 + 执行 agent --message
终端 CLI Agent Hermes Agent(NousResearch) ~/.hermes/config.yaml 写入 YAML mcp_servers.kinex + 执行 chat -q

TRAE / Cherry Studio / Zed / Cline 等通用 Streamable HTTP 配置

所有尚未列入自动探测列表、但支持标准 Streamable HTTP MCP 的助手,均可在其 MCP 设置页粘贴以下 JSON(将 <TOKEN> 替换为在 设置 → AI 与 Agent 签发的专属令牌):

{
  "mcpServers": {
    "kinex": {
      "type": "streamable-http",
      "url": "http://127.0.0.1:45129/mcp",
      "headers": {
        "Authorization": "Bearer <TOKEN>"
      }
    }
  }
}

三档客户端权限分级

权限枚举 允许的操作范围 适用场景
read-only 调用所有读取与精华导出工具(kinex_export_theme_digest 等);拦截任何写操作 跨书检索、综述写作、导出笔记至 Obsidian / Notion
read-propose (默认) 读取工作区上下文,并将助手生成的卡片、闪卡、外挂章节与调研资料包写入 AI 收件箱 等待确认 与 Cursor / Claude Code / Codex / TRAE 日常研究协作
trusted-direct 仅显式授予高信任的本地自动化客户端,允许直接触发宿主写回回调(仍物理隔离 .kxa 防剧透仓与密钥链) 个人可信脚本自动化整理

02两步极速协作与 AI 收件箱闭环

在 AI 研学面板推送任务至本机 MCP,并在 AI 收件箱核验锚点后一键应用

  1. 在 KineX 点击 AI 研学顶栏 推送至 MCP,选择 本章 / 整书 / 多材料 范围与预设任务并复制口令;
  2. 外部助手调用 kinex_get_active_dispatch 获取打包好的正文(untrustedSourceText)与提交模板(submitTemplate),生成后通过 kinex_submit_dispatch_result 一次性提交;
  3. 在 KineX AI 收件箱 查看每条引证的自动原文核验徽标,点击 应用 落盘(白板新增自动避让现有卡片且支持 Ctrl+Z 撤销)。

AI 收件箱展示按书籍与章节分组的待确认提案及锚点核验角标

03主题精华导出与调研资料包导入 (v1.2 双向工作流)

相比简单的单文件导入,MCP 在「把 KineX 内积累的知识喂给助手深加工,再把调研成果干净落回阅读主题」的双向流程中价值最高:

一键导出主题知识精华(kinex_export_theme_digest · read-only)

助手一次调用即可把指定阅读主题内的材料清单、高亮摘录(含笔记批注与出处定位)、白板知识卡片和 FSRS 闪卡题面汇总为完整 Markdown 或 JSON 精华包(绝不泄露未作答 .kxa 题库答案),方便直接撰写文献综述或写入 Obsidian/学术报告:

{
  "jsonrpc": "2.0",
  "id": 101,
  "method": "tools/call",
  "params": {
    "name": "kinex_export_theme_digest",
    "arguments": {
      "themeId": "theme-cognitive-science",
      "format": "markdown",
      "includeHighlights": true,
      "includeWhiteboard": true,
      "includeFlashcards": true
    }
  }
}

将外部调研资料包推送进 KineX 精读(kinex_propose_study_pack · read-propose)

当你的 AI 助手在外部检索了多篇博客、论文或文档并整理出清晰阅读包时,可直接以 markdown / txt / html 格式连同目录层级(folderPath)、来源链接(sourceUrl)、标签及关联学习路线节点一次性推送至 AI 收件箱,点击 应用 即刻成为 KineX 阅读材料(单次最多 30 份):

{
  "jsonrpc": "2.0",
  "id": 102,
  "method": "tools/call",
  "params": {
    "name": "kinex_propose_study_pack",
    "arguments": {
      "themeId": "theme-cognitive-science",
      "summaryLabel": "导入双系统理论本周调研资料 2 篇",
      "items": [
        {
          "title": "System 1 vs System 2 综述精要",
          "format": "markdown",
          "folderPath": ["前沿调研", "第 2 周"],
          "author": "Research Agent",
          "sourceUrl": "https://plato.stanford.edu/entries/bounded-rationality/",
          "tags": ["认知心理学", "决策"],
          "content": "# 核心分歧与实验证据\n\n- 启发性判断在时间压力下的偏差机制……"
        }
      ]
    }
  }
}

安全校验拦截线(错误码 -32003)

  • 资料包与资源接口物理拒绝任何 .. 路径穿越、控制字符、javascript: / data: 危险协议及禁止脚本/凭证路径(.env / .ssh / .pem / .exe / .ps1 等);
  • 单篇内容上限 150 万字符,超限或非法域名将在协议入口直接阻断。

04全部 23 个内置 MCP 工具完整清单

分组 工具名称 权限要求 参数要点与核心职责
派发与上下文 (2) kinex_get_active_dispatch 只读 [dispatchId?] 获取「推送至 MCP」打包的原文、高亮与精确回写模板 submitTemplate
kinex_get_current_context 只读 获取当前打开的主题 ID、活跃材料、章节与阅读位置
读取与知识导出 (10) kinex_list_themes 只读 列出工作区所有阅读主题与材料数
kinex_list_materials 只读 [themeId?] 列出主题下的文档、音视频材料列表
kinex_get_outline 只读 { materialId } 读取文档目录树或音视频分段章节
kinex_read_units 只读 { materialId, chapterId?, cursor?, maxTokens?, clientContextCeilingTokens? } 按游标输出紧凑原文流(单次最高 160K Tokens,接近 80% 提示防压缩预警)
kinex_search 只读 { query, materialIds?, limit? } 跨材料检索段落片段并返回 unitId
kinex_get_whiteboard_cards 只读 [themeId?] 读取白板卡片位置与父子/关联边
kinex_get_highlights 只读 [materialId?] 读取材料高亮与批注引证
kinex_list_flashcards 只读 [themeId?] 读取 FSRS 闪卡题面与出处锚点
kinex_get_chat_context 只读 { sessionId, includePinnedContext?, sinceMessageId?, lastN?, maxChars? } 读取 AI 对话增量上下文
kinex_export_theme_digest (v1.2) 只读 { themeId, format?, includeMaterials?, includeHighlights?, includeWhiteboard?, includeFlashcards? } 一键导出主题笔记精华(Markdown / JSON)
导航与收件箱提案 (5) kinex_navigate_to_anchor 只读+联动 { materialId, unitId?, pageNumber?, timeSec? } 令阅读器高亮跳转定位到指定锚点
kinex_propose_board_cards read-propose { summaryLabel, nodes, edges?, materialIds?, themeId? } 提交白板卡片树(强制原文核验)
kinex_propose_flashcards read-propose { materialId, items, themeId?, materialTitle?, summaryLabel? } 提交 FSRS 记忆闪卡
kinex_propose_chapters read-propose { materialId, items, materialCategory? } 提交无损外挂章节目录
kinex_propose_study_pack (v1.2) read-propose { items, themeId?, summaryLabel? } 推送结构化调研资料包(带目录层级/标签/来源链接)进 AI 收件箱
派发回写与路线 (6) kinex_submit_dispatch_result read-propose { dispatchId, proposalType, payload, summaryLabel? } 提交 study-bundle / study-guide / study-quiz / study-qa / study-summary / study-thematic 等 10 种结果
kinex_append_chat_reply 受控写回 { sessionId, content, thinkingText? } 将结论追加回指定 AI 对话
kinex_roadmap_get 只读 [roadmapId?, themeId?] 读取学习路线 DAG 节点与拓扑依赖
kinex_roadmap_next 只读 [roadmapId?, themeId?, limit?] 查询前置依赖已满足的可学下一步节点
kinex_roadmap_update_status 受控写回 { nodeId, status, roadmapId?, skipReason?, masteryPoints? } 更新节点掌握状态或评分
kinex_roadmap_add_resource 受控写回 { nodeId, title, url?, materialId?, resourceType? } 绑定经过域名校验的学习资料

KineX · Developers · 03

Local MCP Server & Bidirectional Study Workflows

Connect desktop IDEs and CLI AI agents via Streamable HTTP (http://127.0.0.1:45129/mcp) to query source passages, export structured theme digests in one call, and push curated Markdown/HTML research packs straight into KineX through the AI Inbox.

Built for KineX 0.1.0-beta.8+ (Opt-in · Loopback 127.0.0.1 · Per-client Bearer auth · 23 built-in tools)

Chapters · 03 Local MCP & Study Workflows
  1. 01Plugins & Ecosystem Overview
  2. 02Plugin API v1.2 Reference
  3. 03Local MCP & Study Workflows
← Back to User Guide

01One-Click Setup for 11 Clients + Universal HTTP Clients (TRAE, Zed, etc.)

Enable KineX local MCP server and configure desktop assistants under Settings -> AI & Agent

Enable the endpoint under Settings → AI & Agent → Connect Local External AI Clients & Relay, choose client permission tiers (read-only / read-propose / trusted-direct), and auto-configure desktop assistants or copy the Streamable HTTP snippet.

Property Specification
Endpoint Binds strictly to http://127.0.0.1:45129/mcp (Streamable HTTP JSON-RPC 2.0) with strict Host/Origin guards
Native One-Click Setup (11 Clients) 5 desktop IDEs/GUIs (Cursor, Claude Desktop, VS Code, Windsurf, Antigravity) and 6 CLI Agents (Claude Code, Codex CLI, Gemini CLI, OpenCode, OpenClaw, Hermes Agent) with lossless merging and *.kinex.bak backups
Universal Streamable HTTP TRAE, Cherry Studio, Zed, Cline, Roo Code, and custom MCP runners connect via HTTP URL + Bearer token snippet (clipboard-only supported too)
Per-Client Tokens Isolated OS-keychain Bearer Tokens per assistant; revocable or permission-scoped anytime

Native One-Click Clients (11 Integrations)

Type Client Config Path One-Click Action
Desktop IDE / GUI Cursor ~/.cursor/mcp.json JSON merge + Deep Link + focus window
Desktop GUI Claude Desktop Win %APPDATA%\Claude\claude_desktop_config.json
macOS ~/Library/Application Support/Claude/claude_desktop_config.json
JSON merge (*.kinex.bak) + focus window
Desktop IDE VS Code (Copilot MCP) Win %APPDATA%\Code\User\mcp.json
macOS ~/Library/Application Support/Code/User/mcp.json
servers JSON merge + vscode:mcp/install
Desktop IDE Windsurf ~/.codeium/windsurf/mcp_config.json JSON merge + focus window
Desktop IDE / Agent Antigravity ~/.gemini/config/mcp_config.json JSON merge + focus window
CLI Agent Claude Code ~/.claude.json JSON config + spawn terminal prompt
CLI Agent OpenAI Codex CLI ~/.codex/config.toml [mcp_servers.kinex] TOML + spawn terminal
CLI Agent Gemini CLI (Google) ~/.gemini/settings.json JSON config + spawn terminal (-i)
CLI Agent OpenCode ~/.config/opencode/opencode.json mcp.kinex HTTP config + --prompt
CLI Agent OpenClaw ~/.openclaw/openclaw.json JSON config + agent --message
CLI Agent Hermes Agent (NousResearch) ~/.hermes/config.yaml YAML mcp_servers.kinex + chat -q

TRAE, Cherry Studio, Zed, Cline & Custom HTTP Clients

{
  "mcpServers": {
    "kinex": {
      "type": "streamable-http",
      "url": "http://127.0.0.1:45129/mcp",
      "headers": {
        "Authorization": "Bearer <Token copied from Settings -> AI & Agent>"
      }
    }
  }
}

Permission Tiers

Permission Scope Granted Recommended For
read-only All read tools + kinex_export_theme_digest; blocks writes and proposals Literature search, synthesis writing, and exporting digests to Obsidian
read-propose (Default) Full workspace reads + staged proposals (whiteboards, flashcards, external chapters, study packs) via AI Inbox review Daily collaboration with Cursor, Claude Code, Codex, or TRAE
trusted-direct Explicit high-trust automations that invoke direct host write callbacks (.kxa vaults & keychains remain physically blocked) User-approved local automation scripts

02Two-Step Dispatch & AI Inbox Safety Loop

Dispatch study tasks to Local MCP from AI Study and review proposals inside AI Inbox

  1. Click Push to Local MCP inside AI Study, choose Chapter / Whole book / Multi-material, and copy the 2-step prompt;
  2. Your assistant calls kinex_get_active_dispatch for packaged source passages (untrustedSourceText) and exact submitTemplate, then submits results via kinex_submit_dispatch_result;
  3. Review citation verification badges in AI Inbox and click Apply (board updates avoid existing cards and support Ctrl+Z undo).

AI Inbox showing pending proposals grouped by book and chapter with anchor audit counts

03Theme Digest Export & Curated Study Packs (v1.2 Workflows)

One-Call Theme Synthesis Export (kinex_export_theme_digest · read-only)

Pull a clean Markdown or JSON digest across an entire reading theme—materials inventory, highlights with comments, whiteboard hierarchy, and flashcard prompts—while physically excluding encrypted .kxa answer keys:

{
  "jsonrpc": "2.0",
  "id": 101,
  "method": "tools/call",
  "params": {
    "name": "kinex_export_theme_digest",
    "arguments": {
      "themeId": "theme-cognitive-science",
      "format": "markdown",
      "includeHighlights": true,
      "includeWhiteboard": true,
      "includeFlashcards": true
    }
  }
}

Propose Curated Study Packs (kinex_propose_study_pack · read-propose)

When an external agent finishes researching web articles, papers, or structured briefings, it can push up to 30 formatted documents (markdown / txt / html, nested folderPath, YAML frontmatter tags/sourceUrl, optional bindRoadmapNodeId) into AI Inbox. Clicking Apply imports real readable documents directly into your Reading Theme:

{
  "jsonrpc": "2.0",
  "id": 102,
  "method": "tools/call",
  "params": {
    "name": "kinex_propose_study_pack",
    "arguments": {
      "themeId": "theme-cognitive-science",
      "summaryLabel": "Import 2 Week-2 Research Briefs",
      "items": [
        {
          "title": "Dual-Process Literature Synthesis",
          "format": "markdown",
          "folderPath": ["Research Briefs", "Week 2"],
          "author": "Research Agent",
          "sourceUrl": "https://plato.stanford.edu/entries/bounded-rationality/",
          "tags": ["cognitive-science", "decision-making"],
          "content": "# Key Experimental Findings\n\n- Heuristic judgment under time constraints..."
        }
      ]
    }
  }
}

Security Rejections (-32003)

  • Rejects .. path traversal segments, control characters, unsafe URI schemes (javascript:, data:), and dotfiles/executables (.env, .pem, .exe, .ps1, .sh);
  • Caps inline content at 1.5M chars per study pack item (30 items max per call).

04Complete Catalog of All 23 Built-In MCP Tools

Category Tool Name Access Arguments & Role
Dispatch & Context (2) kinex_get_active_dispatch Read [dispatchId?] Active task envelope, packaged text (untrustedSourceText), highlights & submitTemplate
kinex_get_current_context Read Current open theme, active material, chapter & scroll/time location
Structured Read & Export (10) kinex_list_themes Read List workspace reading themes & material counts
kinex_list_materials Read [themeId?] List documents and media in a theme
kinex_get_outline Read { materialId } Table of contents or media chapter markers
kinex_read_units Read { materialId, chapterId?, cursor?, maxTokens?, clientContextCeilingTokens? } Lossless paged text stream (up to 160K tokens/call; 80% compaction warning)
kinex_search Read { query, materialIds?, limit? } Fast keyword search returning unit IDs & snippets
kinex_get_whiteboard_cards Read [themeId?] Whiteboard node hierarchy & edges
kinex_get_highlights Read [materialId?] Reader highlights & notes
kinex_list_flashcards Read [themeId?] FSRS flashcards & source anchors
kinex_get_chat_context Read { sessionId, includePinnedContext?, sinceMessageId?, lastN?, maxChars? } Incremental AI Chat thread cursor
kinex_export_theme_digest (v1.2) Read { themeId, format?, includeMaterials?, includeHighlights?, includeWhiteboard?, includeFlashcards? } Full-theme Markdown/JSON knowledge digest export
Navigation & Proposals (5) kinex_navigate_to_anchor Read/UI { materialId, unitId?, pageNumber?, timeSec? } Jump KineX reader directly to page or timestamp
kinex_propose_board_cards read-propose { summaryLabel, nodes, edges?, materialIds?, themeId? } Propose grounded whiteboard trees
kinex_propose_flashcards read-propose { materialId, items, themeId?, materialTitle?, summaryLabel? } Propose FSRS flashcards
kinex_propose_chapters read-propose { materialId, items, materialCategory? } Propose non-invasive external chapters
kinex_propose_study_pack (v1.2) read-propose { items, themeId?, summaryLabel? } Propose curated Markdown/TXT/HTML research packs via AI Inbox
Dispatch, Chat & Roadmap (6) kinex_submit_dispatch_result read-propose { dispatchId, proposalType, payload, summaryLabel? } Submit structured result for 10 proposal types
kinex_append_chat_reply Controlled write { sessionId, content, thinkingText? } Append an external assistant reply into an AI Chat session
kinex_roadmap_get Read [roadmapId?, themeId?] Inspect roadmap graph nodes & prerequisite edges
kinex_roadmap_next Read [roadmapId?, themeId?, limit?] Query unlocked next nodes with satisfied prerequisites
kinex_roadmap_update_status Controlled write { nodeId, status, roadmapId?, skipReason?, masteryPoints? } Update mastery status & quiz score
kinex_roadmap_add_resource Controlled write { nodeId, title, url?, materialId?, resourceType? } Attach validated study resources to a node