Dialogoi-新型写入支持MCP服务器

支援写小说RAG支持MCP(Model Context Protocol)服务器。
特徴
- RAG検索: Qdrant + multilingual-e5-small 语义相似度搜索
- 全文検索:快速查找正则表达式文本
- 按文件类型搜索:区分配置文件正文文件的搜索
- 实时监控:更改文件时自动索引更新
- 克劳德桌面統合: MCP协议完全集成
安装
前提条件
- Node.js 20.0.0以上
- Docker(RAG使用搜索功能时)
安装,安装
git clone https://github.com/cedretaber/dialogoi
cd dialogoi
npm install
npm run build使用方法
1.小说项目的准备
novels/
├── my_novel/
│ ├── novel.json # プロジェクト設定
│ ├── settings/ # 設定ファイル
│ │ ├── characters.md
│ │ └── world.md
│ └── contents/ # 本文ファイル
│ ├── chapter1.md
│ └── chapter2.mdnovel.json例:
{
"title": "私の小説",
"author": "作者名",
"description": "小説の説明",
"settingsDirectories": ["settings"],
"contentDirectories": ["contents"],
"instructionFiles": ["DIALOGOI.md"]
}2. Claude Desktop连携
claude_desktop_config.json添加到:
{
"mcpServers": {
"dialogoi": {
"command": "node",
"args": ["/path/to/dialogoi/dist/index.js", "--project-root", "/path/to/novels"],
"cwd": "/path/to/dialogoi"
}
}
}配置文件位置:
- 窗户:
%APPDATA%\\Claude\\claude_desktop_config.json - macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
3.主要命令行参数
node dist/index.js [オプション]- `--project-root
`:小说项目根目录
--qdrant-url: Qdrant服务器URL(未设定时Docker自动启动)--docker-enabled: Docker自动起动の有效/无效
MCP API
项目管理
list_novel_projects:获取项目列表get_novel_settings/content/instructions:获取文件内容add_novel_setting/content:创建新文件
検索机能
search_novel_text:统一文本搜索(支持正则表达式)search_rag: RAG検索(意味的类似度検索)
在这两个搜索中 fileType 可通过参数缩小:
content:仅限正文文件settings:仅限配置文件both:两者(默认值)
RAG搜索特征
- 多语言e5-small:384维向量支持多语言
- Qdrant:快速矢量搜索引擎
- 预过滤: Qdrant侧高速滤波
- 智能张紧:20%重叠的上下文保持
- 自动回退: Qdrant禁用时的详细错误指导
开発
基本命令
npm run dev # 開発モード
npm run build # ビルド
npm test # ユニットテスト
npm run test:integration # 統合テスト
npm run lint # ESLint
npm run typecheck # TypeScript型チェック体系结构
- 存储库模式:抽象数据访问层
- 服务模式:业务逻辑层
- 后端模式:搜索引擎抽象化
- 依存性注入:基于构造函数
许可证
MIT许可证
