MCP Obsidian Server

MCP Obsidian Server

Enables LLMs to interact with Obsidian vaults via the Local REST API plugin for comprehensive note management, file operations, and vault navigation. It supports creating and editing notes, executing Obsidian commands, and performing advanced searches using Dataview queries.

Category
访问服务器

README

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 name Description
obsidian_status Returns basic details about the Obsidian Local REST API server and your authentication status
obsidian_delete_active Deletes the note that is currently active in the Obsidian UI
obsidian_get_active Retrieves the full content of the active note (Markdown or JSON view)
obsidian_patch_active Inserts, replaces or prepends content in the active note relative to a heading, block reference, or front-matter field
obsidian_post_active Appends Markdown to the end of the active note
obsidian_put_active Replaces the entire body of the active note
obsidian_get_commands Lists every command available in Obsidian’s command palette
obsidian_execute_command Executes a specific Obsidian command by its ID
obsidian_open_file Opens the given file inside Obsidian (creates it if missing); optional flag to open in a new leaf
obsidian_delete_periodic Deletes the current daily / weekly / monthly / quarterly / yearly note for the requested period
obsidian_get_periodic Returns the content of the current periodic note for the requested period
obsidian_patch_periodic Inserts / replaces content in a periodic note relative to a heading, block reference, or front-matter field
obsidian_post_periodic Appends Markdown to the periodic note (creates it if it doesn’t exist)
obsidian_put_periodic Replaces the entire body of a periodic note
obsidian_search_dataview Runs a Dataview-DQL query across the vault and returns matching rows
obsidian_search_json_logic Runs a JsonLogic query against structured note metadata
obsidian_simple_search Performs a plain-text fuzzy search with optional surrounding context
obsidian_list_vault_root Lists all files and directories at the root of your vault
obsidian_list_vault_directory Lists files and directories inside a specific folder of the vault
obsidian_delete_file Deletes a specific file (or directory) in the vault
obsidian_get_file Retrieves the content of a file in the vault (Markdown or JSON view)
obsidian_patch_file Inserts / replaces content in an arbitrary file relative to a heading, block reference, or front-matter field
obsidian_post_file Appends Markdown to a file (creates it if it doesn’t exist)
obsidian_put_file Creates 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.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选