macnotes-mcp

macnotes-mcp

A production-ready MCP server for macOS that provides async, cache-backed access and background queued writes to Apple Notes. It enables seamless integration for reading, creating, and managing notes through standard tools like ScriptingBridge while supporting background service execution.

Category
访问服务器

README

macnotes-mcp

macnotes-mcp is a fork of RhetTbull/macnotesapp focused on running Apple Notes as a production-ready MCP server.

It provides:

  • Async, cache-backed reads
  • Background queued writes to Apple Notes
  • macOS LaunchAgent service support
  • Easy integration with mcporter and OpenClaw

Fork Attribution

This project is forked from:

The original Python/CLI Notes automation remains available, and this fork adds MCP-first architecture and service tooling.

Requirements

  • macOS (Apple Notes automation is macOS-only)
  • Python 3.10-3.13
  • uv (recommended) for env/dependency management
  • Apple Notes.app installed and accessible

Optional:

  • mcporter for MCP client setup and testing
  • OpenClaw if you want agent integration

Quick Start

Clone and install:

git clone https://github.com/zorrobyte/macnotes-mcp.git
cd macnotes-mcp
uv sync

Run MCP over stdio:

uv run notes-mcp

Run MCP over local HTTP (streamable-http):

MACNOTES_MCP_TRANSPORT=streamable-http MACNOTES_MCP_HOST=127.0.0.1 MACNOTES_MCP_PORT=8765 uv run notes-mcp-daemon

Run as a macOS Background Service

Install as LaunchAgent:

./scripts/install_service.sh

Uninstall:

./scripts/uninstall_service.sh

Service details:

  • Label: com.zorrobyte.macnotes-mcp
  • Default endpoint: http://127.0.0.1:8765/mcp
  • Logs: ~/Library/Logs/macnotes-mcp/

Check service:

launchctl print "gui/${UID}/com.zorrobyte.macnotes-mcp"

Tail logs:

tail -f ~/Library/Logs/macnotes-mcp/launchd.stderr.log
tail -f ~/Library/Logs/macnotes-mcp/service.log

MCP Client Setup

mcporter + OpenClaw helper

Use the helper script:

./scripts/setup_mcporter.sh

This does two things:

  • Registers MCP server macnotes-mcp in ~/.mcporter/mcporter.json
  • Disables OpenClaw bundled apple-notes skill to avoid overlap

Custom server name/url:

./scripts/setup_mcporter.sh my-notes http://127.0.0.1:8765/mcp

Manual mcporter setup

mcporter config add macnotes-mcp --url http://127.0.0.1:8765/mcp --transport http --scope home
mcporter call macnotes-mcp.notes_health --json

MCP Tools

The server exposes:

  • notes_health
  • notes_accounts
  • notes_sync_full
  • notes_sync_incremental
  • notes_sync_status
  • notes_queue_status
  • notes_job_status
  • notes_job_wait
  • notes_list
  • notes_read
  • notes_create
  • notes_update
  • notes_delete
  • notes_move

Configuration

Config source priority:

  1. Environment variables
  2. ~/.config/macnotes-mcp/service.toml
  3. Built-in defaults

Example config template:

  • deploy/config/service.example.toml

Main environment variables:

  • MACNOTES_MCP_TRANSPORT = stdio | sse | streamable-http
  • MACNOTES_MCP_HOST (default 127.0.0.1)
  • MACNOTES_MCP_PORT (default 8000)
  • MACNOTES_MCP_MOUNT_PATH (default /)
  • MACNOTES_MCP_BOOTSTRAP_SYNC (default true)
  • MACNOTES_MCP_POLL_INTERVAL_SECONDS (default 120)
  • MACNOTES_MCP_CACHE_DB_PATH (optional override)
  • MACNOTES_MCP_LOG_LEVEL (default INFO)
  • MACNOTES_MCP_LOG_DIR (optional override)
  • MACNOTES_MCP_LOCK_PATH (optional override)

Architecture Summary

  • Source of truth: Apple Notes via ScriptingBridge/Apple Events
  • Cache: local SQLite for fast reads and search
  • Writes: queued background jobs for non-blocking behavior
  • Sync: bootstrap full sync + periodic refresh loop

Important:

  • Direct writes to Apple Notes private SQLite (NoteStore.sqlite) are not used.
  • This avoids corruption/sync issues from private schema assumptions.

Permissions and macOS Notes Automation

On first run, macOS may prompt for Automation permissions (Terminal/Python controlling Notes).

If calls fail:

  • Open System Settings -> Privacy & Security -> Automation
  • Ensure your invoking app/runtime is allowed to control Notes
  • Re-run service or command

Troubleshooting

Health check:

mcporter call macnotes-mcp.notes_health --json

If endpoint is unreachable:

  • Verify service is running with launchctl print ...
  • Confirm listener port 8765 is open
  • Check launchd.stderr.log and service.log

If sync is slow on first run:

  • Large Apple Notes libraries can take time for initial bootstrap
  • Use notes_sync_status to track cache size and sync state

If OpenClaw still uses old notes skill:

openclaw config set skills.entries.apple-notes.enabled false

Legacy CLI (from upstream)

This fork still includes upstream CLI entrypoints:

  • notes
  • macnotesapp Python API modules

The main focus of this fork is MCP service usage.

Development

Install dev environment:

uv sync

Run tests:

uv run pytest -v -s tests/

Run daemon locally:

uv run notes-mcp-daemon --transport streamable-http --host 127.0.0.1 --port 8765

License

MIT (same as upstream).

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选