mcp-obsidian-ek

mcp-obsidian-ek

MCP server providing tools to interact with Obsidian via the Local REST API community plugin.

Category
访问服务器

README

MCP server for Obsidian

Archived: This project is no longer actively maintained. The approach of routing through a REST API plugin adds unnecessary complexity -- Obsidian vaults are markdown files on disk, and working with them directly via Obsidian's native CLI is simpler and more reliable. This repo remains available as a reference.

MCP server providing tools to interact with Obsidian via the Local REST API community plugin.

Note: This is a maintained fork of MarkusPfundstein/mcp-obsidian.

Installation

1. Install the Obsidian Plugin

Install and enable the Local REST API community plugin in Obsidian. Copy the API key from the plugin settings.

2. Add to Your MCP Client

Add this server to your MCP client configuration. Examples for common clients:

Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "obsidian": {
      "command": "uvx",
      "args": ["mcp-obsidian-ek"],
      "env": {
        "OBSIDIAN_API_KEY": "<your_api_key_here>"
      }
    }
  }
}

Claude Code (~/.claude/settings.json):

{
  "mcpServers": {
    "obsidian": {
      "command": "uvx",
      "args": ["mcp-obsidian-ek"],
      "env": {
        "OBSIDIAN_API_KEY": "<your_api_key_here>"
      }
    }
  }
}

Tip: If uvx isn't found, use which uvx to get the full path and use that instead.

Environment Variables

Variable Required Default Description
OBSIDIAN_API_KEY Yes — API key from Local REST API plugin
OBSIDIAN_HOST No 127.0.0.1 Obsidian host address
OBSIDIAN_PORT No 27124 Obsidian REST API port

Requirements

Obsidian Plugin Required Notes
Local REST API Yes v3.0+ recommended
Periodic Notes Optional For weekly/monthly/quarterly/yearly (being removed in v1.0)
Dataview Optional For get_recent_changes tool (being removed in v1.0)

The core Daily Notes plugin (built into Obsidian) is sufficient for daily periodic notes.

v1.0 Goal: Zero community plugin dependencies beyond Local REST API. All features will work with core Obsidian only.

Tools

18 tools organized by functionality:

File & Content Operations

Tool Description
obsidian_list_files_in_vault List all files and directories in vault root
obsidian_list_files_in_dir List files in a specific directory
obsidian_get_file_contents Get content of a single file
obsidian_batch_get_file_contents Get contents of multiple files
obsidian_simple_search Text search across all files
obsidian_complex_search JsonLogic queries with glob/regexp
obsidian_append_content Append to a file
obsidian_patch_content Insert content relative to heading/block/frontmatter
obsidian_put_content Create or replace a file
obsidian_delete_file Delete a file or directory

Active Note & Periodic Notes

Tool Description
obsidian_get_active Get the currently open note
obsidian_get_periodic_note Get daily/weekly/monthly/quarterly/yearly note
obsidian_get_recent_periodic_notes Get recent periodic notes

Commands & UI

Tool Description
obsidian_get_commands List available Obsidian commands
obsidian_execute_command Execute a command by ID
obsidian_open_file Open a file in Obsidian UI

Advanced

Tool Description
obsidian_get_recent_changes Recently modified files (requires Dataview)
obsidian_dataview_query Execute DQL queries (requires Dataview)

Example Prompts

File operations:

  • "Get the contents of my last meeting note and summarize it"
  • "Search for all files mentioning 'project deadlines'"
  • "Create a new note called 'summary.md' with this content"

Active note & periodic notes:

  • "What note do I have open? Summarize it"
  • "Show me this week's weekly note"
  • "What did I write in my daily notes last week?"

Commands & UI:

  • "Open my project notes in a new tab"
  • "Show me all available Obsidian commands"

Advanced Features

Path Encoding

Handles filenames with spaces, special characters, Unicode, and emojis:

Projects/2024 Q1/meeting notes.md
Área/configuração/São Paulo.md
Research (2024)/data #1 & analysis.md
Projects/documentation/notes.md

Template-Aware Heading Insertion

When using obsidian_patch_content to insert content under a heading that doesn't exist, the heading is auto-created in the correct position based on your template structure.

How it works:

  1. Checks the note's frontmatter for a template: field
  2. Falls back to folder convention: Daily Notes/*.md uses Templates/Daily Notes.md
  3. Inserts new headings in template order (not appended to end)

Example: If your template has ## Todos, ## Notes, ## Journal and your note only has Todos and Journal, patching to "Notes" inserts it between them.

Parameters:

Parameter Default Description
create_heading_if_missing true Auto-create missing headings
template_path auto Explicit template path
use_template true Use template for positioning

Project Status

This fork is in active development (v0.x.x). The API may change before v1.0.0.

Current (v0.6.x)

  • 18 tools with ~30% reduced token footprint
  • Template-aware heading insertion
  • Robust path encoding
  • Published to PyPI as mcp-obsidian-ek

Planned for v1.0.0

  • [x] Streamlined tool surface
  • [x] Published to PyPI
  • [ ] Stable API contract
  • [ ] Comprehensive test coverage
  • [ ] No community plugin dependencies - remove Dataview requirement, use file metadata for recent changes
  • [ ] Periodic notes via folder conventions (no Periodic Notes plugin required)

Breaking Changes from v0.4.x

These convenience tools were removed (use get_active/get_periodic_note + file operations instead):

  • obsidian_post_active, obsidian_put_active, obsidian_patch_active, obsidian_delete_active
  • obsidian_post_periodic, obsidian_put_periodic, obsidian_patch_periodic, obsidian_delete_periodic

Contributing

See CONTRIBUTING.md for development setup, architecture overview, and how to add new tools.

<a href="https://glama.ai/mcp/servers/3wko1bhuek"><img width="380" height="200" src="https://glama.ai/mcp/servers/3wko1bhuek/badge" alt="MCP server for Obsidian" /></a>

推荐服务器

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选