The OmniFocus MCP server requires permission to access OmniFocus via AppleScript/JavaScript for Automation (JXA). This document explains how the permission system works and how to grant the necessary permissions.
When the MCP server starts, it automatically performs a non-blocking permission check to verify access to OmniFocus. This check:
- Attempts to connect to OmniFocus via AppleScript
- Caches the result to avoid repeated permission prompts
- Logs the permission status without blocking server startup
When you use any OmniFocus tool:
- The server checks if permissions have been granted
- If permissions are denied, it returns a helpful error message with instructions
- If permissions are granted, the tool executes normally
To improve performance and user experience:
- Permission status is cached after the first check
- If permission is granted, the cache is used indefinitely
- If permission is denied, the cache expires after 60 seconds (allowing retry)
- The cache is automatically cleared if a permission error occurs during execution
When you first use an OmniFocus command, macOS may automatically prompt you:
- A dialog will appear asking if you want to allow access to OmniFocus
- Click "OK" or "Allow" to grant permission
- The permission is saved permanently in System Settings
If you need to manually grant or verify permissions:
- Open System Settings (System Preferences on older macOS)
- Go to Privacy & Security > Automation
- Find your terminal application:
- Terminal.app
- iTerm2.app
- Visual Studio Code (if using integrated terminal)
- Or whatever app is running the MCP server
- Enable the checkbox next to OmniFocus
- Restart the MCP server if it was already running
If you see a permission error, the server will provide detailed instructions:
MCP error -32603: Permission denied: User needs to grant access to OmniFocus
To grant OmniFocus permissions:
1. Open System Settings (System Preferences on older macOS)
2. Go to Privacy & Security > Automation
3. Find your terminal application (Terminal, iTerm, or the app running this server)
4. Enable access to OmniFocus
5. If you don't see OmniFocus listed, try running a command and macOS will prompt you
Alternative: When you first use an OmniFocus command, macOS may show a permission dialog. Click "OK" to grant access.
Note: You may need to restart the MCP server after granting permissions.
If OmniFocus is not installed or cannot be found:
OmniFocus is not installed or cannot be found.
Please ensure:
1. OmniFocus is installed on your Mac
2. OmniFocus is located in /Applications/
3. You have OmniFocus 3 or later installed
If OmniFocus is installed in a different location, you may need to create an alias in /Applications/
If the permission check times out:
The permission check timed out.
This might happen if:
1. OmniFocus is starting up - please wait and try again
2. A dialog box is blocking OmniFocus
3. Your system is under heavy load
Please ensure OmniFocus is running normally and try again.
To test if permissions are working correctly:
- Build the project:
npm run build - Run the permission test:
npx tsx tests/test-permissions.ts
This will:
- Check current permission status
- Attempt to execute a simple OmniFocus script
- Display any error messages with instructions
The permission system is implemented in src/utils/permissions.ts and provides:
- PermissionsChecker: Singleton class that manages permission state
- withPermissionCheck: Middleware function that wraps OmniFocus operations
- Automatic retry: Clears cache on permission errors for retry
- Server Startup (
src/index.ts): Non-blocking permission check on startup - OmniAutomation (
src/omnifocus/OmniAutomation.ts): Permission check before script execution - Error Handling: Automatic cache invalidation on permission errors
- Permissions are managed by macOS at the system level
- Once granted, permissions persist until manually revoked
- No sensitive data is stored by the permission system
- Permission checks are lightweight and non-invasive
- Initial Setup: Grant permissions during initial setup to avoid interruptions
- Error Handling: Always check error messages for permission-related issues
- Terminal Apps: Use the same terminal app consistently to avoid re-granting permissions
- Updates: After macOS updates, you may need to re-grant permissions
Q: Why does the server need these permissions? A: OmniFocus doesn't provide a public API, so we use Apple's official automation framework (JXA) which requires user permission for security.
Q: Are permissions safe to grant? A: Yes, these are standard macOS automation permissions. The server only accesses OmniFocus data as requested by your commands.
Q: Can I revoke permissions later? A: Yes, you can revoke permissions anytime in System Settings > Privacy & Security > Automation.
Q: Do I need to grant permissions for each terminal app? A: Yes, macOS tracks permissions per application. If you switch terminal apps, you'll need to grant permissions again.