Token导航 LogoToken导航TokenDH.com
Drafts MCP Server logo
开发工具stdio官方级别未说明来源级核验

Drafts MCP Server

MCP Server

@agiletortoise/drafts-mcp-server

一个通过AppleScript与Drafts应用交互的MCP服务器,提供草稿创建、管理、搜索等功能,并包含独立的CLI工具。

工具数

12

提示词数

0

GitHub Stars

33

资源数

0
命令行工具JavaScriptClaude文本处理Claude DesktopClaudeCursor

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

agiletortoise

提供方

agiletortoise

最后核验

2026/5/17 20:20

运行时

Node.js

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

npx @agiletortoise/drafts-mcp-server

详细介绍

起草MCP服务器

A. 模型上下文协议 (MCP)服务器,使AI助手能够与 草稿 通过AppleScript在macOS上运行应用程序。

有关用途的更多讨论,请参阅 草稿论坛

特性

  • 📝 草案管理:创建、阅读、更新和搜索草稿
  • 🏷️ 标签:添加和管理草稿上的标签
  • 📂 工作区:列出和查询特定工作区的草稿
  • 行动:以编程方式运行草稿操作
  • 🔍 搜索:在所有草稿中进行全文搜索
  • 🚩 旗帜和档案:标记、存档或回收草稿

CLI工具

除了MCP服务器外,此软件包还包括一个独立的 drafts CLI,用于直接从终端与草稿进行交互。

CLI安装

# Install globally from npm
npm install -g @agiletortoise/drafts-mcp-server

# Or link locally for development
git clone https://github.com/agiletortoise/drafts-mcp-server.git
cd drafts-mcp-server
npm install
npm run build
npm link

安装后 drafts 命令在全球范围内可用。

命令行用法

默认情况下,输出是人类可读的。添加 --json 用于机器可读的JSON输出。

# Workspaces
drafts workspace list
drafts workspace current
drafts workspace open "Work"
drafts workspace drafts "Work" --folder inbox

# Tags
drafts tag list
drafts tag get "work"

# List and search drafts
drafts list
drafts list --folder inbox --tag work --flagged
drafts list --created-after 2025-01-01 --modified-before 2025-06-30
drafts search "meeting notes"

# Single draft operations
drafts current
drafts get 
drafts create "Hello world" --tag notes --tag ideas --flagged
drafts update  "Updated content"
drafts open 

# Organize drafts
drafts flag 
drafts flag  --unflag
drafts archive 
drafts inbox 
drafts trash 
drafts add-tags  important urgent

# Actions
drafts action list
drafts action run  "Send to Email"

# JSON output for scripting
drafts --json list --folder inbox
drafts --json search "budget"

需求

  • macOS(AppleScript仅适用于macOS)
  • 草稿 已安装app v50.0.3或更高版本
  • Node.js 18或更高版本

安装

快速入门(发布到npm后)

您需要在Mac上安装Node,因此请 npx 命令可用。如果您尚未安装Node,可以使用 家酿 使用:

brew install node

发布后,与 npx -无需安装:

npx @agiletortoise/drafts-mcp-server

全球安装

npm install -g @agiletortoise/drafts-mcp-server

本地开发/测试

发布前,在本地进行测试:

# Clone or extract the package
cd drafts-mcp-server

# Install dependencies
npm install

# Build
npm run build

# Test with MCP Inspector
npm run inspector

# Or run directly
node dist/index.js

Claude桌面配置

安装MCPB版本是将此MCP与Claude Desktop应用程序一起使用的最简单方法。为此:

  • 下载 drafts-mcp-server.mcpb 从项目到Mac。
  • 打开克劳德桌面
  • 导航至 Settings > Extensions
  • 将drafts-mcp-server.mcpb文件从Finder拖放到此窗口中进行安装。
  • 按照提示完成安装。

我们可能很快会将此项目提交到Claude扩展目录,以便直接在应用程序中使用。

高级Claude桌面配置

如果您更喜欢在本地安装,或通过运行 npm,这些说明是给你的。..

您需要在Mac上安装Node,因此请 npx 命令可用。如果您尚未安装Node,可以使用 家酿 使用:

brew install node

将以下内容添加到Claude Desktop配置文件中(~/Library/Application Support/Claude/claude_desktop_config.json),并重新启动克劳德。

{
  "mcpServers": {
    "drafts": {
      "command": "npx",
      "args": ["@agiletortoise/drafts-mcp-server"]
    }
  }
}

用于本地开发/测试 (发布前),使用:

{
  "mcpServers": {
    "drafts": {
      "command": "node",
      "args": ["/absolute/path/to/drafts-mcp-server/dist/index.js"]
    }
  }
}

或者,如果全局安装:

{
  "mcpServers": {
    "drafts": {
      "command": "drafts-mcp-server"
    }
  }
}

光标配置

发布到npm后,添加到光标MCP设置中(.cursor/mcp.json 在项目或全局设置中):

{
  "mcpServers": {
    "drafts": {
      "command": "npx",
      "args": ["@agiletortoise/drafts-mcp-server"]
    }
  }
}

用于本地开发/测试,使用:

{
  "mcpServers": {
    "drafts": {
      "command": "node",
      "args": ["/absolute/path/to/drafts-mcp-server/dist/index.js"]
    }
  }
}

Claude代码的配置

Claude Code(CLI工具)可以使用 /mcp 命令或直接编辑设置文件。

使用CLI:

claude mcp add drafts -- npx @agiletortoise/drafts-mcp-server

