obsidian-tasks-mcp
Enables AI assistants to extract and query Obsidian Tasks from markdown files, supporting task metadata and advanced filtering via Obsidian Tasks query syntax.
README
Obsidian Tasks MCP Server
A Model Context Protocol (MCP) server for extracting and querying Obsidian Tasks from markdown files. Designed to work with Claude via the MCP protocol to enable AI-assisted task management.
Features
- Extract tasks from Obsidian markdown files with a format compatible with the Obsidian Tasks plugin
- Identify completed and pending tasks
- Access task metadata including:
- Status (complete/incomplete)
- Due dates
- Scheduled dates
- Start dates
- Created dates
- Tags
- Priority
- Recurrence rules
Tools
This MCP server provides the following tools:
list_all_tasks
Extracts all tasks from markdown files in a directory, recursively scanning through subfolders.
Input Parameters:
path(string, optional): The directory to scan for markdown files. If not specified, defaults to the first allowed directory.
Returns: A JSON array of task objects, each containing:
{
"id": "string", // Unique identifier (filepath:linenumber)
"description": "string", // Full text description of the task
"status": "complete" | "incomplete", // Task completion status
"filePath": "string", // Path to the file containing the task
"lineNumber": "number", // Line number in the file
"tags": ["string"], // Array of tags found in the task
"dueDate": "string", // Optional - YYYY-MM-DD format
"scheduledDate": "string", // Optional - YYYY-MM-DD format
"startDate": "string", // Optional - YYYY-MM-DD format
"createdDate": "string", // Optional - YYYY-MM-DD format
"priority": "string", // Optional - "high", "medium", or "low"
"recurrence": "string" // Optional - recurrence rule
}
query_tasks
Searches for tasks based on Obsidian Tasks query syntax. Applies multiple filters to find matching tasks.
Input Parameters:
path(string, optional): The directory to scan for markdown files. If not specified, defaults to the first allowed directory.query(string, required): The query string using Obsidian Tasks query syntax. Each line is treated as a filter.
Returns:
A JSON array of task objects that match the query, with the same structure as list_all_tasks.
Supported Query Syntax:
-
Status filters:
done- Show completed tasksnot done- Show incomplete tasks
-
Date filters (due):
- Note on semantics:
due todayis an exact match (only tasks due exactly today). Use range operators to include earlier/later dates. due today- Tasks due todaydue before today- Tasks due before today (exclusive)due after today- Tasks due after today (exclusive)due on or before today- Tasks due today or earlier (inclusive)due on or after today- Tasks due today or later (inclusive)due on YYYY-MM-DDordue YYYY-MM-DD- Tasks due on a specific datedue before YYYY-MM-DD- Tasks due before a date (exclusive)due after YYYY-MM-DD- Tasks due after a date (exclusive)due on or before YYYY-MM-DD- Tasks due on/before a date (inclusive)due on or after YYYY-MM-DD- Tasks due on/after a date (inclusive)no due date- Tasks with no due datehas due date- Tasks with a due date
- Note on semantics:
-
Start date filters:
- Note on semantics:
starts todayis an exact match (only tasks that start today). Use range operators to include earlier/later dates. starts today- Tasks starting todaystarts on YYYY-MM-DDorstarts YYYY-MM-DD- Start on a specific datestarts before YYYY-MM-DD- Start before a date (exclusive)starts after YYYY-MM-DD- Start after a date (exclusive)starts on or before YYYY-MM-DD- Start on/before a date (inclusive)starts on or after YYYY-MM-DD- Start on/after a date (inclusive)no start date- Tasks with no start datehas start date- Tasks with a start date
- Note on semantics:
-
Tag filters:
no tags- Tasks with no tagshas tags- Tasks with at least one tagtag includes #tag- Tasks with tags containing "tag"tag does not include #tag- Tasks without tags containing "tag"
-
Path filters:
path includes string- Tasks in files with paths containing "string"path does not include string- Tasks in files with paths not containing "string"
-
Description filters:
description includes string- Tasks with descriptions containing "string"description does not include string- Tasks with descriptions not containing "string"
-
Priority filters:
priority is highest- Tasks with highest prioritypriority is high- Tasks with high prioritypriority is medium- Tasks with medium prioritypriority is low- Tasks with low prioritypriority is lowest- Tasks with lowest prioritypriority is none- Tasks with no priority
Example Query:
not done
due before 2025-05-01
tag include #work
This would return all incomplete tasks due before May 1, 2025, that have the #work tag.
Inclusive OR example (single line):
due on or before today OR starts on or before today
Usage
Installation
From npm (recommended):
# Install globally
npm install -g @jfim/obsidian-tasks-mcp
# Or use directly with npx without installing
npx @jfim/obsidian-tasks-mcp /path/to/obsidian/vault
From source:
git clone https://github.com/jfim/obsidian-tasks-mcp.git
cd obsidian-tasks-mcp
npm install
npm run build
Running the Server
Using npm package (recommended):
# If installed globally
obsidian-tasks-mcp /path/to/obsidian/vault
# Or with npx (no installation required)
npx @jfim/obsidian-tasks-mcp /path/to/obsidian/vault
From source:
node dist/index.js /path/to/obsidian/vault
Testing
To run the test suite:
npm test
See TESTING.md for detailed information about the test suite.
Using with Claude
Add this configuration to your Claude client that supports MCP:
{
"mcpServers": {
"obsidian-tasks": {
"command": "npx",
"args": [
"@jfim/obsidian-tasks-mcp",
"/path/to/obsidian/vault"
]
}
}
}
If you installed from source:
{
"mcpServers": {
"obsidian-tasks": {
"command": "node",
"args": [
"/path/to/obsidian-tasks-mcp/dist/src/index.js",
"/path/to/obsidian/vault"
]
}
}
}
Docker
Build the Docker image:
docker build -t @jfim/obsidian-tasks-mcp .
Run with Docker:
docker run -i --rm --mount type=bind,src=/path/to/obsidian/vault,dst=/projects/vault @jfim/obsidian-tasks-mcp /projects
Claude Desktop configuration:
{
"mcpServers": {
"obsidian-tasks": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"--mount", "type=bind,src=/path/to/obsidian/vault,dst=/projects/vault",
"@jfim/obsidian-tasks-mcp",
"/projects"
]
}
}
}
Task Format
The server supports both Obsidian Tasks emoji format and Dataview format for task metadata.
- Task syntax:
- [ ] Task description - Completed task:
- [x] Task description - Due date:
🗓️ YYYY-MM-DD📅 YYYY-MM-DD
- Scheduled date:
⏳ YYYY-MM-DD - Start date:
🛫 YYYY-MM-DD - Created date:
➕ YYYY-MM-DD - Priority:
⏫(high),🔼(medium),🔽(low) - Recurrence:
🔁 every day/week/month/etc. - Tags:
#tag1 #tag2
Example task: - [ ] Complete project report 🗓️ 2025-05-01 ⏳ 2025-04-25 #work #report ⏫
License
MIT License
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。