KineX · 开发者文档 · 01

插件与开放生态

通过 Plugin API v1.2 与 内置 MCP 服务端,在最小权限保护下扩展 KineX 的阅读主题、语音朗读引擎、划词词典、AI 检索、笔记导出与外部助手协同能力。

适用于 KineX 0.1.0-beta.8+(Plugin API 1.2 · Streamable HTTP MCP · 23 个内置工具)

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

01架构概览与扩展能力

KineX 提供 插件系统(Plugin API v1.2) 与 本机 MCP 服务端 两条互补路径,在不改动主程序数据库和原始文件的前提下扩展日常学习与研发工作流:

开放路径 适合解决的问题 运行机制与安全边界 适用平台
插件系统
Plugin API v1.2
扩展明/暗阅读主题、自定义语音朗读(TTS)引擎、划词词典、学术检索源、私有媒体库与外挂字幕、笔记导出与内容导入 declarative(纯配置 JSON)、local-http 或无 Shell stdio 子进程;严格校验 permissions、allowedHosts、响应消毒与 3 次失败熔断 桌面端:完整支持 stdio / local-http / 声明式
移动端 / 网页端:支持声明式主题与合规 HTTP 协议
本机 MCP 服务端
Streamable HTTP
让 Cursor、Claude Code、Codex、TRAE 等桌面助手读取当前书籍与摘录、一键导出主题笔记精华、回写白板/闪卡/路线,或整理调研资料包导入工作区 仅绑定 127.0.0.1:45129/mcp,每客户端独立 OS Keychain Bearer Token;所有受控写入先进入 AI 收件箱 核验并支持 Ctrl+Z 撤销 Windows / macOS(移动端可通过局域网 AI 中继连接桌面端模型)

扩展能力与界面入口对照

下表列出当前版本已接入主界面的扩展能力、对应清单字段,以及安装启用后在 KineX 中的具体使用位置:

能力领域 对应声明字段 启用后在 KineX 界面中的位置 如何触发自测 / 典型扩展
明/暗双模式主题 (v1.2) contributes.themes 顶部栏右侧 外观菜单(ThemeQuickMenu) 与 设置 → 外观 插件卡片点击 自测 校验变量;内置羊皮暖纸/深棕低蓝光皮肤(lightCssVars / darkCssVars)
语音朗读(TTS)引擎 (v1.2) contributes.readAloudProviders 阅读器顶栏 朗读设置 引擎下拉列表与试听按钮 插件卡片点击 自测 自动拉取音色列表;适配 Edge-TTS、Kokoro、GPT-SoVITS、OpenAI TTS
笔记与闪卡导出 (v1.2) contributes.contentExporters 1. 素材侧栏 笔记(Notes) 页签右上角 导出 按钮
2. 闪卡管理树 工具栏 导出图标
插件卡片点击 自测 测试示例片段生成;支持 Obsidian Callout .md、Anki .tsv
结构化内容导入 (v1.2) contributes.contentImporters 素材侧栏工具栏 + 导入菜单 底部新增对应导入项 插件卡片点击 自测 测试示例数据解析;支持播客 Show Notes、RSS 摘要直接生成主题材料
划词词典与术语查词 (v1.2) contributes.lookupProviders 阅读器划词浮动工具栏点击 查词(多词典插件可卡片内切换,并保留 网页词典 入口) 插件卡片点击 自测 查询示例词条;支持本地术语库或 MDX/GoldenDict HTTP 服务
AI 对话联网检索源 contributes.searchProviders AI 对话 联网搜索自动并入检索轨(开启隐私锁后仅保留局域网源) 启用开关后点击 自测;适合自建 SearXNG、arXiv、Semantic Scholar 学术检索
音视频源与外挂字幕 mediaSources / mediaSubtitles 导入课程 URL 自动识别播放器;视频播放器 字幕/章节 面板调用外挂字幕源 插件卡片点击 自测;支持 Jellyfin/Emby 课程库与本地 Whisper.cpp 外挂字幕
OAuth 授权与扩展字段 oauth / 其余声明字段 oauth 通过 kinex://plugin-auth/<pluginId> 完成 PKCE 回调;其余清单字段说明见 API 手册 pricingSources / relayEndpoints / studyPresets 当前为预留清单字段,详见规范手册

