obsidian-cli-rest
Enables programmatic control of Obsidian vaults via REST API and MCP server for automation and AI assistant integration.
README
REST and MCP server
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
Community plugins (recommended)
- In Obsidian, go to Settings → Community plugins.
- Disable Restricted mode if it's enabled.
- Select Browse, search for REST and MCP server, install it, then enable it.
You can also browse the catalog on the Obsidian Community website.
Manual installation
If the plugin isn't listed in the community catalog yet (or you want a specific version):
- Download
main.js,manifest.json, andstyles.cssfrom the latest release. - Copy them into
<Vault>/.obsidian/plugins/cli-rest-mcp/. - Reload Obsidian and enable REST and MCP server in Settings → Community plugins.
BRAT (bleeding edge)
BRAT (Beta Reviewers Auto-update Tool) installs plugins straight from a GitHub repo and keeps them updated automatically. Use this if you want the latest commits — things might break.
- Install Obsidian42 - BRAT from Settings → Community plugins → Browse and enable it.
- Run BRAT: Add a beta plugin for testing from the command palette.
- Paste
https://github.com/dsebastien/obsidian-cli-rest. - Select the latest version and confirm.
- Enable REST and MCP server in Settings → Community plugins.
Once enabled, the server starts automatically on http://127.0.0.1:27124.
Quick start
Copy your API key from Settings > REST and MCP server > 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:
| Category | Examples |
|---|---|
| Files | List, create, read, append, prepend, move, rename, delete |
| Search | Full-text search, search with context |
| Properties | Read, set, and remove frontmatter properties |
| Daily notes | Open, read, append, prepend to daily notes |
| Tags | List tags, get tag info |
| Tasks | List and manage tasks |
| Links | Outgoing links, backlinks, orphans, dead ends |
| Templates | List, read, and insert templates |
| Bookmarks | List and add bookmarks |
| Plugins | List, install, enable, disable, uninstall |
| Themes | List, set, install, uninstall |
| Sync | Status, history, restore |
| Publish | Status, publish, unpublish |
| Workspaces | List, save, load, delete layouts |
| And more | Bases, 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 categoryexecute— 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, anddevtoolsare blocked unless you explicitly opt in - Per-command blocklist — block specific commands you don't want accessible
- No shell injection — CLI commands use
execFile, notexec
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 > REST and MCP server.
| Setting | Default | Description |
|---|---|---|
| Port | 27124 |
HTTP server port |
| Bind address | 127.0.0.1 |
127.0.0.1 (local) or 0.0.0.0 (network) |
| Auto-start | On | Start server when plugin loads |
| REST API | On | Enable REST endpoints |
| MCP server | On | Enable MCP endpoint |
| Dangerous commands | Off | Allow eval, restart, devtools, etc. |
| Blocked commands | (none) | Comma-separated list of commands to block |
| CORS | Off | Allow cross-origin requests |
| Request timeout | 30s | Max CLI command execution time |
| Default vault | (none) | Fallback vault for requests without a vault parameter |
Documentation
- User guide — Setup, usage, configuration, and troubleshooting
- API reference — Endpoints, request/response formats, status codes
- MCP integration — Setting up AI assistant connections
- Command reference — All supported commands
Support
- Issues: GitHub Issues
- Author: Sebastien Dubois
License
MIT License — see LICENSE for details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。