Obsidian MCP Server

Obsidian MCP Server

Enables AI assistants to interact with Obsidian vaults for creating, reading, searching, and managing notes, daily notes, TODOs, session reports, and backlinks through both stdio and HTTP/SSE transports.

Category
访问服务器

README

Obsidian MCP Server

An MCP (Model Context Protocol) server for integrating AI assistants with your Obsidian vault. Supports both stdio and HTTP/SSE transports for maximum compatibility.

Features

  • Session Reports: Automatically save coding session summaries with metadata
  • Note Management: Create, read, append, and search notes
  • Daily Notes Integration: Append to daily notes automatically
  • TODO Tracking: Create and manage TODOs with priorities and due dates
  • Backlink Discovery: Find notes that link to a specific note
  • Smart Linking: Get suggestions for related notes based on keywords
  • Dual Transport: Supports both stdio (direct) and HTTP/SSE (networked) modes

Quick Start with Docker (Recommended)

The easiest way to run the server is with Docker Compose:

# Clone the repository
git clone https://github.com/igorilic/obsidian-mcp.git
cd obsidian-mcp

# Create your environment file
cp .env.example .env

# Edit .env and set your vault path
# OBSIDIAN_VAULT_HOST_PATH=/path/to/your/obsidian/vault

# Start the server
docker compose up -d

# Verify it's running
curl http://localhost:9111/health

The server will be available at http://localhost:9111/mcp.

Installation (Local)

Prerequisites

  • Node.js 18+
  • npm or pnpm

Steps

git clone https://github.com/igorilic/obsidian-mcp.git
cd obsidian-mcp
npm install
npm run build

Client Setup

Claude Code (CLI)

Claude Code supports HTTP transport natively. Add to your global config at ~/.claude.json:

{
  "mcpServers": {
    "obsidian": {
      "type": "http",
      "url": "http://localhost:9111/mcp"
    }
  }
}

Or for stdio transport (direct, no Docker):

{
  "mcpServers": {
    "obsidian": {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/obsidian-mcp/dist/index.js"],
      "env": {
        "OBSIDIAN_VAULT_PATH": "/path/to/your/obsidian/vault"
      }
    }
  }
}

After adding, restart Claude Code or run /mcp to reconnect.


Claude Desktop

Claude Desktop only supports stdio transport, so use mcp-remote as a bridge for HTTP servers.

Config location:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json

For HTTP transport (with Docker):

{
  "mcpServers": {
    "obsidian": {
      "command": "npx",
      "args": ["-y", "mcp-remote", "http://localhost:9111/mcp"]
    }
  }
}

For stdio transport (direct, no Docker):

{
  "mcpServers": {
    "obsidian": {
      "command": "node",
      "args": ["/path/to/obsidian-mcp/dist/index.js"],
      "env": {
        "OBSIDIAN_VAULT_PATH": "/path/to/your/obsidian/vault"
      }
    }
  }
}

Restart Claude Desktop after changes.


Cursor

Cursor supports MCP servers with stdio, SSE, and HTTP transports.

Config location:

  • Global: ~/.cursor/mcp.json
  • Project: .cursor/mcp.json

For stdio transport:

{
  "mcpServers": {
    "obsidian": {
      "command": "node",
      "args": ["/path/to/obsidian-mcp/dist/index.js"],
      "env": {
        "OBSIDIAN_VAULT_PATH": "/path/to/your/obsidian/vault"
      }
    }
  }
}

For HTTP transport:

{
  "mcpServers": {
    "obsidian": {
      "url": "http://localhost:9111/mcp",
      "transport": "sse"
    }
  }
}

Or configure via UI: File → Preferences → Cursor Settings → MCP

Documentation: Cursor MCP Docs


Windsurf

Windsurf uses the same config format as Claude Desktop.

Config location: ~/.codeium/windsurf/mcp_config.json

{
  "mcpServers": {
    "obsidian": {
      "command": "node",
      "args": ["/path/to/obsidian-mcp/dist/index.js"],
      "env": {
        "OBSIDIAN_VAULT_PATH": "/path/to/your/obsidian/vault"
      }
    }
  }
}

Or configure via UI: Windsurf Settings → Cascade → Plugins

Documentation: Windsurf MCP Docs


Zed

Zed has built-in MCP support but currently only supports stdio transport (not HTTP).

Config location: ~/.config/zed/settings.json

{
  "context_servers": {
    "obsidian": {
      "command": {
        "path": "node",
        "args": ["/path/to/obsidian-mcp/dist/index.js"],
        "env": {
          "OBSIDIAN_VAULT_PATH": "/path/to/your/obsidian/vault"
        }
      }
    }
  }
}

To verify: Check the Agent Panel settings - a green indicator means the server is active.

Documentation: Zed MCP Docs


VS Code with Continue

Continue supports MCP servers via YAML configuration files.

Config location: Create .continue/mcpServers/obsidian.yaml in your workspace or home directory:

For stdio transport:

name: Obsidian MCP Server
version: 1.0.0
schema: v1
mcpServers:
  - name: obsidian
    command: node
    args:
      - /path/to/obsidian-mcp/dist/index.js
    env:
      OBSIDIAN_VAULT_PATH: /path/to/your/obsidian/vault

For HTTP transport:

name: Obsidian MCP Server
version: 1.0.0
schema: v1
mcpServers:
  - name: obsidian
    type: streamable-http
    url: http://localhost:9111/mcp

Documentation: Continue MCP Docs


VS Code with Cline

Cline supports both stdio and SSE transports.

Click the MCP Servers icon in Cline's top navigation → ConfigureAdvanced MCP Settings

For stdio transport:

