Get the FREE Ultimate OpenClaw Setup Guide →

obsidian-cli-rest

MCP server from dsebastien/obsidian-cli-rest

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio dsebastien-obsidian-cli-rest npx -y obsidian-cli-rest \
  --env API_KEY="Your API key for authenticating CLI commands (Bearer token)"

How to use

Obsidian CLI REST exposes your Obsidian vault as a local HTTP API and an MCP endpoint that can be consumed by AI assistants and automation tools. The REST API mirrors the Obsidian CLI commands, organized into categories like Files, Search, Properties, Daily notes, Tags, Tasks, Links, Templates, Bookmarks, Plugins, Themes, Sync, Publish, Workspaces, and more. You can list, read, create, modify, and query your vault via standard HTTP calls. The MCP endpoint provides a two-tool pattern (search and execute) for AI assistants to discover and run commands without needing to enumerate every CLI command.

To use the REST API, send HTTP requests to endpoints such as /api/v1/cli/files, /api/v1/cli/search, /api/v1/cli/create, or /api/v1/cli/daily/read. Each request requires an API key (Bearer token) and must be issued from a localhost-origin client by default. The MCP integration exposes /mcp with a streamable HTTP transport, where an AI agent can first use search to discover commands and then execute to run a chosen CLI action. When using MCP, remember that commands are exposed with per-command blocking and security considerations (no shell injection, localhost bind by default, and optional API key protection).

Supported flows include:

  • REST API usage for scripting and integrations via HTTP calls.
  • MCP usage where an AI assistant can discover relevant CLI commands using search and execute a selected command with the appropriate parameters.

How to install

Prerequisites:

  • Obsidian desktop app (v1.4.0 or later)
  • Obsidian CLI enabled in Obsidian (Settings > General > Advanced > Command line interface)
  • Node.js installed on the machine to use npx (recommended)

Installation steps:

  1. Ensure Obsidian is installed and the Obsidian CLI REST plugin is installed from Obsidian Settings > Community plugins.
  2. Install Node.js (if not already installed) to enable npx access: download from https://nodejs.org/ or use your system package manager.
  3. Start Obsidian and enable the Obsidian CLI REST plugin (Settings > Obsidian CLI REST > Enable).
  4. The server will start locally and listen on http://127.0.0.1:27124 by default.

Alternative quick-start using MCP (optional):

  • If you prefer to run via npm/npx, ensure Node.js is available, then run the following (once in your project or terminal):
# Start the MCP-enabled server via npx (as defined in mcp_config)
npx -y obsidian-cli-rest

Configure your MCP client to connect to http://127.0.0.1:27124/mcp with Transport: StreamableHTTP and Bearer token authentication.

Additional notes

Tips and common considerations:

  • The server is localhost-only by default for security. To expose it on the network, adjust Bind address in Obsidian CLI REST settings to 0.0.0.0.
  • An API key is required for all CLI commands. Retrieve or regenerate your key from Settings > Obsidian CLI REST > Security.
  • Review the Default vault setting to ensure requests without an explicit vault parameter target the intended vault.
  • For MCP usage, the Code Mode pattern uses two tools: search (discover commands by name/description/category) and execute (run any CLI command by name). This keeps the tool count fixed regardless of the number of CLI commands.
  • Some dangerous CLI commands can be blocked or require explicit opt-in; ensure your environment aligns with your security posture.
  • If you encounter CORS or network issues, check REST API and MCP server settings, including port (27124 by default) and Bind address.

Related MCP Servers

Sponsor this space

Reach thousands of developers