
OmniFocus
io.github.steveardis由 GitHub 帳號 steveardis 發布v0.2.1更新於 Oct 24, 2026
Full CRUD MCP server for OmniFocus via Omni Automation — tasks, projects, folders, tags, recurrence.
概覽
讓助理在 macOS 上透過 Omni Automation 讀取與修改 OmniFocus 的任務、專案、檔案夾與標籤。
- 可以做什麼
- 透過完整的 Omni Automation JavaScript API 把 OmniFocus 暴露給助理,並以 osascript 在應用程式內執行 OmniJS 片段。讀取類工具可列出與取得專案、任務、檔案夾與標籤,支援篩選與數量上限,並提供 resolve_name 將名稱對應為穩定 ID。寫入類工具可建立、編輯、完成、丟棄、刪除與移動任務、專案、檔案夾與標籤,涵蓋日期、標籤、旗標、預估分鐘數與重複規則。
- 適用情境
- 適合讓助理管理 Mac 上真實的 OmniFocus 資料庫:收集與整理任務、檢視專案、調整截止或延後日期、清理檔案夾與標籤。適合想用對話方式操作 OmniFocus、而非手動點選的使用者。
- 執行需求
- 僅限 macOS,需在同一台機器上安裝並執行 OmniFocus,且需要 Node.js 20 或更新版本。npm 套件 @scardis/omnifocus-mcp 透過 stdio 在本機執行;未宣告帳號、API 金鑰或環境變數。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 OmniFocus,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
omnifocus-mcp
An MCP server for OmniFocus that exposes the full Omni Automation JavaScript API to LLM callers.
macOS only. Requires OmniFocus running on the same machine. The entire implementation runs OmniJS snippets inside OmniFocus via osascript -l JavaScript — no AppleScript string generation, no scripting dictionary limitations.
Prerequisites
- macOS (Omni Automation is macOS-only; the server will not start on other platforms)
- OmniFocus installed and running
- Node.js ≥ 20
Install
The package is published to npm as @scardis/omnifocus-mcp.
Via npx (no install required)
Add to your MCP client config (e.g. Claude Desktop claude_desktop_config.json):
From source
Then configure your MCP client:
Available Tools
Read
Write
Addressing model
Every entity returned by this server includes a stable id field (id.primaryKey from OmniFocus). Use this ID in subsequent calls rather than names. Names can be ambiguous; IDs are not.
If you have a name but not an ID, use resolve_name. It returns a list — if multiple candidates are returned, inspect the path field and ask the user to disambiguate before proceeding with any write operation.
Comparison with other OmniFocus MCP servers
Two notable alternatives exist: themotionmachine/OmniFocus-MCP and jqlts1/omnifocus-mcp-enhanced (a fork of the above with additional tools).
Scripting API. The alternatives use the JXA scripting dictionary or AppleScript to drive OmniFocus. This server makes a single JXA call — Application('OmniFocus').evaluateJavascript() — and runs all logic as OmniJS (Omni Automation) inside OmniFocus. This gives access to the full Omni Automation API surface (recurrence rules, review intervals, perspectives, forecast, attachments, URL automation, etc.) rather than the more limited scripting dictionary.
Argument injection. The alternatives construct osascript commands via string interpolation, which can break on apostrophes, quotes, backslashes, and unicode in names. This server serializes all arguments with JSON.stringify into a JS literal.
Entity addressing. The alternatives address entities primarily by name. This server returns a stable id (id.primaryKey) for every entity and provides resolve_name to map a name to ID candidates — returning all matches with full paths rather than silently picking one when names are ambiguous.
Full CRUD. This server supports creating, editing, completing, dropping, deleting, and moving tasks, projects, folders, and tags — plus repetition rules and OmniFocus 4's planned date.
Development
Publishing a new version is documented in RELEASING.md.
Testing
Unit tests (no OmniFocus required)
Integration tests
⚠️ Integration tests run against your real OmniFocus database.
Each test run creates a temporary top-level folder named
__MCP_TEST_<uuid>__and deletes it on teardown. If a test run is interrupted before teardown, run the cleanup script:
⚠️ Sync warning: By default, integration tests refuse to run if OmniFocus sync is enabled, to prevent test fixtures from propagating to your other devices. Disable OmniFocus sync first, or set
MCP_TEST_ALLOW_SYNC=1to opt in (fixtures will sync):
Clean up stale test fixtures
This removes any __MCP_TEST_*__ folders and orphaned __mcp_*__ projects/tags left in OmniFocus from interrupted test runs.
Contributing
Contributions are welcome! Here's how to get started:
- Fork and clone the repo
- Install dependencies:
npm install - Run unit tests (no OmniFocus needed):
npm test - Run integration tests (requires macOS + OmniFocus):
npm run test:integration
Before submitting a PR
npm run typecheck— must pass with no errorsnpm test— all unit tests must passnpm run test:integration— all integration tests must pass (macOS only)- Keep changes focused — one feature or fix per PR
Architecture overview
The server runs OmniJS snippets inside OmniFocus via osascript -l JavaScript. Each tool has three layers:
- Schema (
src/schemas/shapes.ts) — Zod schemas for input validation and output parsing - Snippet (
src/snippets/*.js) — OmniJS code that runs inside OmniFocus. Plain ES5 JavaScript (no imports, no TypeScript). Arguments are injected via__ARGS__placeholder. - Tool handler (
src/tools/*.ts) — Validates input, callsrunSnippet(), parses the result
When adding a new tool:
- Define input/output schemas in
src/schemas/shapes.tsand export fromsrc/schemas/index.ts - Create the OmniJS snippet in
src/snippets/ - Add the snippet name to
ALLOWED_SNIPPETSinsrc/runtime/snippetLoader.ts - Create the tool handler in
src/tools/and register it insrc/tools/index.ts - Add unit tests for schemas and integration tests that run against OmniFocus
Writing OmniJS snippets
Snippets run inside OmniFocus's JavaScript runtime, not Node.js. Key constraints:
- ES5-style JavaScript — use
var,function(){}, no arrow functions in older OmniFocus versions - No imports — all OmniJS globals (
flattenedTasks,flattenedProjects,moveTasks, etc.) are available directly - Return JSON — always
return JSON.stringify({ ok: true, data: ... }) - Error pattern — throw named errors (
NotFoundError,ValidationError) which the bridge catches and wraps
License
來源:README.md,提交 738bb19
工具
0版本歷史
1- v0.2.1最新Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分