home / mcp / obsidian mcp server
Obsidian Knowledge-Management MCP (Model Context Protocol) server that enables AI agents and development tools to interact with an Obsidian vault. It provides a comprehensive suite of tools for reading, writing, searching, and managing notes, tags, and frontmatter, acting as a bridge to the Obsidian Local REST API plugin.
Configuration
View docs{
"mcpServers": {
"cyanheads-obsidian-mcp-server": {
"command": "npx",
"args": [
"obsidian-mcp-server"
],
"env": {
"MCP_AUTH_MODE": "jwt",
"MCP_HTTP_HOST": "127.0.0.1",
"MCP_HTTP_PORT": "3010",
"OBSIDIAN_API_KEY": "YOUR_API_KEY_FROM_OBSIDIAN_PLUGIN",
"OBSIDIAN_BASE_URL": "http://127.0.0.1:27123",
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_ALLOWED_ORIGINS": "https://example.com,https://sub.example.com",
"MCP_AUTH_SECRET_KEY": "YOUR_SECRET_KEY_32+_CHARS",
"OBSIDIAN_VERIFY_SSL": "false",
"OBSIDIAN_ENABLE_CACHE": "true"
}
}
}
}You can empower AI agents and development tools to work directly with your Obsidian vault through an MCP server. This server exposes Obsidian functionality as MCP tools, enabling read, write, search, and management operations on your notes in a secure, scalable way. Use it to integrate Obsidian into AI workflows, IDE extensions, or external applications that need structured access to your vault.
Install the Obsidian MCP Server and connect it to your Obsidian vault so your AI agents can read, write, and manage notes through MCP tools.
You interact with the server by configuring an MCP client to run the server locally via stdio or remotely via HTTP. The server exposes a set of Obsidian tools that perform vault operations such as reading notes, updating content, searching, listing directories, and managing frontmatter and tags.
Use the provided environment variables to securely connect to the Obsidian Local REST API plugin, control caching behavior, and select the transport type. Ensure the Obsidian API key and base URL match your local Obsidian setup.
Prerequisites you must have before running the server.
Step-by-step setup and run flow.
1) Install dependencies and build the server if you are cloning from source.
2) Start the server using npm scripts or the local build output.
3) Point your MCP client to the server using the appropriate command and environment variables.
Key configuration enables secure communication with the Obsidian vault and performance improvements via an in-memory cache.
Environment variables control the connection to Obsidian, transport type, and cache settings.
The server supports two transport methods: stdio for local, high-control usage and http for remote integration.
The Obsidian MCP Server provides a suite of tools to interact with your vault. Each tool performs a specific operation on notes and vault metadata.
obsidian_read_note
obsidian_update_note
obsidian_search_replace
obsidian_global_search
obsidian_list_notes
obsidian_manage_frontmatter
obsidian_manage_tags
obsidian_delete_noteUse HTTPS in production and enable proper TLS verification where possible. Configure strong API keys and limit client permissions. The server includes safeguards for path case-insensitive fallbacks and explicit modification modes to avoid unintended data loss.
If you encounter connectivity or authentication issues, verify the Obsidian API key and base URL, confirm the Obsidian Local REST API plugin is running, and check that the cache is enabled if you rely on cached search results.
To connect a client, configure the environment with your Obsidian API key and base URL. Use the recommended non-encrypted HTTP URL for simplicity during initial setup.
{
"mcpServers": {
"obsidian-mcp-server": {
"command": "npx",
"args": ["obsidian-mcp-server"],
"env": {
"OBSIDIAN_API_KEY": "YOUR_API_KEY_FROM_OBSIDIAN_PLUGIN",
"OBSIDIAN_BASE_URL": "http://127.0.0.1:27123",
"OBSIDIAN_VERIFY_SSL": "false",
"OBSIDIAN_ENABLE_CACHE": "true"
},
"disabled": false,
"autoApprove": []
}
}
}Retrieves the content and metadata of a specified note. Returns content in markdown or json format, supports case-insensitive path fallback, and includes file stats.
Modifies notes using append, prepend, or overwrite operations. Can create files if they do not exist and target by path, active note, or periodic note.
Performs search-and-replace within a target note with support for string or regex search and options for case sensitivity, whole word matching, and replacing all occurrences.
Performs a vault-wide search with text or regex support. Can filter by path and modification date and supports pagination.
Lists notes and subdirectories within a vault folder, with filters for extension and name patterns and a formatted tree view.
Atomically manages a note's YAML frontmatter with get, set, or delete operations without rewriting the entire file.
Adds, removes, or lists tags for a note, handling both YAML frontmatter and inline tags.
Permanently deletes a specified note from the vault with safety fallbacks.