swarogan535 downloadsMCP server that connects AI assistants to your vault via the local REST API.
A lightweight MCP (Model Context Protocol) server for Obsidian, built as a thin wrapper over the Obsidian REST API.
Also available as an Obsidian plugin with settings UI, auto-detection of obsidian-api, and one-click MCP server installation.
Zero npm dependencies. Node.js built-ins only.
search-replace for precise text substitutionsearch_vault_smart)execute_template and prompts)npx -y @swarogan/obsidian-mcp-rest
main.js, manifest.json, and styles.css from the latest release<vault>/.obsidian/plugins/obsidian-mcp-rest/ and place the files thereSet environment variables:
| Variable | Required | Default | Description |
|---|---|---|---|
OBSIDIAN_API_KEY |
Yes | — | Bearer token from plugin settings |
OBSIDIAN_REST_URL |
No | https://127.0.0.1:27124 |
Obsidian REST API URL |
OBSIDIAN_REQUEST_TIMEOUT_MS |
No | 30000 |
Request timeout in ms |
claude mcp add obsidian -e OBSIDIAN_API_KEY="your-api-key" -- npx -y @swarogan/obsidian-mcp-rest
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": ["-y", "@swarogan/obsidian-mcp-rest"],
"env": {
"OBSIDIAN_API_KEY": "your-api-key",
"OBSIDIAN_REST_URL": "https://127.0.0.1:27124"
}
}
}
}
get_server_info — API status (no auth required)get_active_file — read current file (markdown or JSON)update_active_file — replace entire contentappend_to_active_file — append contentpatch_active_file — patch heading/block/frontmatter or search-replace textdelete_active_file — delete current fileshow_file_in_obsidian — open file in Obsidian UIlist_vault_files — list directory contentsget_vault_file — read file by pathcreate_vault_file — create or overwrite fileappend_to_vault_file — append to filepatch_vault_file — patch heading/block/frontmatter or search-replace textdelete_vault_file — delete filesearch_vault — Dataview DQL or JsonLogic queriessearch_vault_simple — full-text search with contextsearch_vault_smart — semantic search (requires Smart Connections)execute_template — run Templater templates with argumentsfetch — download web content, convert HTML to markdownThe server supports MCP prompts capability:
.md files in Prompts/ directory with obsidian-mcp-rest-prompt tagtp.mcpTools.prompt(...) calls for argument definitionsnpm test
28 tests covering tools, prompts, client, UTF-8, PATCH operations, and stdio transport.
This MCP server communicates only with the local Obsidian REST API (default 127.0.0.1:27124). It does not connect to any external services.
The fetch tool makes outbound HTTP requests only when explicitly invoked by the user.
If this project is useful to you and you'd like to support further development, you can do so on Ko-fi.