Drafta

io.github.rpegorov由 GitHub 账号 rpegorov 发布v1.0.0更新于 Oct 26, 2026

Search, read and write notes in your local Drafta library over local stdio.

已验证STDIO仅桌面文件与存储知识与记忆

概览

AI 生成的概览

本地 stdio MCP 服务器,让助手在 Mac 上的 Drafta Markdown 笔记库中搜索、读取和写入笔记。

可以做什么
  • 搜索与读取笔记:按标题、正文和标签全文检索,可按标签、状态和笔记本过滤,并按 id 或精确标题读取整篇笔记。
  • 浏览结构:列出笔记本层级和所有在用的标签。
  • 了解笔记格式:提供 Markdown 格式指南,涵盖标注块、mermaid、任务列表、标签、wiki 链接和数学公式。
  • 创建与编辑笔记:新建笔记、追加或替换正文、设置状态、添加标签、创建笔记本以及把笔记移入回收站。
  • 作为上下文附加:最近 200 篇笔记以 MCP 资源形式发布。
适用场景
适合用 Drafta 应用保存笔记、并希望助手在对话中查找、总结或补充这些笔记的场景,改动会写入应用读取的同一批 Markdown 文件。若只想搜索和阅读,可用只读参数启动。
运行要求
以本地进程通过 stdio 运行;从源码构建需要 macOS 13 或更高版本以及 Swift 6(Xcode 16 或更新)。笔记库路径默认指向 Drafta 应用的库,可用库路径参数覆盖。MCPB 包和插件会启动 Drafta.app 内置的辅助程序,因此应用需位于 /Applications。无需账号、密钥或网络。
安装前请注意
写入类工具会在真实笔记库中新建、替换、追加、打标签、改状态和移入回收站;使用只读参数可只发布读取工具。每次编辑最多保留 30 个修订版本,回收站中的笔记文件仍会保留。助手读到的笔记内容随后由你所连接的 MCP 客户端处理。本仓库是应用内置服务器的独立快照,并非该二进制文件,两者可能产生差异。

安装

在 SourceWeft 中

  1. 打开 控制台中的 Drafta,将其添加到工作区。
  2. 为需要使用其工具的对话启用该服务。

Desktop only,通过 STDIO。 STDIO 服务会启动本地进程,因此需要 SourceWeft 桌面宿主。

其他 MCP 客户端

参照 仓库 中的启动说明。

README

drafta-mcp

A Model Context Protocol server that exposes a Drafta note library to an AI assistant — Claude Code, Zed, or any other MCP client that launches servers over stdio.

The assistant can search and read your notes, and (unless you start the server with --read-only) create notes, append to them, tag them, set their status and file them into notebooks. Everything it writes lands in the same Markdown files the Drafta app reads, so a note created from a chat is indistinguishable from one you typed.

Privacy

This repository exists so that you can check for yourself where your notes go. The answer is: nowhere.

  • stdio only. The server talks to the client that launched it over stdin and stdout. It opens no socket and listens on no port.
  • Local files only. It reads and writes files under the library directory and nothing else. It never touches the app's settings, keychain items or sync state.
  • No network. No code in this package makes a network request. There is no URLSession, Network framework or socket anywhere in Sources/; the only dependency is the official MCP Swift SDK, used for its stdio transport.
  • No accounts, no licence check, no telemetry.

What your notes are exposed to is whatever the MCP client does with the text it reads — that part is up to the client you connect.

Build

Requires macOS 13 or later and Swift 6 (Xcode 16 or newer).

sh
swift build -c release

The binary is .build/release/drafta-mcp.

sh
swift test   # the test suite

Install

Copy the binary somewhere stable, for example:

sh
install -m 755 .build/release/drafta-mcp /usr/local/bin/drafta-mcp

Usage

usage: drafta-mcp [--library <path>] [--read-only]
  -l, --library <path>  library root (default: ~/Library/Application Support/Drafta/Library)  -r, --read-only       publish read tools only  -h, --help            print this help and exit

Without --library the server opens the library the Drafta app uses. A ~ in the path is expanded by the server, since client configs are JSON and no shell sees them. An unknown flag is an error: --readonly (a typo) does not start a writable server.

Claude Code

sh
claude mcp add drafta -- /usr/local/bin/drafta-mcp --library "~/Library/Application Support/Drafta/Library"

Add --read-only at the end to give the assistant read access only.

Claude Code plugin

This repository is also a Claude Code plugin marketplace. The plugin starts the drafta-mcp helper that ships inside Drafta.app, so it requires Drafta.app in /Applications.

/plugin marketplace add rpegorov/drafta-mcp/plugin install drafta@drafta

