# obsidian-mcp-server

> MCP Server

This repository provides a Model Context Protocol server for LLMs to interact with Obsidian vaults, offering secure API communication, file operations, and search capabilities for AI-powered knowledge management.

## Overview

- **Category:** Search & Knowledge
- **Language:** TypeScript
- **Stars:** 660
- **Forks:** 8
- **Owner:** cyanheads
- **GitHub:** https://github.com/cyanheads/obsidian-mcp-server
- **Homepage:** https://www.npmjs.com/package/obsidian-mcp-server
- **Created:** 2025-01-23T23:01:25+00:00
- **Updated:** 2025-03-27T11:14:52+00:00
- **Source:** https://model-context-protocol.com/servers/llm-obsidian-vault-knowledge-management

## Setup

## Setup

Note: Requires Node.js

1. Enable Local REST API plugin in Obsidian
2. Clone and build:

```bash
git clone git@github.com:cyanheads/obsidian-mcp-server.git
cd obsidian-mcp-server
npm install
npm run build
```

Or install from npm:

```bash
npm install obsidian-mcp-server
```

Add to your MCP client settings (e.g., `claude_desktop_config.json` or `cline_mcp_settings.json`):

```json
{
  "mcpServers": {
    "obsidian-mcp-server": {
      "command": "node",
      "args": ["/path/to/obsidian-mcp-server/build/index.js"],
      "env": {
        "OBSIDIAN_API_KEY": "your_api_key_here",
        "VERIFY_SSL": "false",
        "OBSIDIAN_PROTOCOL": "https",
        "OBSIDIAN_HOST": "127.0.0.1",
        "OBSIDIAN_PORT": "27124",
        "REQUEST_TIMEOUT": "5000",
        "MAX_CONTENT_LENGTH": "52428800",
        "MAX_BODY_LENGTH": "52428800",
        "RATE_LIMIT_WINDOW_MS": "900000",
        "RATE_LIMIT_MAX_REQUESTS": "200",
        "TOOL_TIMEOUT_MS": "60000"
      }
    }
  }
}
```

Environment Variables:

Required:

- `OBSIDIAN_API_KEY`: Your API key from Obsidian's Local REST API plugin settings

Connection Settings:

- `VERIFY_SSL`: Enable SSL certificate verification (default: false) # This must be set to false for self-signed certificates. If you are running locally or don't understand what this means, this should be set to false.
- `OBSIDIAN_PROTOCOL`: Protocol to use (default: "https")
- `OBSIDIAN_HOST`: Host address (default: "127.0.0.1")
- `OBSIDIAN_PORT`: Port number (default: 27124)

Request Limits:

- `REQUEST_TIMEOUT`: Request timeout in milliseconds (default: 5000)
- `MAX_CONTENT_LENGTH`: Maximum response content length in bytes (default: 52428800 [50MB])
- `MAX_BODY_LENGTH`: Maximum request body length in bytes (default: 52428800 [50MB])

Rate Limiting:

- `RATE_LIMIT_WINDOW_MS`: Rate limit window in milliseconds (default: 900000 [15 minutes])
- `RATE_LIMIT_MAX_REQUESTS`: Maximum requests per window (default: 200)

Tool Execution:

- `TOOL_TIMEOUT_MS`: Tool execution timeout in milliseconds (default: 60000 [1 minute])

## Tools

## Available Tools

1.  File Operations (Atomic file/directory operations with validation, resource monitoring and cleanup, error handling and graceful failure)
2.  Search System (Full-text search with configurable context, advanced JsonLogic queries, support for glob patterns and frontmatter fields)
3.  Property Management (YAML frontmatter parsing and intelligent merging, automatic timestamps, custom field support)
4.  Security & Performance (API key auth with rate limiting and SSL options, resource monitoring and health checks, graceful shutdown handling)
5.  `obsidian_list_files_in_vault` (List vault contents)
6.  `obsidian_list_files_in_dir` (List directory contents)
7.  `obsidian_get_file_contents` (Get file contents)
8.  `obsidian_find_in_file` (Text search with context)
9.  `obsidian_complex_search` (Advanced search with JsonLogic)
10. `obsidian_get_tags` (Get all tags in vault or directory)
11. `obsidian_append_content` (Append to file)
12. `obsidian_patch_content` (Update file content)
13. `obsidian_get_properties` (Get note properties)
14. `obsidian_update_properties` (Update note properties)