用于本地开发/测试,使用:

claude mcp add drafts -- node /absolute/path/to/drafts-mcp-server/dist/index.js

添加后,重新启动Claude Code或启动新会话,使MCP服务器可用。

权限

服务器首次运行时,macOS将请求权限:

  1. 系统首选项 > 安全与隐私 > 隐私 > 自动化
  2. 允许MCP主机(例如,Claude Desktop、Claude Code、Cursor)进行控制 草稿

可用工具

工作空间管理

drafts_list_workspaces

列出草稿中的所有工作区。

// No parameters required

草稿操作

drafts_get_drafts

通过按内容、文件夹、标签、标记状态和日期灵活过滤来获取草稿。

{
  query?: string;                // Optional: Query string to filter drafts
  folder?: inbox, archive, trash // Optional: Limit to one folder
  tag: string                    // Optional: Limit by assigned tag
}

drafts_create_draft

使用内容和可选标签创建新草稿。

{
  content: string;        // Required: Draft content
  tags?: string[];        // Optional: Array of tag names
  flagged?: boolean;      // Optional: Flag the draft
}

drafts_get_draft

按UUID检索特定草稿。

{
  uuid: string;           // Required: UUID of the draft
}

drafts_update_draft

更新现有草稿的内容。

{
  uuid: string;           // Required: UUID of the draft
  content: string;        // Required: New content
}

drafts_search

在所有工作区中搜索草稿。

{
  query: string;          // Required: Search query
}

标签

drafts_add_tags

向现有草稿添加标记。

{
  uuid: string;           // Required: UUID of the draft
  tags: string[];         // Required: Array of tag names to add
}

行动

drafts_list_actions

列出所有可用的草稿操作。

// No parameters required

drafts_run_action

对特定草稿执行“草稿”操作。

{
  draftUuid: string;      // Required: UUID of the draft
  actionName: string;     // Required: Name of the action to run
}

草稿状态

drafts_flag

标记或不标记草稿。

{
  uuid: string;           // Required: UUID of the draft
  flagged: boolean;       // Required: true to flag, false to unflag
}

drafts_archive

将草稿存档。

{
  uuid: string;           // Required: UUID of the draft to archive
}

drafts_trash

将草稿移至垃圾箱。

{
  uuid: string;           // Required: UUID of the draft to trash
}

示例用法

以下是一些可以与Claude或其他AI助手一起使用的示例提示:

基本操作

"Show me all my workspaces in Drafts"

"Get all drafts from my 'Work' workspace"

"Create a new draft with the content 'Meeting notes for Q1 planning'"

"Search for drafts containing 'budget'"

高级操作

"Create a draft with content 'Todo: Review PR #123' and tag it with 'work' and 'urgent'"

"Find the draft about the marketing campaign and run the 'Send to Email' action on it"

"Flag all drafts in my Inbox workspace that contain 'follow up'"

"Archive all drafts tagged 'completed'"

工作流集成

"Get all drafts from my 'Daily Notes' workspace from the last week, 
 then create a summary draft tagged 'weekly-review'"

"Search for all drafts tagged 'meeting-notes', extract action items, 
 and create a new draft with all the action items combined"

发展

设置

# Clone the repository
git clone https://github.com/agiletortoise/drafts-mcp-server.git
cd drafts-mcp-server

# Install dependencies
npm install

# Build
npm run build

# Test with MCP Inspector
npm run inspector

项目结构

drafts-mcp-server/
├── src/
│   ├── index.ts           # Main MCP server implementation
│   ├── cli.ts             # Standalone CLI tool
│   ├── drafts.ts          # Drafts-specific operations
│   └── applescript.ts     # AppleScript execution utilities
├── dist/                  # Compiled JavaScript (generated)
├── package.json
├── tsconfig.json
└── README.md

测试

使用 MCP检查员 要测试服务器,请执行以下操作:

npm run inspector

这将打开一个web界面,您可以在其中交互式地测试每个工具。

故障排除

“草稿出错:无法获取工作区…”

确保工作区名称的拼写与草稿中显示的完全一致。工作区名称区分大小写。

权限错误

  1. 检查 系统首选项 > 安全与隐私 > 隐私 > 自动化
  2. 确保您的MCP客户端(Claude Desktop、Cursor等)有权控制草稿
  3. 授予权限后,您可能需要重新启动客户端

脚本执行错误

  1. 确保草稿已安装并已启动至少一次
  2. 尝试手动运行一个简单的AppleScript来验证权限:
   osascript -e 'tell application "Drafts" to get name of first workspace'

未退回工作区/草稿

这可能表示AppleScript字典访问不起作用。检查:

  • 您正在使用最新版本的草稿
  • 您的AppleScript字典已在草稿中正确公开

贡献

欢迎投稿!请随时提交拉取请求。

  1. 分叉存储库
  2. 创建功能分支(git checkout -b feature/amazing-feature)
  3. 提交您的更改(git commit -m 'Add some amazing feature')
  4. 推到分支(git push origin feature/amazing-feature)
  5. 打开拉取请求

许可证

MIT许可证-请参阅 许可证 文件以获取详细信息。

相关项目

支持

目录标签

目录标签

命令行工具JavaScriptClaude文本处理草稿管理本地部署AppleScript集成CLI工具自动化

支持客户端

Claude DesktopClaudeCursor

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Node.js

来源包(packageName,安装包名)

@agiletortoise/drafts-mcp-server

工具数量(toolCount,工具数)

12

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP