MCP server to interact with Obsidian via the Local REST API community plugin. The server implements multiple tools to interact with Obsidian: - listfilesinvault: Lists all files and directories in the root directory of your Obsidian vault - listfilesindir: Lists all files and directories in a specific Obsidian directory - getfilecontents: Return the content of a single file in your vault. - search
Add this skill
npx mdskills install MarkusPfundstein/mcp-obsidianComprehensive MCP server with 11 well-documented tools for Obsidian vault operations and excellent setup guides
1# MCP server for Obsidian23MCP server to interact with Obsidian via the Local REST API community plugin.45<a href="https://glama.ai/mcp/servers/3wko1bhuek"><img width="380" height="200" src="https://glama.ai/mcp/servers/3wko1bhuek/badge" alt="server for Obsidian MCP server" /></a>67## Components89### Tools1011The server implements multiple tools to interact with Obsidian:1213- list_files_in_vault: Lists all files and directories in the root directory of your Obsidian vault14- list_files_in_dir: Lists all files and directories in a specific Obsidian directory15- get_file_contents: Return the content of a single file in your vault.16- search: Search for documents matching a specified text query across all files in the vault17- patch_content: Insert content into an existing note relative to a heading, block reference, or frontmatter field.18- append_content: Append content to a new or existing file in the vault.19- delete_file: Delete a file or directory from your vault.2021### Example prompts2223Its good to first instruct Claude to use Obsidian. Then it will always call the tool.2425The use prompts like this:26- Get the contents of the last architecture call note and summarize them27- Search for all files where Azure CosmosDb is mentioned and quickly explain to me the context in which it is mentioned28- Summarize the last meeting notes and put them into a new note 'summary meeting.md'. Add an introduction so that I can send it via email.2930## Configuration3132### Obsidian REST API Key3334There are two ways to configure the environment with the Obsidian REST API Key.35361. Add to server config (preferred)3738```json39{40 "mcp-obsidian": {41 "command": "uvx",42 "args": [43 "mcp-obsidian"44 ],45 "env": {46 "OBSIDIAN_API_KEY": "<your_api_key_here>",47 "OBSIDIAN_HOST": "<your_obsidian_host>",48 "OBSIDIAN_PORT": "<your_obsidian_port>"49 }50 }51}52```53Sometimes Claude has issues detecting the location of uv / uvx. You can use `which uvx` to find and paste the full path in above config in such cases.54552. Create a `.env` file in the working directory with the following required variables:5657```58OBSIDIAN_API_KEY=your_api_key_here59OBSIDIAN_HOST=your_obsidian_host60OBSIDIAN_PORT=your_obsidian_port61```6263Note:64- You can find the API key in the Obsidian plugin config65- Default port is 27124 if not specified66- Default host is 127.0.0.1 if not specified6768## Quickstart6970### Install7172#### Obsidian REST API7374You need the Obsidian REST API community plugin running: https://github.com/coddingtonbear/obsidian-local-rest-api7576Install and enable it in the settings and copy the api key.7778#### Claude Desktop7980On MacOS: `~/Library/Application\ Support/Claude/claude_desktop_config.json`8182On Windows: `%APPDATA%/Claude/claude_desktop_config.json`8384<details>85 <summary>Development/Unpublished Servers Configuration</summary>8687```json88{89 "mcpServers": {90 "mcp-obsidian": {91 "command": "uv",92 "args": [93 "--directory",94 "<dir_to>/mcp-obsidian",95 "run",96 "mcp-obsidian"97 ],98 "env": {99 "OBSIDIAN_API_KEY": "<your_api_key_here>",100 "OBSIDIAN_HOST": "<your_obsidian_host>",101 "OBSIDIAN_PORT": "<your_obsidian_port>"102 }103 }104 }105}106```107</details>108109<details>110 <summary>Published Servers Configuration</summary>111112```json113{114 "mcpServers": {115 "mcp-obsidian": {116 "command": "uvx",117 "args": [118 "mcp-obsidian"119 ],120 "env": {121 "OBSIDIAN_API_KEY": "<YOUR_OBSIDIAN_API_KEY>",122 "OBSIDIAN_HOST": "<your_obsidian_host>",123 "OBSIDIAN_PORT": "<your_obsidian_port>"124 }125 }126 }127}128```129</details>130131## Development132133### Building134135To prepare the package for distribution:1361371. Sync dependencies and update lockfile:138```bash139uv sync140```141142### Debugging143144Since MCP servers run over stdio, debugging can be challenging. For the best debugging145experience, we strongly recommend using the [MCP Inspector](https://github.com/modelcontextprotocol/inspector).146147You can launch the MCP Inspector via [`npm`](https://docs.npmjs.com/downloading-and-installing-node-js-and-npm) with this command:148149```bash150npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-obsidian run mcp-obsidian151```152153Upon launching, the Inspector will display a URL that you can access in your browser to begin debugging.154155You can also watch the server logs with this command:156157```bash158tail -n 20 -f ~/Library/Logs/Claude/mcp-server-mcp-obsidian.log159```160
Full transparency — inspect the skill content before installing.