This Obsidian plugin extends the Local REST API plugin to expose todos/tasks via a REST endpoint using the Dataview plugin's API.
This plugin now includes an MCP (Model Context Protocol) server that lets AI assistants like Claude Desktop directly manage your Obsidian todos! See the mcp-server/ directory for installation and usage instructions.
- Obsidian installed
- Local REST API plugin installed and enabled
- Dataview plugin installed and enabled
- Download the latest release files (
main.js,manifest.json,styles.css) - Create a folder named
obsidian-todos-apiin your vault's.obsidian/plugins/directory - Copy the downloaded files into this folder
- Enable the plugin in Obsidian Settings β Community Plugins
- Ensure both Local REST API and Dataview plugins are enabled
- Clone this repository
- Run
npm installto install dependencies - Run
npm run buildto compile the plugin - Copy
main.js,manifest.json, andstyles.cssto your vault's.obsidian/plugins/obsidian-todos-api/directory
curl http://localhost:27124/todos/-
completed- Filter by completion status (trueorfalse)curl "http://localhost:27124/todos/?completed=false" -
path- Filter by file path (partial match)curl "http://localhost:27124/todos/?path=Projects" -
tag- Filter by tag (partial match)curl "http://localhost:27124/todos/?tag=urgent"
curl "http://localhost:27124/todos/?completed=false&path=Work&tag=urgent"{ "count": 5, "tasks": [ { "task": true, "status": " ", "checked": false, "completed": false, "fullyCompleted": false, "text": "Complete project documentation", "path": "Projects/MyProject.md", "line": 15, "lineCount": 1, "link": { "path": "Projects/MyProject.md", "type": "file" }, "section": { "path": "Projects/MyProject.md", "subpath": "#Tasks", "type": "header" }, "tags": ["#work", "#urgent"], "outlinks": [], "due": "2025-10-30", "children": [] } ] }Each task includes the following fields from Dataview:
task: Alwaystruefor tasksstatus: Status character between brackets (for unchecked,xfor completed)checked: Whether the task has any non-space statuscompleted: Whether explicitly marked complete (xorX)fullyCompleted: Whether task and all subtasks are completetext: The task text contentvisual: Optional display text override
path: File path containing the taskline: Line number where task appearslineCount: Number of lines the task spansposition: Internal Obsidian position trackerlist: Line number of the list this item belongs toblockId: Optional block IDparent: Optional parent item line number
link: Link to the task locationsection: Link to containing sectiontags: Array of tags in the taskoutlinks: Links contained in the task
children: Array of subtasks (SListItem[])annotated: Whether task has metadata annotations
created: When the task was createddue: When the task is duecompletion: When the task was completedstart: When the task can be startedscheduled: When work on the task is scheduled
Any additional fields added through Dataview annotations will also be included.
# Install dependencies npm install # Run in development mode with hot reload npm run dev # Build for production npm run build # Bump version npm version patch|minor|majorThis plugin uses:
- Dataview API - for querying tasks
- Local REST API - for exposing HTTP endpoints
MIT
Contributions are welcome! Please feel free to submit a Pull Request.