Sponsored by Deepsite.site

MCP server for Obsidian (TypeScript + Bun)

Created By
fazer-ai7 months ago
MCP server for Obsidian (TypeScript + Bun)
Content

MCP server for Obsidian (TypeScript + Bun)

NPM Version

A Model-Context-Protocol (MCP) server that lets Claude (or any MCP-compatible LLM) interact with your Obsidian vault through the Local REST API community plugin – written in TypeScript and runnable with bunx.


✨ Components

Tools

Tool nameDescription
obsidian_statusReturns basic details about the Obsidian Local REST API server and your authentication status
obsidian_delete_activeDeletes the note that is currently active in the Obsidian UI
obsidian_get_activeRetrieves the full content of the active note (Markdown or JSON view)
obsidian_patch_activeInserts, replaces or prepends content in the active note relative to a heading, block reference, or front-matter field
obsidian_post_activeAppends Markdown to the end of the active note
obsidian_put_activeReplaces the entire body of the active note
obsidian_get_commandsLists every command available in Obsidian’s command palette
obsidian_execute_commandExecutes a specific Obsidian command by its ID
obsidian_open_fileOpens the given file inside Obsidian (creates it if missing); optional flag to open in a new leaf
obsidian_delete_periodicDeletes the current daily / weekly / monthly / quarterly / yearly note for the requested period
obsidian_get_periodicReturns the content of the current periodic note for the requested period
obsidian_patch_periodicInserts / replaces content in a periodic note relative to a heading, block reference, or front-matter field
obsidian_post_periodicAppends Markdown to the periodic note (creates it if it doesn’t exist)
obsidian_put_periodicReplaces the entire body of a periodic note
obsidian_search_dataviewRuns a Dataview-DQL query across the vault and returns matching rows
obsidian_search_json_logicRuns a JsonLogic query against structured note metadata
obsidian_simple_searchPerforms a plain-text fuzzy search with optional surrounding context
obsidian_list_vault_rootLists all files and directories at the root of your vault
obsidian_list_vault_directoryLists files and directories inside a specific folder of the vault
obsidian_delete_fileDeletes a specific file (or directory) in the vault
obsidian_get_fileRetrieves the content of a file in the vault (Markdown or JSON view)
obsidian_patch_fileInserts / replaces content in an arbitrary file relative to a heading, block reference, or front-matter field
obsidian_post_fileAppends Markdown to a file (creates it if it doesn’t exist)
obsidian_put_fileCreates a new file or replaces the entire body of an existing file

See Obsidian's Local REST API specifications for more details.


Example prompts

# Summarize the latest “architecture call” note
# (Claude will transparently call list_files_in_vault → get_file_contents)
Get the contents of the last “architecture call” note and summarize them.

# Find all mentions of Cosmos DB
Search for all files where “Azure CosmosDb” is mentioned and explain the context briefly.

# Create a summary note
Summarize yesterday’s meeting and save it as “summaries/2025-04-24-meeting.md”. Add a short intro suitable for e-mail.

⚙️ Configuration

Obsidian REST API key

There are two ways to pass the Obsidian API key to the server:

  1. Server config (recommended) – pass it via the env field in your Claude (or other client) MCP-server declaration:
// 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"
      }
    }
  }
}

NOTE

Use @fazer-ai/mcp-obsidian@latest to ensure you always run the most up to date version of the server.

  1. Alternatively, you can use an .env file. Place the key in the .env you created above. Note it must be placed in the working directory where the MCP server is running.

Environment variables

You can use the .env.example file as reference to create your own .env file.

OBSIDIAN_API_KEY=   # Obtain this from the plugin settings in Obsidian
OBSIDIAN_PROTOCOL=http
OBSIDIAN_HOST=localhost
OBSIDIAN_PORT=27123 # Port the Local REST API plugin is bound to

🛠 Development

Running local version on Claude Desktop

After cloning this repo, you can update Claude's config to run your local version of the server instead of pulling from npm. This is useful for quickly testing changes before publishing.

NOTE

Keep in mind any changes you make on the code will only take effect after restarting the Claude Desktop app.

  1. Clone this repo and run bun install to install dependencies.
  2. Update your claude_desktop_config.json to point to your local version of the server:
// claude_desktop_config.json
{
  "mcpServers": {
    "@fazer-ai/mcp-obsidian": {
      "command": "bun",
      "args": ["/path/to/repo/src/index.ts"],
      "env": {
        "OBSIDIAN_API_KEY": "your-obsidian-api-key"
      }
    }
  }
}

IMPORTANT

Note we use bun instead of bunx here.

Debugging

MCP servers talk over stdio, so normal debuggers aren’t helpful.
Use the MCP Inspector:

npx @modelcontextprotocol/inspector bun /path/to/repo/src/index.ts

Open the URL it prints to step through requests (usually http://localhost:6274), inspect tool calls, and watch logs in real time.


📦 Publishing

  1. Update the version in package.json.
  2. Create GitHub release.
  3. Run bun publish.

License

MIT – see LICENSE.

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
ChatWiseThe second fastest AI chatbot™
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Amap Maps高德地图官方 MCP Server
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
WindsurfThe new purpose-built IDE to harness magic
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Playwright McpPlaywright MCP server
CursorThe AI Code Editor
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Tavily Mcp