The plugin runs the server with its defaults (the app's library, read and write). For read-only access, or for Drafta.app in ~/Applications, register the helper yourself with claude mcp add and pass --read-only or the full path; see plugins/drafta/README.md.

Claude Desktop (MCPB)

Download drafta-mcp.mcpb from the Releases page and double-click it. The bundle contains no binary: it starts the drafta-mcp helper that ships inside Drafta.app, so it requires Drafta.app in /Applications. Build it from source with scripts/build-mcpb.sh.

Codex

codex plugin marketplace add rpegorov/drafta-mcpcodex plugin add drafta@drafta

The plugin starts the helper inside Drafta.app, so it needs Drafta.app in /Applications.

DeepSeek Harness (DSH)

plugins/dsh-drafta adds a @deepseek-ai/dsh-mcp-client row (dsh-drafta-mcp) for the Drafta helper. Add the package to your profile's package.json the same way as any local plugin, with a link: dependency, and list it under dsh.profile.bundles:

json
{  "dependencies": { "dsh-drafta": "link:/path/to/drafta-mcp/plugins/dsh-drafta" },  "dsh": { "profile": { "bundles": ["dsh-drafta"] } }}

If you already added Drafta to DSH by hand, remove one of the two: both register a server named drafta.

Zed

In settings.json:

json
{  "context_servers": {    "drafta": {      "command": "/usr/local/bin/drafta-mcp",      "args": ["--library", "~/Library/Application Support/Drafta/Library"]    }  }}

Tools

Read tools (always published):

ToolWhat it does
search_notesFull-text search over titles, bodies and tags, filtered by tag, status, notebook; newest first, limit up to 100. An empty query lists the most recent notes.
read_noteOne note in full, by id or exact title.
list_notebooksNotebooks with their hierarchy.
list_tagsEvery tag in use.
formatting_guideThe Markdown Drafta renders: callouts, mermaid, task lists, tags, wiki links, maths.

Write tools (not published with --read-only):

ToolWhat it does
create_noteNew note; goes to the Inbox unless a notebook is given. Optional tags and status.
append_to_noteAdds text to the end; the previous text is kept as a revision.
update_noteReplaces the body; the previous text is kept as a revision.
set_note_statusactive, onHold, completed, dropped or none.
tag_noteAdds tags (array, or a comma-separated string).
create_notebookCreates a notebook, or returns the existing one with that name.
trash_noteMoves a note to the trash; the file is kept.

Notes are also published as MCP resources (drafta://note/<uuid>, the 200 most recent), so a client can attach one as context without a tool call.

Library format

A library is a plain directory:

Library/  library.json              notebooks (pretty-printed, sorted JSON)  notes/<UUID>.md           one note: YAML front matter + Markdown body  revisions/<UUID>/<ms>.md  previous bodies of a note, one file per revision  editor-hold.json          written by the app while it holds unsaved text

Things worth knowing if you read or write these files yourself:

  • Tags are not stored. They are derived from #tags in the body on every read; only tags added separately live in the extraTags front-matter field.
  • The title is the first line of the body. create_note writes the title as a # heading when the body has none.
  • A note without a notebook is an orphan, visible only under All Notes, so new notes are filed into the Inbox (created if missing).
  • Edits keep history. update_note and append_to_note save the replaced text under revisions/ (30 per note), where the app shows it as history.
  • Open notes are protected. While the Drafta app holds unsaved text for a note, it lists that note in editor-hold.json; update_note and append_to_note refuse to write that note's body and say so, instead of reporting a success the app would overwrite a moment later.
  • library.json is edited under file coordination, so a notebook the app adds at the same moment is not lost.

The server works whether or not the app is running. When it is, the app's file watcher picks up what the server wrote.

Relationship to Drafta.app

Drafta.app ships its own copy of drafta-mcp inside the app bundle. This repository is not that binary. It is an independent, community-editable snapshot of the same server: same tool names, same arguments, same on-disk format, with the app's licence check removed — writes here are gated only by --read-only. The two are developed separately and may drift; if the app ever changes its library format, this snapshot does not follow automatically.

Contributions are welcome.

Licence

Apache License 2.0 — see LICENSE and NOTICE.


Кратко по-русски

drafta-mcp — MCP-сервер для библиотеки заметок Drafta. Работает только через stdio, читает и пишет только файлы в каталоге библиотеки и не делает ни одного сетевого запроса. Сборка: swift build -c release. Подключение к Claude Code: claude mcp add drafta -- /путь/к/drafta-mcp --library <путь к библиотеке>. Флаг --read-only оставляет только инструменты чтения. Это независимый снимок сервера, а не бинарник, который поставляется внутри Drafta.app.


[M8ven Score]

来源:README.md,提交 47db128

工具

0
SourceWeft 尚未在沙箱中启动过该软件包,因此其工具未知。

版本历史

1
  1. v1.0.0最新Oct 18, 2026

评分

已满足适用检查项的 50%

该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。

  • 近 30 天内可连通25 分

    请保持端点能够响应 MCP 握手;SourceWeft 每 30 天探测一次。

  • 已声明认证方式10 分

    请在注册中心条目中声明凭据请求头,或保持端点能够响应探测,以便判定其认证方式。

  • 已列出工具15 分

    请让服务器在无凭据时响应 tools/list,或发布可在沙箱中无凭据启动的软件包。

  • 描述必需15 分
  • 图标10 分
  • 文档15 分
  • 许可证10 分