注:内置题库 .kxa 密文仓、用户密钥与主同步流水线受宿主严格隔离保护,所有插件与 MCP 客户端均只能通过明确声明的权限接口交互。

Plugin API v1.2Streamable HTTPBearer Token调研资料包 / 协作提案.kxplugin 扩展包8 大可运行域 · 最小权限桌面 AI 助手与 IDE11 款一键 + TRAE / Zed宿主校验与消毒网关防 CSS 注入 · 防 Shell本机 MCP Server127.0.0.1:45129 · 23 工具AI 收件箱原文核验 · Ctrl+Z 撤销

02安装成品扩展或本地调试打包

在「设置 → 插件与扩展」中拖入 .kxplugin 安装并启用扩展

安装已验证扩展包(.kxplugin)

  1. 在下方表格下载任意 .kxplugin 扩展包;
  2. 打开 KineX → 设置 → 插件与扩展,将 .kxplugin 文件直接拖入窗口(或点击 选择文件);
  3. 核对中文权限列表,勾选确认后点击 安装 并打开右侧开关;可随时点击卡片上的 自测 按钮验证插件是否连通并查看返回的 JSON 数据。

本地源码热加载与自定义打包

  1. 在 设置 → 插件与扩展 底部展开 高级 · 开发者本地调试,填写包含 manifest.json 的本地目录路径即可实时测试;
  2. 让 Coding Agent 读取本页配套的 /developers/llms.txt,即可直接按精确 Schema 生成规范的插件目录;
  3. 调试完成后,将目录打包为 .kxplugin(标准 ZIP 格式,根目录包含 manifest.json):
# macOS / Linux:打包为 .kxplugin 分发包
cd my-plugin && zip -r ../my-plugin.kxplugin manifest.json *.mjs

