Get the FREE Ultimate OpenClaw Setup Guide →

obsidian

A TypeScript MCP server for Obsidian supporting vault operations, graph analytics, advanced search, and semantic tools.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio connorbritain-obsidian-mcp-server npx -y @connorbritain/obsidian-mcp-server \
  --env OBSIDIAN_HOST="127.0.0.1" \
  --env OBSIDIAN_PORT="27124" \
  --env GRAPH_CACHE_TTL="300" \
  --env OBSIDIAN_API_KEY="your-api-key-here" \
  --env OBSIDIAN_PROTOCOL="https" \
  --env OBSIDIAN_VAULT_PATH="/path/to/your/vault" \
  --env OBSIDIAN_VAULTS_FILE="path/to/vaults.json" \
  --env OBSIDIAN_VAULTS_JSON="JSON string describing vaults" \
  --env OBSIDIAN_DEFAULT_VAULT="default-vault-id" \
  --env SMART_CONNECTIONS_PORT="your-port-if-used"

How to use

The Obsidian MCP Server provides a TypeScript-based interface to interact with your Obsidian vaults through a collection of tools. It enables core file operations (read, write, append, delete, and listing), access to periodic notes (daily/weekly/monthly) and recent changes, advanced filtering via JsonLogic, graph analytics (orphan detection, centrality, clustering, path finding), and semantic search integration through Smart Connections. You can target multiple vaults by specifying a vaultId with each tool call; if omitted, the server uses the default vault configured via OBSIDIAN_DEFAULT_VAULT or the first vault described in your vaults config. The MCP server exposes a suite of tools such as list_files_in_vault, get_file_contents, put_content, append_content, and delete_file, along with graph and semantic search capabilities, making it suitable for automation, vault analytics, and complex querying across vault data.

How to install

Prerequisites:

  • Node.js 18+ installed on your system
  • Access to an Obsidian vault with the Local REST API plugin enabled
  • Optional: Dataview, Periodic Notes, or Smart Connections plugins depending on features you need

Installation steps:

  1. Install the MCP server globally via npm: npm install -g @connorbritain/obsidian-mcp-server

  2. Verify installation: ensure the mcp server command is available (e.g., mcp obsidian) or follow the npm package docs for usage.

  3. Prepare vault configuration. Create an environment configuration (see mcp_config example) providing API keys, vault path, and any vaults JSON/file if using multi-vault mode.

  4. Run the MCP server using your preferred runner (e.g., npx or local build as described in the README): npx -y @connorbritain/obsidian-mcp-server

  5. If developing from source, clone the repo and build: git clone https://github.com/ConnorBritain/obsidian-mcp-server.git cd obsidian-mcp-server npm install npm run build

    Then run the built server as configured in mcp_config

Additional notes

Tips and notes:

  • Multi-vault support requires careful port management. Each vault’s Local REST API must listen on a unique port; update OBSIDIAN_VAULTS_JSON or OBSIDIAN_VAULTS_FILE accordingly.
  • The OBSIDIAN_API_KEY, OBSIDIAN_HOST, OBSIDIAN_PORT, and OBSIDIAN_VAULT_PATH variables drive connectivity to the Obsidian Local REST API; use OBSIDIAN_VAULTS_JSON or OBSIDIAN_VAULTS_FILE to manage multiple vaults.
  • If you encounter 401 Unauthorized during vault tests, verify the API key in your vault configuration matches what the Local REST API plugin expects.
  • The patch_content tool is currently disabled due to an API issue; use append_content or put_content for modifications.
  • When using the MCP client in npx mode, you can provide a JSON config with env vars to tailor per-vault behavior.

Related MCP Servers

Sponsor this space

Reach thousands of developers