OmniFocus

by duquesnay

Not rated
GitHub

About

A professional MCP server for OmniFocus with smart caching and analytics to manage tasks and projects.

Details

Author
duquesnay
Categories
Productivity, Project Management

Setup

Install OmniFocus in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/duquesnay/omnifocus-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

Model Context Protocol for OmniFocus (incl. advanced features)

Disclaimer: pardon the stiffness of the documentation and commits language, the project is fully coded via Claude Code, ao many messages are either as fun as an accounting report (with random emphasis of a car salesman here and there).

A professional Model Context Protocol (MCP) server for OmniFocus that provides advanced task management capabilities with smart caching and analytics. Built with TypeScript and full respect for OmniFocus's official OmniAutomation API.

- Smart Caching: TTL-based caching system for optimal performance
- Type Safety: Full TypeScript support with comprehensive types
- Official API Only: Uses only OmniAutomation scripts (no database hacking)
- High Performance: Handles 1000+ tasks efficiently with intelligent caching

- list_tasks- Advanced task filtering with smart caching

- Filter by: completion status, flags, project, tags, dates, search terms
- Supports inbox filtering and availability checks
- Supports up to 1000 tasks with proper pagination metadata
- Results cached for 30 seconds for lightning-fast repeated queries

- Same filtering options as list_tasks
- Returns count only for performance

- create_task- Create new tasks in inbox

- Set name, note, flagged status, due/defer dates
- Tag assignment limited to existing tags
- Returns temporary ID (JXA limitation)

- Modify name, note, flagged status, dates
- Limited tag management due to JXA

- list_projects- List and filter projects with caching

- Filter by: status (active, on hold, dropped, completed), flags, folder
- Results cached for 5 minutes

- Automatically creates folders if they don't exist
- Set name, note, dates, flags, and parent folder

- Change name, note, status, dates, flags
- Folder movement supported with limitations (JXA constraint)

- Analytics tools (productivity stats, velocity tracking, overdue analysis)
- Tag management
- Bulk operations
- Smart search with natural language
- Recurring task analysis
- OmniFocus 3 or later installed on macOS
- Node.js 18+ installed
- Permission to access OmniFocus via automation (seePermissions Guide)

# Clone the repository git clone https://github.com/yourusername/omnifocus-cache-by-windsurf.git cd omnifocus-cache-by-windsurf # Install dependencies npm install # Build the project npm run build # Run the server npm start

The first time you use the MCP server, macOS will prompt you to grant permission to access OmniFocus. See thePermissions Guidefor detailed instructions.

Add to your Claude Desktop configuration file (~/Library/Application Support/Claude/claude_desktop_config.json):

{ "mcpServers": { "omnifocus": { "command": "node", "args": ["/path/to/omnifocus-cache-by-windsurf/dist/index.js"], "env": { "LOG_LEVEL": "info" } } } }

- LOG_LEVEL- Set logging level:error,warn,info,debug(default:info)

{ "tool": "list_tasks", "arguments": { "completed": false, "limit": 50 } }

Create a New Task with Project Assignment