# Windows PowerShell:先打 zip 再改名为 .kxplugin
Compress-Archive -Path ./my-plugin/* -DestinationPath ./my-plugin.zip -Force
Move-Item ./my-plugin.zip ./my-plugin.kxplugin -Force

03官方可下载实用扩展(8 款)

以下 8 款扩展均已通过多进程子进程集成测试并可立即安装使用:

扩展名称 API 版本 核心能力 适用平台 下载安装包
暖纸护眼主题 v1.2.0 v1.2 themes(羊皮纸浅色 + 深棕护眼主题皮肤,覆盖底层画布、侧栏、弹窗与纸张底色) 全平台 warm-study-paper-theme.kxplugin
本地朗读桥接器(TTS) v1.2 readAloudProviders(接入本地 Kokoro / GPT-SoVITS / Edge-TTS / OpenAI /v1/audio/speech 语音朗读) Win / macOS local-tts-bridge.kxplugin
Anki / Obsidian 笔记导出器 v1.2 contentExporters(将高亮、批注与 FSRS 闪卡导出为 Obsidian Callout .md 或 Anki .tsv) Win / macOS anki-obsidian-exporter.kxplugin
术语词典与划词释义 (新增) v1.2 lookupProviders(内置常用学习科学/CS 术语库,并可配置本机 MDX/GoldenDict HTTP 服务接口) Win / macOS term-dictionary-lookup.kxplugin
公开播客 RSS 精读导入器 (v1.1.0) v1.2 mediaSources + contentImporters(支持播客 RSS 播放解析与离线/在线 Show Notes 导入) Win / macOS podcast-rss-learner.kxplugin
自建 SearXNG / arXiv 检索源 v1.1 searchProviders(为 AI 对话接入自建 SearXNG 或 arXiv 文献检索并附带原文出处) Win / macOS searxng-academic-search.kxplugin
本机离线字幕生成器 v1.1 mediaSubtitles(基于本地 Whisper.cpp 为音视频课程生成非侵入式外挂时间轴字幕) Win / macOS local-whisper-subtitles.kxplugin
私有影音库连接器 v1.1 mediaSources(将局域网 Jellyfin / Emby 私有课程库导入主题封面与原生播放器) Win / macOS jellyfin-private-media.kxplugin

04安全边界与工程护栏

  • 严格校验权限与响应边界:插件响应限制体积上限(512 KiB–12 MiB,支持多行或单行 JSON),自动清洗 HTML 注入标签、拦截 CSS 中的 url()/expression()/@import,并验证外链域名必须匹配声明的 allowedHosts;
  • 严禁调用 Shell 解释器:stdio 插件禁止调用 cmd / powershell / bash / sh 等外壳解释器,仅允许直接启动明确的可执行程序(如 node、python 或独立 Rust/Go 二进制文件);
  • 凭据隔离与无破坏修改:.kxa 自测密文仓与宿主密钥链不可被读取,插件仅能通过 req.secrets 读取自身 kinex.secret.plugin.<id>.* 独立凭据;
  • 连续失败自动熔断:任何插件连续失败 3 次自动停用并记录清晰诊断信息,防止影响主界面交互或手写笔 120Hz 响应。

KineX · Developers · 01

Plugins & Open Ecosystem

Extend KineX themes, Read-Aloud TTS voices, selection lookup dictionaries, scholarly search, note/flashcard exporters, structured importers, private media libraries, and MCP assistant workflows using Plugin API v1.2 and the Local MCP Server under strict least-privilege sandboxing.

Built for KineX 0.1.0-beta.8+ (Plugin API 1.2 · Streamable HTTP MCP · 23 built-in tools)

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

01Architecture & Extensibility Overview

KineX provides two complementary extension layers designed around explicit permission prompts, local sandboxing, and non-destructive editing:

Layer Best For Trust & Execution Boundary Supported Platforms
Plugin System
Plugin API v1.2
Light/dark themes, Read-Aloud TTS bridges, selection dictionaries, scholarly search, private media & external subtitles, note/flashcard exporters, and structured importers declarative JSON, loopback/LAN local-http, or shell-free stdio child processes scoped by permissions, allowedHosts, response sanitizers, and circuit breakers Desktop: full stdio, local-http, and declarative
Mobile / Web: declarative themes & compliant HTTP specs
Local MCP Server
Streamable HTTP
Connecting Cursor, Claude Code, Codex, TRAE, etc. to read passages, export structured theme digests, draft flashcards/whiteboards/roadmaps, or propose curated study packs Loopback-only (127.0.0.1:45129/mcp) with OS keychain Bearer Tokens and Host/Origin guards; proposals review inside AI Inbox with Ctrl+Z undo Windows / macOS (mobile clients connect via LAN AI Relay)

Where Installed Plugins Appear & Self-Test Verification

Every active contribution domain is wired directly into KineX's UI and supports one-click verification via the Self-Test button in Settings → Plugins & Extensions:

Domain Manifest Field Where It Appears in KineX Typical Use Case & Self-Test
Dual-Mode Themes (v1.2) contributes.themes Top-bar ThemeQuickMenu & Settings → Appearance Self-Test validates CSS tokens; overrides canvas, panels, and reader paper tint (lightCssVars / darkCssVars)
Read-Aloud TTS (v1.2) contributes.readAloudProviders Reader top-bar Read-Aloud Engine selector & voice preview Self-Test calls listVoices; integrates Edge-TTS, Kokoro, GPT-SoVITS, or OpenAI /v1/audio/speech
Note & Card Exporters (v1.2) contributes.contentExporters 1. Sidebar Notes tab top-right Export button
2. Flashcard Management toolbar Export icon
Self-Test formats a sample item and previews file output; Obsidian Callout .md, Anki .tsv
Structured Importers (v1.2) contributes.contentImporters Material sidebar + Import menu (adds one item per enabled importer) Self-Test runs a sample parse check; podcast Show Notes, RSS feeds, structured notes
Selection Lookup (v1.2) contributes.lookupProviders Reader text-selection toolbar Look Up icon (shows inline card with switcher + Web Dictionary fallback) Self-Test queries "spaced repetition"; built-in glossaries or local MDX/GoldenDict HTTP services
AI Chat Web Search contributes.searchProviders AI Chat multi-track search (respects Privacy Lock LAN-only filtering) Enable switch then click Self-Test; SearXNG, arXiv, Semantic Scholar
Media & Subtitles mediaSources / mediaSubtitles Course URL import & Media Player subtitle panel Self-Test checks metadata/cue resolution; Jellyfin/Emby libraries, local Whisper.cpp
OAuth & Reserved Fields oauth / other fields oauth handles kinex://plugin-auth/<pluginId> PKCE callbacks pricingSources, relayEndpoints, and studyPresets are currently reserved manifest fields (see API spec)

Note: Encrypted .kxa answer vaults, host credentials, and core sync pipelines remain strictly isolated inside KineX.

Plugin API v1.2Streamable HTTPBearer TokenStudy Packs / Proposals.kxplugin Bundle8 Active Domains · Least PrivilegeDesktop Assistants &amp; IDEs11 One-Click + TRAE / ZedHost Validation GatewayNo Shell · No CSS InjectionLocal MCP Server127.0.0.1:45129 · 23 ToolsAI InboxAnchor Check · Ctrl+Z Undo

02Quick Start: Install Extensions or Build Your Own

Install, review permissions, and enable extensions under Settings -> Plugins & Extensions

Installing Verified .kxplugin Packages

  1. Download any .kxplugin archive from the table below;
  2. Open Settings → Plugins & Extensions in KineX and drag the .kxplugin file into the drop zone (or click Browse);
  3. Review the permission checklist, confirm trust, toggle the extension on, and click Self-Test to verify live output right inside Settings.

Local Hot-Loading & Packaging Your Own

  1. Expand Advanced · Developer Local Debugging at the bottom of Settings → Plugins & Extensions and point it to your source folder containing manifest.json;
  2. Point your AI coding assistant to /developers/llms.txt for exact v1.2 schemas;
  3. Zip the root folder containing manifest.json as a .kxplugin archive:
# macOS / Linux
cd my-plugin && zip -r ../my-plugin.kxplugin manifest.json *.mjs

# Windows PowerShell
Compress-Archive -Path ./my-plugin/* -DestinationPath ./my-plugin.zip -Force
Move-Item ./my-plugin.zip ./my-plugin.kxplugin -Force

03Eight Ready-to-Install Extensions

Every package below has passed spawned subprocess integration testing and response validation:

Extension API Primary Capability Platforms Download
Warm Study Paper Theme v1.2.0 v1.2 themes (parchment light + warm sepia dark skin across canvas, panels, modals, and paper) All platforms warm-study-paper-theme.kxplugin
Local Read-Aloud Bridge (TTS) v1.2 readAloudProviders (connects Kokoro / GPT-SoVITS / Edge-TTS / OpenAI /v1/audio/speech into Read-Aloud) Win / macOS local-tts-bridge.kxplugin
Anki / Obsidian Notes Exporter v1.2 contentExporters (exports highlights, notes & FSRS cards as Obsidian Callout .md or Anki .tsv) Win / macOS anki-obsidian-exporter.kxplugin
Term Dictionary & Lookup (New) v1.2 lookupProviders (built-in cognitive science & study glossary plus optional local MDX/GoldenDict HTTP bridge) Win / macOS term-dictionary-lookup.kxplugin
Podcast RSS Importer (v1.1.0) v1.2 mediaSources + contentImporters (resolves public podcast RSS audio and imports Show Notes from URL or XML) Win / macOS podcast-rss-learner.kxplugin
Self-Hosted SearXNG / arXiv Search v1.1 searchProviders (private academic web search with grounded source links in AI Chat) Win / macOS searxng-academic-search.kxplugin
Offline Subtitle Generator v1.1 mediaSubtitles (local Whisper.cpp external timestamped subtitles without touching videos) Win / macOS local-whisper-subtitles.kxplugin
Private Media Connector v1.1 mediaSources (LAN Jellyfin/Emby lecture cards and native playback) Win / macOS jellyfin-private-media.kxplugin

04Security Boundaries & Guardrails

  • Strict Validation & Response Sanitizing: Plugin outputs enforce hard byte limits (512 KiB–12 MiB, accepting single-line or pretty-printed JSON), strip HTML tags, reject CSS url()/expression()/@import values, and require URLs to match declared allowedHosts.
  • Shell-Free Execution: stdio plugins cannot invoke cmd, powershell, bash, or sh; only direct executables (e.g., node, python, or compiled binaries) launch without a shell.
  • Anti-Spoiler Vault & Keychain Isolation: Encrypted .kxa quiz vaults and host keychain credentials stay unreachable; plugins receive only their own kinex.secret.plugin.<id>.* secrets via req.secrets.
  • Automatic Circuit Breaker: Three consecutive errors pause the failing extension with diagnostic details so UI responsiveness and 120Hz stylus inking are never impacted.