Sponsored by Deepsite.site

Obsidian Tasks MCP Server

Created By
jfim8 months ago
Obsidian tasks MCP server
Content

Obsidian Tasks MCP Server

npm version

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 tasks
    • not done - Show incomplete tasks
  • Date filters:

    • due today - Tasks due today
    • due before today - Tasks due before today
    • due after today - Tasks due after today
    • no due date - Tasks with no due date
    • has due date - Tasks with a due date
  • Tag filters:

    • no tags - Tasks with no tags
    • has tags - Tasks with at least one tag
    • tags include #tag - Tasks with tags containing "tag"
    • tags do 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 high - Tasks with high priority
    • priority is medium - Tasks with medium priority
    • priority is low - Tasks with low priority
    • priority is none - Tasks with no priority

Example Query:

not done
due before 2025-05-01
tags include #work

This would return all incomplete tasks due before May 1, 2025, that have the #work tag.

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

You can specify multiple directories:

npx @jfim/obsidian-tasks-mcp /path/to/obsidian/vault /another/directory

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/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 recognizes the following Obsidian Tasks format:

  • Task syntax: - [ ] Task description
  • Completed task: - [x] Task description
  • Due date: 🗓️ 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

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Serper MCP ServerA Serper MCP Server
Tavily Mcp
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
ChatWiseThe second fastest AI chatbot™
WindsurfThe new purpose-built IDE to harness magic
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
CursorThe AI Code Editor
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
DeepChatYour AI Partner on Desktop
Playwright McpPlaywright MCP server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Amap Maps高德地图官方 MCP Server