// First, find the project ID { "tool": "list_projects", "arguments": { "search": "Budget Planning" } } // Returns: { "projects": [{ "id": "jH8x2mKl9pQ", "name": "Budget Planning 2024", ... }] } // Then create the task in that project { "tool": "create_task", "arguments": { "name": "Review Q4 budget", "projectId": "jH8x2mKl9pQ", // Use the ID from list_projects "dueDate": "2024-01-15T17:00:00Z", "flagged": true, "tags": ["finance", "urgent"], "estimatedMinutes": 30 } }
// Move an existing task to a different project { "tool": "update_task", "arguments": { "taskId": "abc123xyz", "projectId": "newProjectId" // Or null to move to inbox } }
{ "tool": "list_tasks", "arguments": { "completed": false, "dueBefore": "2024-01-01T00:00:00Z", "search": "budget" } }
{ "tool": "list_projects", "arguments": { "status": ["active"], "flagged": true } }
{ "tool": "create_project", "arguments": { "name": "New Website Launch", "note": "Complete redesign and launch", "folder": "Work Projects", // Creates folder if it doesn't exist "dueDate": "2024-03-31T17:00:00Z", "flagged": true } }
// First, get the project ID from list_projects { "tool": "list_projects", "arguments": { "search": "Website Launch" } } // Then update using the project ID { "tool": "update_project", "arguments": { "projectId": "jH8x2mKl9pQ", // Use the ID from list_projects "updates": { "folder": "Archive", // Note: Folder movement has JXA limitations "status": "onHold", "note": "Postponed until Q2" } } }

"Project not found" Errors with Numeric IDs

If you see errors likeProject with ID '547' not foundfollowed by a Claude Desktop bug warning:
-

Use list_projectsto get the correct full project ID:

{ "tool": "list_projects", "arguments": { "search": "your project name" } }

Copy the full alphanumeric ID(e.g.,"az5Ieo4ip7K") from the results

{ "tool": "update_task", "arguments": { "taskId": "your-task-id", "projectId": null // Move to inbox first } }

- Always get task IDs fromlist_tasksrather than guessing
- Uselist_projectsto verify project IDs before assignment
- Check that tasks exist and aren't in the trash

The server implements intelligent caching with different TTLs for different data types:

- Tasks: 30 seconds (frequently changing)
- Projects: 5 minutes (less volatile)
- Analytics: 1 hour (expensive computations)
- Tags: 10 minutes (relatively stable)

Cache is automatically invalidated on write operations.

All OmniFocus interactions use JavaScript for Automation (JXA) through OmniAutomation:

- Scripts are wrapped for error handling
- Parameters are safely escaped
- Results are typed and validated
- Batch operations are supported

The server provides detailed error messages with:

- Specific error types (NotFound, Permission, Script execution)
- Contextual information for debugging
- Graceful degradation when possible

- Node.js 18+
- OmniFocus 3+ (Pro recommended)
- macOS (required for OmniAutomation)

npm run build # Build TypeScript npm run dev # Watch mode npm run test # Run tests npm run lint # Lint code npm run typecheck # Type checking
src/ ├── cache/ # Smart caching system ├── omnifocus/ # OmniAutomation integration │ └── scripts/ # JXA script templates ├── tools/ # MCP tool implementations ├── utils/ # Logging and helpers └── index.ts # Server entry point

- Handles 1000+ tasks with sub-second response times
- Intelligent caching reduces OmniFocus API calls by 80%+
- Concurrent script execution for batch operations
- Memory-efficient with automatic cache cleanup

- No direct database access
- Parameters are sanitized before script execution
- Read-only operations by default
- No sensitive data is logged
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
-

Fix Unit Test Suite: Several unit tests are failing due to incorrect assumptions about the codebase. Priority areas:

- Update test expectations to match actual API response formats
- Align mock objects with real implementation interfaces
- Remove tests that verify incorrect behavior (e.g., expecting primaryKey to be a method when it's a property)

Add ESLint Configuration: The project is missing an ESLint configuration file which prevents linting from running. Create aneslint.config.jsthat supports TypeScript and follows the project's coding standards.

Improve Error Recovery: While the URL scheme fallback for permission-denied errors is a good start, consider:

- Implementing retry logic with exponential backoff
- Adding user-friendly error messages that suggest solutions
- Creating a diagnostic tool to help users troubleshoot permission issues

MIT License - see LICENSE file for details

To test the permission system with Claude Desktop:
-

Revoke Permissions(to test error handling):

- Open System Settings → Privacy & Security → Automation
- Find "Claude" (or "Electron" if Claude isn't listed)
- Uncheck the checkbox next to "OmniFocus"

- Ask Claude: "Can you list my OmniFocus tasks?"
- You should see a helpful error message with instructions to grant permissions

- Either click "OK" when the permission dialog appears
- Or manually enable in System Settings as instructed

- Ask Claude again to list your tasks
- Tasks should now be displayed correctly

# Build and test the server npm run build npm test # Test with MCP Inspector npx @modelcontextprotocol/inspector dist/index.js # Run integration tests node tests/integration/test-as-claude-desktop.js

CRITICAL ISSUE: Claude Desktop has a confirmed bug where it extracts numeric portions from alphanumeric project IDs when calling MCP tools.

Example: When you provide project ID"az5Ieo4ip7K", Claude Desktop may pass only"547"to the tool, causing "Project not found" errors.

- Task updates fail with "Project not found" errors
- Error messages show numeric IDs (like "547") instead of full alphanumeric IDs
- Occurs even when full project IDs are provided in prompts

- Our error messages now detect this pattern and provide helpful guidance
- Tool descriptions warn about using full alphanumeric IDs
- Consider using project names instead of IDs when this bug affects your workflow

Related Issues: This is part of broader Claude Desktop parameter processing bugs documented in GitHub issues, including type conversion failures and JSON parsing errors.

This project uses ES modules (ESM) with.jsextensions in import statements, which may seem unusual for TypeScript projects. This is required because:
- The MCP SDK (@modelcontextprotocol/sdk) is currently ESM-only
- There are known CommonJS compatibility issues (seeGitHub issue #217)

Future Migration: Once the MCP SDK adds proper CommonJS support, this project should migrate to standard TypeScript/CommonJS to remove the need for.jsextensions in imports.

- Model Context Protocol SDK
-
OmniAutomation
- TypeScript

Interact with task, doc, and project data in Dart, an AI-native project management tool

Remote MCP server for MeisterTask. Create and manage projects, tasks, and notes from your AI assistant. Hosted (streamable-HTTP) — connect at https://mcp.meistertask.com/mcp

The official Plane MCP server provides integration with Plane APIs, enabling full AI automation of Plane projects, work items, cycles and more.

Keep teams & agents coordinated automatically

From the creators of Wunderlist — the all-in-one task management app for to-do lists, notes, and projects. AI-powered productivity that replaces 5 apps.

Connect to the Taskade platform via MCP. Access tasks, projects, workflows, and AI agents in real-time through a unified workspace and API.

Official Taskeract MCP Server for integrating your Taskeract project tasks and load the context of your tasks into your MCP enabled app.

Manage your Todoist tasks and projects directly from your LLM.

Interact with Asana tasks, projects, workspaces, and comments using the Asana API.

Comprehensive Trello integration: 46 tools covering boards, cards, lists, labels, checklists, attachments, members, custom fields, and search. Read-only mode, image attachment auto-download. Active fork of kocakli/Trello-Desktop-MCP integrating contributions from across the Trello MCP fork ecosystem

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.