@cardmagic/notes

@cardmagic/notes

CLI and MCP server to search and browse Apple Notes with fuzzy matching, full-text search, and PDF text extraction.

Category
访问服务器

README

@cardmagic/notes

CLI and MCP server to search and browse Apple Notes with fuzzy matching.

Features

  • Fuzzy search - Find notes even with typos using MiniSearch
  • Full-text search - Searches note titles, snippets, and body content
  • Create & delete notes - Manage notes via AppleScript automation
  • PDF text extraction - Automatically extracts and indexes text from PDF attachments
  • Folder browsing - List and filter notes by folder
  • Fast indexing - SQLite FTS5 + MiniSearch for quick searches across thousands of notes
  • Dual mode - Use as CLI tool or MCP server for Claude Code integration

Installation

Homebrew

brew install cardmagic/tap/notes

npm

npm install -g @cardmagic/notes

Claude Code Plugin (recommended)

Install as a plugin to get skills (auto-invoked) and slash commands:

# Add the marketplace
claude plugin marketplace add cardmagic/ai-marketplace

# Install the plugin
claude plugin install notes@cardmagic

This gives you:

  • Skill: Claude automatically searches notes when you ask about notes
  • Slash commands: /notes:search, /notes:recent, /notes:folders, and more

MCP Server

For direct MCP tool access without the plugin:

claude mcp add --transport stdio notes -- npx -y @cardmagic/notes --mcp

Or install globally first:

npm install -g @cardmagic/notes
claude mcp add --transport stdio notes -- notes --mcp

From source

git clone https://github.com/cardmagic/notes.git
cd notes
make install

# Then add as plugin OR MCP server:
claude plugin marketplace add cardmagic/ai-marketplace
claude plugin install notes@cardmagic
# OR
claude mcp add --transport stdio notes -- notes --mcp

Requirements

  • macOS - Reads from Apple Notes database
  • Full Disk Access - Terminal/IDE needs access to ~/Library/Group Containers/
  • pdftotext (optional) - For PDF text extraction
# Install pdftotext for PDF support
brew install poppler

Granting Full Disk Access

The tool needs to read your Notes database at ~/Library/Group Containers/group.com.apple.notes/:

  1. Open System Settings > Privacy & Security > Full Disk Access
  2. Click + and add your terminal app (Terminal.app, iTerm, Warp, etc.)
  3. Restart your terminal

CLI Usage

Search notes

# Fuzzy search
notes search "recipe chocolate"

# Filter by folder
notes search "taxes" --folder "2024"

# Limit results
notes search "meeting" --limit 5

# Filter by date
notes search "project" --after 2024-01-01

Browse notes

# Recent notes
notes recent
notes recent --limit 10

# List all folders
notes folders

# Notes in a specific folder
notes folder "Recipes"
notes folder "Work" --limit 20

Read a note

# Get note ID from search results, then read full content
notes read 12345

Create a note

# Create a new note in the default "Notes" folder
notes create "Meeting Notes" --body "Agenda items for today..."

# Create in a specific folder
notes create "Shopping List" --body "Milk, eggs, bread" --folder "Personal"

Delete a note

# Delete a note by title
notes delete "Old Meeting Notes"

# Delete from a specific folder (useful if multiple notes have the same title)
notes delete "Draft" --folder "Work"

Manage index

# Show index statistics
notes stats

# Update index (incremental - only processes changed notes)
notes index

# Force full rebuild
notes index --force

The index uses incremental updates by default:

  • Tracks modification timestamps to detect changed notes
  • Only reprocesses notes modified since last index
  • Detects and removes deleted notes
  • Much faster than full rebuild for small changes

Claude Code Plugin

When installed as a plugin, you get:

Skill (auto-invoked): Claude automatically searches notes when you ask things like:

  • "What's in my notes about recipes?"
  • "Find my notes about the project"
  • "Create a note about the meeting"
  • "Delete my draft notes"

Slash Commands:

Command Description
/notes:search <query> Fuzzy search with optional filters
/notes:recent Show recently modified notes
/notes:folders List all folders with note counts
/notes:folder "Name" List notes in a specific folder
/notes:read <id> Read full note content by ID
/notes:create <title> Create a new note
/notes:delete <title> Delete a note by title

MCP Server

Run as an MCP server for Claude Code integration:

notes --mcp

Available Tools

Tool Description
search_notes Fuzzy search through notes
recent_notes Get recently modified notes
read_note Read full note content by ID
list_folders List all folders with note counts
notes_in_folder List notes in a specific folder
get_note_stats Get index statistics
create_note Create a new note
delete_note Delete a note by title

Manual MCP Configuration

For Claude Desktop or VS Code, add to your MCP configuration:

{
  "mcpServers": {
    "notes": {
      "command": "npx",
      "args": ["-y", "@cardmagic/notes", "--mcp"]
    }
  }
}

PDF Text Extraction

PDF attachments in Notes are automatically extracted and indexed when:

  1. pdftotext is installed - brew install poppler
  2. PDF has been viewed - Notes caches PDFs locally when opened

The extracted text is appended to the note body, making PDF content fully searchable.

How it works

  • PDFs are cached at ~/Library/Group Containers/group.com.apple.notes/Library/Caches/Paper/
  • Each PDF bundle contains the file in Assets.bundle/
  • Text is extracted using pdftotext and indexed with the parent note

Limitations

  • PDFs stored only in iCloud (never opened locally) won't be indexed
  • Password-protected PDFs cannot be extracted
  • Scanned PDFs without OCR won't have searchable text

Data Locations

Data Path
Notes database ~/Library/Group Containers/group.com.apple.notes/NoteStore.sqlite
PDF cache ~/Library/Group Containers/group.com.apple.notes/Library/Caches/Paper/
Search index ~/.notes/index.db
Fuzzy index ~/.notes/fuzzy.json
Stats ~/.notes/stats.json

Development

# Clone and install
git clone https://github.com/cardmagic/notes
cd notes
pnpm install

# Build
pnpm build

# Watch mode
pnpm dev

# Link globally for testing
pnpm link --global

# Type check
pnpm typecheck

# Lint
pnpm lint

Project Structure

src/
├── index.ts        # Entry point - routes to CLI or MCP
├── cli.ts          # Commander-based CLI
├── mcp.ts          # MCP server implementation
├── applescript.ts  # AppleScript automation for create/delete
├── indexer.ts      # Builds search indexes from Notes database
├── searcher.ts     # Query engine with fuzzy matching
├── attachments.ts  # PDF text extraction
├── formatter.ts    # Terminal output formatting
└── types.ts        # TypeScript types and utilities

Privacy

This tool accesses your local Notes database for reading and uses AppleScript to create/delete notes. No data is sent externally. The search index is stored locally in ~/.notes/.

License

MIT

Author

Lucas Carlson

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选