{
  "mcpServers": {
    "obsidian": {
      "command": "node",
      "args": ["/path/to/obsidian-mcp/dist/index.js"],
      "env": {
        "OBSIDIAN_VAULT_PATH": "/path/to/your/obsidian/vault"
      }
    }
  }
}

For SSE/HTTP transport:

{
  "mcpServers": {
    "obsidian": {
      "url": "http://localhost:9111/mcp",
      "transport": "sse"
    }
  }
}

Documentation: Cline MCP Docs


JetBrains IDEs (IntelliJ, WebStorm, PyCharm, etc.)

JetBrains AI Assistant supports MCP servers starting from version 2025.1.

Setup via UI:

  1. Go to Settings → Tools → AI Assistant → Model Context Protocol (MCP)
  2. Click + to add a new server
  3. Configure the server

For stdio transport:

{
  "command": "node",
  "args": ["/path/to/obsidian-mcp/dist/index.js"],
  "env": {
    "OBSIDIAN_VAULT_PATH": "/path/to/your/obsidian/vault"
  }
}

Note: MCP tools only work with "Codebase" mode enabled in the chat window.

Documentation: JetBrains MCP Docs


Generic HTTP Client

For any client supporting HTTP/SSE MCP transport:

  • Endpoint: http://localhost:9111/mcp
  • Health check: http://localhost:9111/health
  • Protocol: MCP over Streamable HTTP (SSE responses)
  • Required headers: Accept: application/json, text/event-stream

Example initialization request:

curl -X POST http://localhost:9111/mcp \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "initialize",
    "params": {
      "protocolVersion": "2024-11-05",
      "capabilities": {},
      "clientInfo": {"name": "my-client", "version": "1.0.0"}
    }
  }'

Transport Modes

HTTP/SSE Transport (Default for Docker)

Best for:

  • Multiple clients connecting simultaneously
  • Networked/remote access
  • Containerized deployments
# Using Docker
docker compose up -d

# Or manually
MCP_TRANSPORT=http MCP_HTTP_PORT=3000 node dist/index.js

Stdio Transport (Default for local)

Best for:

  • Direct integration with IDEs
  • Single client usage
  • Lower latency
OBSIDIAN_VAULT_PATH=/path/to/vault node dist/index.js

Available Tools

Tool Description
write_session_report Save coding session summaries with metadata
write_note Create or overwrite a note
append_to_note Append content to an existing note
append_to_daily_note Append to today's daily note
search_notes Search notes by content, tags, or folder
read_note Read a note's content and frontmatter
list_recent_notes List recently modified notes
find_backlinks Find notes linking to a specific note
create_todo Create a TODO item
link_notes Get suggestions for related notes

Tool Details

<details> <summary><code>write_session_report</code></summary>

{
  title: string;           // Short title (required)
  summary: string;         // Brief summary (required)
  details?: string;        // Detailed description
  files_changed?: string[]; // List of modified files
  next_steps?: string[];   // Follow-up TODOs
  tags?: string[];         // Tags for categorization
  project?: string;        // Project name
  folder?: string;         // Subfolder in Claude-Sessions
}

</details>

<details> <summary><code>write_note</code></summary>

{
  path: string;            // Relative path (required)
  content: string;         // Markdown content (required)
  title?: string;          // Note title
  tags?: string[];         // Tags
  frontmatter?: object;    // Additional frontmatter
}

</details>

<details> <summary><code>search_notes</code></summary>

{
  query: string;           // Search query (required)
  tags?: string[];         // Filter by tags
  folder?: string;         // Limit to folder
  limit?: number;          // Max results (default: 20)
}

</details>

<details> <summary><code>create_todo</code></summary>

{
  task: string;            // Task description (required)
  project?: string;        // Project tag
  priority?: string;       // "high" | "medium" | "low"
  due_date?: string;       // YYYY-MM-DD format
  context?: string;        // Additional context
  todo_file?: string;      // Target file (default: "TODOs.md")
}

</details>


Environment Variables

Variable Description Default
OBSIDIAN_VAULT_PATH Path to Obsidian vault Required
MCP_TRANSPORT Transport mode: stdio or http stdio
MCP_HTTP_PORT HTTP server port (when using http transport) 3000

Vault Structure

The server creates/uses this structure:

Your Vault/
├── Claude-Sessions/           # Session reports
│   ├── project-name/         # Per-project folders
│   │   └── 2024-01-15-1430-feature-complete.md
│   └── 2024-01-15-1200-quick-fix.md
├── Daily Notes/              # Daily notes (configurable)
│   └── 2024-01-15.md
└── TODOs.md                  # TODO items

Development

# Watch mode
npm run dev

# Build
npm run build

# Run with stdio
OBSIDIAN_VAULT_PATH=/path/to/vault npm start

# Run with HTTP
MCP_TRANSPORT=http npm start

# Docker build
docker compose build

# Docker logs
docker compose logs -f

Troubleshooting

"Server not initialized" error

The MCP client has a stale session. Solutions:

  • Claude Code: Run /mcp to reconnect
  • Claude Desktop: Restart the app
  • Docker: Run docker compose restart

Connection refused

Ensure the server is running:

curl http://localhost:9111/health

Permission denied writing notes

If using Docker, ensure the vault is mounted with write access (:rw not :ro) in your .env file.

MCP tools not appearing

  1. Check server logs: docker compose logs
  2. Verify configuration path is correct
  3. Restart your IDE/client
  4. For JetBrains: Ensure "Codebase" mode is enabled

Zed shows "Server not active"

Zed doesn't support HTTP transport yet. Use stdio configuration instead.


License

MIT

推荐服务器

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

官方
精选