home / mcp / obsidian mcp server
Provides an MCP interface to Obsidian via the Local REST API for vault read/write actions and commands.
Configuration
View docs{
"mcpServers": {
"fazer-ai-mcp-obsidian": {
"command": "bunx",
"args": [
"@fazer-ai/mcp-obsidian@latest"
],
"env": {
"OBSIDIAN_HOST": "localhost",
"OBSIDIAN_PORT": "27123",
"OBSIDIAN_API_KEY": "your-obsidian-api-key",
"OBSIDIAN_PROTOCOL": "http"
}
}
}
}You can run an MCP server that lets Claude or any MCP-compatible LLM interact with your Obsidian vault using Obsidian’s Local REST API. This server translates model requests into vault actions and returns results, enabling automation, summarization, search, and content manipulation inside Obsidian from your MCP client.
Set up your MCP client to talk to the Obsidian MCP server through a local or remote endpoint. You will authenticate with your Obsidian Local REST API key and then issue commands through the MCP interface. You can perform actions such as retrieving the active note, patching or appending content, listing files, running Obsidian commands, and performing vault-wide searches.
{
"mcpServers": {
"@fazer-ai/mcp-obsidian": {
"command": "bunx",
"args": ["@fazer-ai/mcp-obsidian@latest"],
"env": {
"OBSIDIAN_API_KEY": "your-obsidian-api-key"
}
}
}
}Environment variables control how the server connects to Obsidian. Use the following example in your environment file or directly in your MCP client configuration.
OBSIDIAN_API_KEY= # Obtain this from the Obsidian Local REST API settings
OBSIDIAN_PROTOCOL=http
OBSIDIAN_HOST=localhost
OBSIDIAN_PORT=27123 # Port the Local REST API plugin is bound toTwo ways to provide the Obsidian API key to the server exist. You can pass it directly in your MCP client configuration or supply it via an .env file placed in the working directory where the MCP server runs.
// claude_desktop_config.json
{
"mcpServers": {
"@fazer-ai/mcp-obsidian": {
"command": "bunx",
"args": ["@fazer-ai/mcp-obsidian@latest"],
"env": {
"OBSIDIAN_API_KEY": "your-obsidian-api-key"
}
}
}
}If you are developing locally, you can run a dev version directly from your source. The MCP server can be started with Bun so you can point to the source entry file.
# Development start example (local source)
bun /path/to/repo/src/index.ts
```
Note: open the MCP Inspector URL to monitor requests and logs in real time.Keep your Obsidian API key secure. Do not share your key in logs or configuration files that are publicly accessible. Use environment variables to protect sensitive values and restrict access to the MCP server. If you revoke or rotate the API key, update all clients accordingly.
If the server cannot reach Obsidian, verify that Obsidian is running with the Local REST API plugin enabled, the API key is valid, and the host/port match what you configured. Use the MCP Inspector tool to observe requests and logs as they flow through the server.
This MCP server exposes actions such as getting the active note, patching content, posting content, listing vault files, executing Obsidian commands, and performing searches across the vault. You can combine these actions in conversations with your MCP client to automate routine vault tasks.
Returns basic details about the Obsidian Local REST API server and your authentication status
Deletes the note that is currently active in the Obsidian UI
Retrieves the full content of the active note (Markdown or JSON view)
Inserts, replaces or prepends content in the active note relative to a heading, block reference, or front-matter field
Appends Markdown to the end of the active note
Replaces the entire body of the active note
Lists every command available in Obsidian’s command palette
Executes a specific Obsidian command by its ID
Opens the given file inside Obsidian (creates it if missing); optional flag to open in a new leaf
Deletes the current daily / weekly / monthly / quarterly / yearly note for the requested period
Returns the content of the current periodic note for the requested period
Inserts / replaces content in a periodic note relative to a heading, block reference, or front-matter field
Appends Markdown to the periodic note (creates it if it doesn’t exist)
Replaces the entire body of a periodic note
Runs a Dataview-DQL query across the vault and returns matching rows
Runs a JsonLogic query against structured note metadata
Performs a plain-text fuzzy search with optional surrounding context
Lists all files and directories at the root of your vault
Lists files and directories inside a specific folder of the vault
Deletes a specific file (or directory) in the vault
Retrieves the content of a file in the vault (Markdown or JSON view)
Inserts / replaces content in an arbitrary file relative to a heading, block reference, or front-matter field
Appends Markdown to a file (creates it if it doesn’t exist)
Creates a new file or replaces the entire body of an existing file