Model Context Protocol server for Drafts app on macOS via AppleScript.
npm install @agiletortoise/drafts-mcp-serverA Model Context Protocol (MCP) server that enables AI assistants to interact with the Drafts app on macOS through AppleScript.
For additional discussion of uses, see the Drafts forum
- š Draft Management: Create, read, update, and search drafts
- š·ļø Tags: Add and manage tags on drafts
- š Workspaces: List and query drafts from specific workspaces
- ā” Actions: Run Drafts actions programmatically
- š Search: Full-text search across all drafts
- š© Flags & Archive: Flag, archive, or trash drafts
- macOS (AppleScript is macOS-only)
- Drafts app v50.0.3 or greater installed
- Node.js 18 or higher
You will need to have Node installed on your Mac so make the npx command available. If you do not already have Node installed, you can do so with Homebrew using:
``bash`
brew install node
Once published, use with npx - no installation needed:
`bash`
npx @agiletortoise/drafts-mcp-server
`bash`
npm install -g @agiletortoise/drafts-mcp-server
Before publishing, test locally:
`bashClone or extract the package
cd drafts-mcp-server
$3
The easiest way to use this MCP with the Claude Desktop app by installing the MCPB version. To do so:
* Download the drafts-mcp-server.mcpb from the project to your Mac.
* Open Claude Desktop
* Navigate to
Settings > Extensions
* Drag and drop the drafts-mcp-server.mcpb file from the Finder into this window to install.
* Follow the prompts to complete installation.We are likely to submit this project to the Claude extension directory soon to make it available directly in the app.
#### Advanced Claude Desktop Configuration
If you prefer to install locally, or run via
npm, these instructions are for you...You will need to have Node installed on your Mac so make the
npx command available. If you do not already have Node installed, you can do so with Homebrew using:`bash
brew install node
`Add the below to the Claude Desktop confguration file (
~/Library/Application Support/Claude/claude_desktop_config.json), and relaunch Claude.`json
{
"mcpServers": {
"drafts": {
"command": "npx",
"args": ["@agiletortoise/drafts-mcp-server"]
}
}
}
`For local development/testing (before publishing), use:
`json
{
"mcpServers": {
"drafts": {
"command": "node",
"args": ["/absolute/path/to/drafts-mcp-server/dist/index.js"]
}
}
}
`Or if globally installed:
`json
{
"mcpServers": {
"drafts": {
"command": "drafts-mcp-server"
}
}
}
`$3
After publishing to npm, add to your Cursor MCP settings (
.cursor/mcp.json in your project or global settings):`json
{
"mcpServers": {
"drafts": {
"command": "npx",
"args": ["@agiletortoise/drafts-mcp-server"]
}
}
}
`For local development/testing, use:
`json
{
"mcpServers": {
"drafts": {
"command": "node",
"args": ["/absolute/path/to/drafts-mcp-server/dist/index.js"]
}
}
}
`$3
Claude Code (the CLI tool) can be configured using the
/mcp command or by editing the settings file directly.Using the CLI:
`bash
claude mcp add drafts -- npx @agiletortoise/drafts-mcp-server
`For local development/testing, use:
`bash
claude mcp add drafts -- node /absolute/path/to/drafts-mcp-server/dist/index.js
`After adding, restart Claude Code or start a new session for the MCP server to be available.
Permissions
The first time the server runs, macOS will ask for permissions:
1. System Preferences > Security & Privacy > Privacy > Automation
2. Allow the MCP host (e.g., Claude Desktop, Claude Code, Cursor) to control Drafts
Available Tools
$3
####
drafts_list_workspaces
List all workspaces in Drafts.`typescript
// No parameters required
`$3
####
drafts_get_drafts
Get drafts with flexible filtering by content, folder, tag, flagged status, and dates.`typescript
{
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
Create a new draft with content and optional tags.`typescript
{
content: string; // Required: Draft content
tags?: string[]; // Optional: Array of tag names
flagged?: boolean; // Optional: Flag the draft
}
`####
drafts_get_draft
Retrieve a specific draft by UUID.`typescript
{
uuid: string; // Required: UUID of the draft
}
`####
drafts_update_draft
Update the content of an existing draft.`typescript
{
uuid: string; // Required: UUID of the draft
content: string; // Required: New content
}
`####
drafts_search
Search for drafts across all workspaces.`typescript
{
query: string; // Required: Search query
}
`$3
####
drafts_add_tags
Add tags to an existing draft.`typescript
{
uuid: string; // Required: UUID of the draft
tags: string[]; // Required: Array of tag names to add
}
`$3
####
drafts_list_actions
List all available Drafts actions.`typescript
// No parameters required
`####
drafts_run_action
Run a Drafts action on a specific draft.`typescript
{
draftUuid: string; // Required: UUID of the draft
actionName: string; // Required: Name of the action to run
}
`$3
####
drafts_flag
Flag or unflag a draft.`typescript
{
uuid: string; // Required: UUID of the draft
flagged: boolean; // Required: true to flag, false to unflag
}
`####
drafts_archive
Archive a draft.`typescript
{
uuid: string; // Required: UUID of the draft to archive
}
`####
drafts_trash
Move a draft to trash.`typescript
{
uuid: string; // Required: UUID of the draft to trash
}
`Example Usage
Here are some example prompts you can use with Claude or other AI assistants:
$3
`
"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'"
`$3
`
"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'"
`$3
`
"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"
`Development
$3
`bash
Clone the repository
git clone https://github.com/agiletortoise/drafts-mcp-server.git
cd drafts-mcp-serverInstall dependencies
npm installBuild
npm run buildTest with MCP Inspector
npm run inspector
`$3
`
drafts-mcp-server/
āāā src/
ā āāā index.ts # Main MCP server implementation
ā āāā drafts.ts # Drafts-specific operations
ā āāā applescript.ts # AppleScript execution utilities
āāā dist/ # Compiled JavaScript (generated)
āāā package.json
āāā tsconfig.json
āāā README.md
`$3
Use the MCP Inspector to test the server:
`bash
npm run inspector
`This opens a web interface where you can test each tool interactively.
Troubleshooting
$3
Make sure you've spelled the workspace name exactly as it appears in Drafts. Workspace names are case-sensitive.
$3
1. Check System Preferences > Security & Privacy > Privacy > Automation
2. Ensure your MCP client (Claude Desktop, Cursor, etc.) has permission to control Drafts
3. You may need to restart the client after granting permissions
$3
1. Ensure Drafts is installed and has been launched at least once
2. Try running a simple AppleScript manually to verify permissions:
`bash
osascript -e 'tell application "Drafts" to get name of first workspace'
`$3
This might indicate that AppleScript dictionary access isn't working. Check that:
- You're using the latest version of Drafts
- Your AppleScript dictionary is properly exposed in Drafts
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
1. Fork the repository
2. Create your feature branch (
git checkout -b feature/amazing-feature)
3. Commit your changes (git commit -m 'Add some amazing feature')
4. Push to the branch (git push origin feature/amazing-feature`)MIT License - see the LICENSE file for details.
- Model Context Protocol - The protocol specification
- Drafts - Where text starts
- Claude Desktop - AI assistant with MCP support
- Issues: GitHub Issues
- Drafts Support: Drafts Community
- MCP Documentation: MCP Docs