Obsidian CLI REST

unlisted

by Sébastien Dubois

Exposes Obsidian CLI commands as RESTful API endpoints and an MCP server for AI tool integration

6 starsUpdated 1mo agoMIT
View on GitHub

Obsidian CLI REST

Control your Obsidian vault programmatically. This plugin turns all Obsidian CLI commands into a local HTTP API and MCP server, letting you automate your workflow from scripts, tools, and AI assistants.

Why use this plugin?

  • Automate note-taking: Create, read, search, and modify notes from any script or tool
  • Connect AI assistants: Let Claude, ChatGPT, or other AI tools interact with your vault via MCP
  • Build integrations: Hook Obsidian into your existing workflow with standard HTTP requests
  • Stay secure: Localhost-only by default, API key authentication, granular command controls

Requirements

  • Obsidian desktop app (v1.4.0 or later)
  • Obsidian CLI enabled in Obsidian: Settings > General > Advanced > Command line interface

Installation

  1. Open Settings > Community plugins in Obsidian
  2. Search for Obsidian CLI REST
  3. Select Install, then Enable
  4. The server starts automatically on http://127.0.0.1:27124

Quick start

Copy your API key from Settings > Obsidian CLI REST > Security, then start making requests:

# List all files in your vault
curl -H "Authorization: Bearer YOUR_API_KEY" \
  http://127.0.0.1:27124/api/v1/cli/files

# Search your vault
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "http://127.0.0.1:27124/api/v1/cli/search?query=meeting+notes"

# Create a new note
curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"params": {"name": "My Note", "content": "Hello world"}}' \
  http://127.0.0.1:27124/api/v1/cli/create

# Read today's daily note
curl -H "Authorization: Bearer YOUR_API_KEY" \
  http://127.0.0.1:27124/api/v1/cli/daily/read

# Append to your daily note
curl -X POST \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"params": {"content": "- Task from my script"}}' \
  http://127.0.0.1:27124/api/v1/cli/daily/append

What you can do

The plugin exposes all CLI commands organized into categories:

CategoryExamples
FilesList, create, read, append, prepend, move, rename, delete
SearchFull-text search, search with context
PropertiesRead, set, and remove frontmatter properties
Daily notesOpen, read, append, prepend to daily notes
TagsList tags, get tag info
TasksList and manage tasks
LinksOutgoing links, backlinks, orphans, dead ends
TemplatesList, read, and insert templates
BookmarksList and add bookmarks
PluginsList, install, enable, disable, uninstall
ThemesList, set, install, uninstall
SyncStatus, history, restore
PublishStatus, publish, unpublish
WorkspacesList, save, load, delete layouts
And moreBases, CSS snippets, file history, word count...

Two ways to connect

REST API

Standard HTTP endpoints at /api/v1/cli/*. Use from any language or tool that can make HTTP requests.

GET  /api/v1/cli/files           # Read-only commands use GET
POST /api/v1/cli/create          # Write commands use POST
DELETE /api/v1/cli/delete        # Delete commands use DELETE

CLI colons become slashes in URLs: property:set becomes /api/v1/cli/property/set.

MCP server

An MCP endpoint at /mcp for AI assistant integration. Uses the Code Mode pattern — just 2 tools (search and execute) enable progressive discovery of all commands, keeping the tool count fixed regardless of how many CLI commands exist.

  • search — Discover commands by name, description, or category
  • execute — Run any CLI command by name

Configure your MCP client with:

  • URL: http://127.0.0.1:27124/mcp
  • Transport: StreamableHTTP
  • Auth: Bearer token (your API key)

Security

The plugin is designed with security in mind:

  • Localhost only by default — only your machine can reach the server
  • API key authentication — auto-generated 64-character key, required for all CLI commands
  • Dangerous commands disabled — commands like eval, restart, and devtools are blocked unless you explicitly opt in
  • Per-command blocklist — block specific commands you don't want accessible
  • No shell injection — CLI commands use execFile, not exec

To expose the server on your network, change the bind address to 0.0.0.0 in settings. An API key is enforced in this mode.

Configuration

All settings are accessible from Settings > Obsidian CLI REST.

SettingDefaultDescription
Port27124HTTP server port
Bind address127.0.0.1127.0.0.1 (local) or 0.0.0.0 (network)
Auto-startOnStart server when plugin loads
REST APIOnEnable REST endpoints
MCP serverOnEnable MCP endpoint
Dangerous commandsOffAllow eval, restart, devtools, etc.
Blocked commands(none)Comma-separated list of commands to block
CORSOffAllow cross-origin requests
Request timeout30sMax CLI command execution time
Default vault(none)Fallback vault for requests without a vault parameter

Documentation

Support

License

MIT License — see LICENSE for details.

For plugin developers

Search results and similarity scores are powered by semantic analysis of your plugin's README. If your plugin isn't appearing for searches you'd expect, try updating your README to clearly describe your plugin's purpose, features, and use cases.