一个强大的模型上下文协议(MCP)服务器,使 Claude AI 能够与 Scrivener 项目无缝交互。此服务器提供了全面的文档管理、AI 助力的内容分析以及高级写作辅助功能——所有这些都不需要外部服务如 Redis。
npm install -g scrivener-mcp
✨ 特性:
如果自动设置未成功,可以手动配置:
# 运行设置脚本
npx scrivener-mcp setup
# 或者手动添加到 claude_desktop_config.json 中:
{
"mcpServers": {
"scrivener": {
"command": "npx",
"args": ["scrivener-mcp"]
}
}
}
# 移除包和配置
npm uninstall -g scrivener-mcp
.scriv 项目MCP 服务器提供 75 多种强大的工具,以实现全面的 Scrivener 集成:
open_project(path) - 打开 Scrivener 项目get_structure(options?) - 获取项目的层次结构
maxDepth(限制树深度),folderId(获取特定文件夹),includeTrash(包含回收站),summaryOnly(仅返回计数)get_document_info(documentId) - 获取文档元数据及其完整的父级层次结构和位置get_project_metadata() - 获取项目级别的元数据read_document(documentId) - 读取纯文本内容read_document_formatted(documentId) - 保留 RTF 格式的读取write_document(documentId, content) - 将内容写入文档get_document_annotations(documentId) - 获取 Scrivener 注释create_document(parentId?, title, type?) - 创建新的文档或文件夹delete_document(documentId) - 删除文档或文件夹move_document(documentId, newParentId?) - 将文档移动到新位置update_metadata(documentId, metadata) - 更新文档元数据search_content(query, options?) - 在所有文档中搜索(排除回收站)get_word_count(documentId?) - 获取单词/字符计数list_trash() - 列出回收站中的所有文档search_trash(query, options?) - 仅在已删除文档中搜索recover_document(documentId, targetParentId?) - 从回收站恢复文档analyze_document(documentId) - 深度 AI 助力的内容分析deep_analyze_content(documentId) - 综合写作指标和建议critique_document(documentId, focusAreas?) - 获取建设性的反馈compile_documents(documentIds, separator?, preserveFormatting?) - 编译多个文档enhance_content(documentId, enhancementType, options?) - 应用 AI 改进
eliminate-filter-words,strengthen-verbs,vary-sentences,add-sensory-details,show-dont-tell,improve-flow,enhance-descriptions,strengthen-dialogue,fix-pacing,expand,condense,rewritesave_character_profile(name, role, description?, traits?, arc?) - 存储角色数据get_character_profiles() - 检索所有角色档案update_style_guide(tone?, voice?, pov?, tense?) - 设置写作偏好get_style_guide() - 获取当前风格指南save_plot_thread(name, description, status?, documents?) - 跟踪情节线索get_plot_threads() - 查看所有情节线索get_writing_stats() - 获取项目统计export_project_memory() - 导出完整的记忆数据get_all_documents(includeTrash?) - 获取所有文档的扁平列表save_project() - 保存项目中的任何待处理更改is_project_modified() - 检查项目是否有未保存的更改read_document_rtf(documentId) - 保留 RTF 格式的读取文档update_document_context(documentId, summary?, themes?, pacing?) - 更新文档记忆上下文add_custom_context(key, value) - 向项目记忆添加自定义上下文get_custom_context(key?) - 从项目记忆获取自定义上下文update_writing_session(wordsWritten, duration?) - 更新写作会话统计extract_research_data(html, keywords?) - 从网络内容中提取研究数据import_memory(memoryData) - 从导出的数据导入项目记忆update_document_synopsis_notes(documentId, synopsis?, notes?) - 更新文档的概要和/或笔记batch_update_synopsis_notes(updates) - 一次更新多个文档的概要和/或笔记semantic_search(query, k?, threshold?) - 按语义意义查找文档find_analogies(a, b, c) - 发现类比关系(A:B :: C:?)hhm/memorize/text(text, id?) - 将文本存储在语义记忆中hhm/memorize/document(document) - 存储具有结构的文档hhm/memorize/relationship(subject, relation, object) - 存储语义关系hhm/query/text(text, k?) - 使用文本查询记忆hhm/query/analogy(a, b, c) - 查找类比完成hhm/concepts/generate() - 生成新颖的概念组合hhm/dream(duration?) - 进入创意重组模式hhm/consistency/check(memoryIds) - 验证记忆一致性hhm/stats() - 获取 HHM 系统统计hhm/benchmark/run(dimensions?) - 运行性能基准测试hhm/benchmark/gpu() - 测试 GPU 加速能力hhm/cache/clear() - 清除向量缓存hhm/cache/stats() - 获取缓存性能指标get_database_status() - 获取 SQLite 和 Neo4j 数据库的状态query_database(query, params?) - 在 SQLite 数据库上执行 SELECT 查询get_writing_statistics(days?) - 获取指定时间段的写作统计record_writing_session(wordsWritten, durationMinutes?, documentsWorkedOn?, notes?) - 记录写作会话analyze_story_structure() - 使用 Neo4j 分析文档流程、角色弧线和主题find_character_relationships(characterId) - 查找角色的所有关系create_relationship(fromId, fromType, toId, toType, relationshipType, properties?) - 在实体之间创建关系get_content_analysis_history(documentId, analysisType?) - 获取历史分析数据backup_databases(backupPath?) - 创建项目数据库的备份此 MCP 服务器包括专门为 Scrivener 文档格式设计的全面 RTF(富文本格式)支持:
ScrivenerProject - 主项目操作类RTFHandler - 全面的 RTF 解析和生成DatabaseService - 管理 SQLite 和 Neo4j 数据库操作MemoryManager - 持久的项目记忆和上下文存储ContentAnalyzer - 深度写作分析和指标ContentEnhancer - AI 助力的内容改进引擎HolographicMemorySystem - 10,000 维的语义记忆,带有 GPU 加速.scrivener-databases/scrivener.db
.ai-memory 文件夹中以便快速访问// 打开项目
open_project("/path/to/MyNovel.scriv")
// 获取项目结构
get_structure()
// 读取文档
read_document("UUID-OF-DOCUMENT")
// 分析内容
deep_analyze_content("UUID-OF-DOCUMENT")
// 应用增强
enhance_content("UUID-OF-DOCUMENT", "strengthen-verbs")
// 更新单个文档的概要
update_document_synopsis_notes("UUID-OF-CHAPTER", {
synopsis: "伊丽莎白在舞会上第一次见到达西先生,并对他产生了厌恶。",
notes: "重要的第一印象场景 - 设立中心冲突"
})
// 批量更新多个文档
batch_update_synopsis_notes([
{
documentId: "UUID-OF-CHAPTER-1",
synopsis: "介绍伊丽莎白和她的家人",
notes: "角色建立章节"
},
{
documentId: "UUID-OF-CHAPTER-2",
synopsis: "内瑟菲尔德舞会",
notes: "主要社交活动 - 引入彬格莱和达西"
}
])
// 检查数据库状态
get_database_status()
// 使用自定义 SQL 查询文档
query_database("SELECT title, word_count FROM documents WHERE word_count > 1000")
// 记录写作会话
record_writing_session({
wordsWritten: 1250,
durationMinutes: 45,
documentsWorkedOn: ["UUID-1", "UUID-2"],
notes: "富有成效的早晨会话"
})
// 获取写作统计
get_writing_statistics(30) // 最近 30 天
// 分析故事结构