pymnifocus
Allows Gemini AI assistants (via Google AI Studio) to interact with OmniFocus for querying, adding, editing, and removing tasks and projects.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@pymnifocusShow my overdue tasks"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
pymnifocus
A Python toolkit for OmniFocus on macOS: an MCP server for AI assistant integration (Cursor, Claude, Gemini) and a standalone CLI query tool.
Inspired by themotionmachine/OmniFocus-MCP, rebuilt in Python with security hardening, a CLI, and PyPI packaging.
Prerequisites
macOS with OmniFocus installed and running
Python 3.10+
uv (recommended) or pip
Related MCP server: OmniFocus MCP Server
Installation
# From PyPI
pip install pymnifocus
# Or with uv
uv pip install pymnifocus
# For development
git clone https://github.com/vdanen/pymnifocus.git
cd pymnifocus
uv sync
pip install -e .CLI Query Tool
Query OmniFocus directly from your terminal with pymnifocus-query:
# Shorthand flags
pymnifocus-query --overdue
pymnifocus-query --flagged --sort dueDate
pymnifocus-query --inbox
pymnifocus-query --due-within 7 --limit 10
pymnifocus-query --project "Weekly Review"
pymnifocus-query --tag work --tag urgent
pymnifocus-query --available --summary
pymnifocus-query --today
# JSON input (same format as MCP query_omnifocus tool)
pymnifocus-query '{"entity": "tasks", "filters": {"status": ["Overdue", "DueSoon"]}, "sortBy": "dueDate"}'
# Pipe from stdin
echo '{"entity": "projects", "filters": {"status": ["Active"]}}' | pymnifocus-query
# Other tools
pymnifocus-query --tags
pymnifocus-query --perspectives
pymnifocus-query --dump
# Raw JSON output (for scripting)
pymnifocus-query --overdue --jsonRun pymnifocus-query --help for full usage.
MCP Server
The MCP server enables AI assistants to interact with OmniFocus through natural language.
Running the Server
# Stdio transport (for Cursor/Claude/Gemini)
pymnifocus-server
# Or via module
python -m pymnifocusCursor Integration
Edit ~/.cursor/mcp.json:
{
"mcpServers": {
"omnifocus": {
"command": "pymnifocus-server"
}
}
}Or if using uv from a local clone:
{
"mcpServers": {
"omnifocus": {
"command": "uv",
"args": [
"run",
"--project",
"/path/to/pymnifocus",
"python",
"-m",
"pymnifocus.server"
]
}
}
}Restart Cursor or reload MCP servers (Cmd+Shift+P -> "MCP: Restart Servers").
Claude Code Integration
Same as above, just edit ~/.claude.json.
Claude Desktop Integration
Edit ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"omnifocus": {
"command": "pymnifocus-server"
}
}
}Restart Claude Desktop.
Google AI Studio / Gemini
For MCP-compatible Gemini clients, the server uses stdio transport by default:
Command:
pymnifocus-server
For Streamable HTTP (web-based clients):
python -c "from pymnifocus.server import mcp; mcp.run(transport='streamable-http')"Then connect to http://localhost:8000/mcp.
Available MCP Tools
Tool | Description |
| Query tasks, projects, or folders with filters |
| Get full OmniFocus database state |
| Add a new task |
| Add a new project |
| Remove a task or project |
| Edit a task or project |
| Add multiple items at once (max 100) |
| Remove multiple items at once (max 100) |
| List available perspectives |
| Get items from a perspective |
| List all tags with hierarchy |
MCP Resources
URI | Description |
| Current inbox items |
| Today's agenda (due, planned, overdue) |
| All flagged items |
| Database statistics |
| Tasks in a project |
| Items in a perspective |
Example Prompts
"Show me all flagged tasks due this week"
"Add a task 'Review quarterly report' to my Work project, due Friday"
"What's in my inbox?"
"List all my projects"
"Create a project called 'Website Redesign' with 3 tasks"
How It Works
The server communicates with OmniFocus using:
OmniJS scripts executed via JXA (
osascript -l JavaScript) for queries, dumps, perspectives, and tagsAppleScript for add/edit/remove operations
OmniFocus must be running for either the MCP server or the CLI tool to function.
Security
All user input is validated and escaped before embedding in generated scripts
Entity names, sort fields, and field names are whitelisted
Numeric parameters are validated as integers
AppleScript strings are sanitized against injection (quotes, backslashes, newlines)
Script paths are constrained to prevent directory traversal
Batch operations are capped at 100 items
Query results are capped at 5000 items
All communication is local (no network traffic)
License
MIT
Credits
Inspired by themotionmachine/OmniFocus-MCP. OmniJS scripts are adapted from that project.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/vdanen/pymnifocus'
If you have feedback or need assistance with the MCP directory API, please join our Discord server