JO

jfim/obsidian-tasks-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

15 stars 14 forks 质量 57 趋势 21

代理任务 MCP 服务器

概览

一个模式上下文协议(MCP)服务器,用于从markdown文件中提取并查询 Obsidian 任务. 被设计通过MCP协议与克洛德合作,使AI辅助任务管理成为可能. - 从 Obsidian 标记下文件提取任务,其格式与 Obsidian 任务插件兼容 - 识别已完成和待完成的任务 - 访问任务元数据包括: - 状态(完成/未完成) - 到期日期 - 排定日期 - 开始日期 - 创建日期 - 标记 - 优先级 - 重复规则 这个MCP服务器提供了以下工具: 从目录中的markdown文件中提取所有任务,通过子文件夹进行递归扫描。 - 路径(字符串,可选): 扫描 Markdown 文件的目录 。 如果没有指定,则默认为第一个允许的目录 。 JSON任务对象阵列,每个任务对象包含: 基于 Obsidian Tasks 查询语法搜索任务 。 应用多个过滤器寻找匹配的任务. - 路径(字符串,可选): 扫描 Markdown 文件的目录 .

概述(AI 翻译)

一个模式上下文协议(MCP)服务器,用于从markdown文件中提取并查询 Obsidian 任务. 被设计通过MCP协议与克洛德合作,使AI辅助任务管理成为可能.

□ 特性

  • 从 Obsidian 标记下的文件提取任务,其格式与 Obsidian 任务插件兼容
  • 确定已完成和有待完成的任务
  • 访问任务元数据,包括:
  • 状况(完成/未完成)
  • 到期日
  • 预定日期
  • 开始日期
  • 创建日期
  • 标记
  • 优先权
  • 重复规则

□ 工具

这个MCP服务器提供了以下工具:

QQ 列表 所有任务

从目录中的markdown文件中提取所有任务,通过子文件夹进行递归扫描。

** 投入参数:**

  • [[T0] (字符串,可选): 扫描 Markdown 文件的目录 。 如果没有指定,则默认为第一个允许的目录 。

** 返回:** JSON任务对象阵列,每个任务对象包含:

QQ 查询 任务

基于 Obsidian Tasks 查询语法搜索任务 。 应用多个过滤器寻找匹配的任务.

** 投入参数:**

  • [[T1] (字符串,可选): 扫描 Markdown 文件的目录 。 如果没有指定,则默认为第一个允许的目录 .

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 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 tasks
    • not done - Show incomplete tasks
  • Date filters (due):

    • Note on semantics: due today is an exact match (only tasks due exactly today). Use range operators to include earlier/later dates.
    • due today - Tasks due today
    • due 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-DD or due YYYY-MM-DD - Tasks due on a specific date
在 GitHub 查看完整 README

安装

npx @jfim/obsidian-tasks-mcp /path/to/obsidian/vault
新手?先看 mcpskill.org 教程 →

配置

{ "mcpServers": { "obsidian-tasks": { "command": "npx", "args": [ "@jfim/obsidian-tasks-mcp", "/path/to/obsidian/vault" ] } } }