A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with your Obsidian vault. Access your notes, create content, manage tags, and search your knowledge base through natural conversation. - CRUD Operations: Create, read, update, and delete notes (with safety confirmation) - Write Modes: Overwrite, append, or prepend content - Batch Reading: Read multiple notes i
Add this skill
npx mdskills install smith-and-web/obsidian-mcp-serverComprehensive MCP server with extensive vault operations, excellent docs, and flexible deployment options
A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with your Obsidian vault. Access your notes, create content, manage tags, and search your knowledge base through natural conversation.
Run directly without installation:
VAULT_PATH=/path/to/your/vault npx @smith-and-web/obsidian-mcp-server
With options:
VAULT_PATH=/path/to/vault PORT=3001 COMPACT_RESPONSES=true npx @smith-and-web/obsidian-mcp-server
Using the pre-built image from GitHub Container Registry:
docker run -d \
--name obsidian-mcp \
-v /path/to/your/vault:/vault:rw \
-p 3001:3000 \
-e VAULT_PATH=/vault \
ghcr.io/smith-and-web/obsidian-mcp-server:latest
Or with Docker Compose:
Create a docker-compose.yml:
version: '3.8'
services:
obsidian-mcp:
image: ghcr.io/smith-and-web/obsidian-mcp-server:latest
container_name: obsidian-mcp
restart: unless-stopped
volumes:
- /path/to/your/vault:/vault:rw
ports:
- "3001:3000"
environment:
- VAULT_PATH=/vault
Start the server
docker-compose up -d
Verify it's running
curl http://localhost:3001/health
Install dependencies
npm install
Set environment variables
export VAULT_PATH=/path/to/your/vault
export PORT=3000
Start the server
npm start
# Or with auto-reload:
npm run dev
Add to your Claude Desktop config file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.jsonOption 1: Local server (via mcp-remote)
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:3001/sse"]
}
}
}
Option 2: Remote server with HTTPS
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://your-domain.com/sse"]
}
}
}
Option 3: Direct npx (runs server locally)
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": ["@smith-and-web/obsidian-mcp-server"],
"env": {
"VAULT_PATH": "/path/to/your/vault",
"PORT": "3001"
}
}
}
}
Add to your Cursor MCP settings (Settings → MCP):
Option 1: Connect to running server
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": ["-y", "mcp-remote", "http://localhost:3001/sse"]
}
}
}
Option 2: Run server directly
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": ["@smith-and-web/obsidian-mcp-server"],
"env": {
"VAULT_PATH": "/path/to/your/vault",
"PORT": "3001"
}
}
}
}
Any MCP-compatible client can connect using mcp-remote:
npx mcp-remote http://localhost:3001/sse
Or connect directly to the SSE endpoint at http://localhost:3001/sse.
| Tool | Description |
|---|---|
read-note | Read note contents (supports frontmatterOnly for efficiency) |
read-multiple-notes | Batch read multiple notes |
create-note | Create a new note |
edit-note | Replace note contents |
write-note | Write with modes: overwrite, append, or prepend |
delete-note | Delete a note (requires confirmation) |
move-note | Move/rename a note |
duplicate-note | Copy a note to a new location |
get-notes-info | Get file metadata without reading content |
| Tool | Description |
|---|---|
list-vault | List files and directories |
create-directory | Create a new directory |
delete-directory | Delete a directory (with recursive option) |
rename-directory | Rename/move a directory |
| Tool | Description |
|---|---|
get-frontmatter | Get YAML frontmatter as JSON |
update-frontmatter | Update frontmatter fields |
add-tags | Add tags to frontmatter or inline |
remove-tags | Remove tags from note |
list-tags | List all tags with counts |
find-notes-by-tag | Find notes with a specific tag |
search-missing-tag | Find notes missing a tag |
audit-tags | Audit folder for required tags |
| Tool | Description |
|---|---|
search-vault | Full-text search with context |
get-backlinks | Find notes linking to a note |
find-broken-links | Find unresolved wiki-links |
find-replace | Bulk find and replace |
| Tool | Description |
|---|---|
read-section | Read content under a heading |
append-to-section | Append to a section |
replace-section | Replace section content |
append-to-file | Append to end of file |
insert-at-marker | Insert at a text marker |
list-headings | List all headings in a note |
┌─────────────────┐ HTTPS/SSE ┌──────────────────┐
│ Claude Desktop │ ◄────────────────► │ MCP Server │
└─────────────────┘ │ (Express.js) │
└────────┬─────────┘
│
┌────────▼─────────┐
│ VaultManager │
│ (File System) │
└────────┬─────────┘
│
┌────────▼─────────┐
│ Obsidian Vault │
│ (Markdown) │
└──────────────────┘
obsidian-mcp-server/
├── src/
│ ├── index.ts # Express server entry point
│ ├── vault/
│ │ ├── VaultManager.ts # Core vault operations
│ │ └── frontmatter.ts # YAML parsing utilities
│ ├── tools/
│ │ ├── definitions.ts # MCP tool schemas
│ │ ├── handlers.ts # Tool execution logic
│ │ └── index.ts # Tool exports
│ ├── server/
│ │ ├── mcp.ts # MCP protocol handlers
│ │ └── middleware.ts # Express middleware
│ └── types/
│ └── index.ts # TypeScript type definitions
├── tests/ # Vitest unit tests
├── Dockerfile
├── docker-compose.yml
├── package.json
└── README.md
| Variable | Default | Description |
|---|---|---|
PORT | 3000 | Server port |
VAULT_PATH | /vault | Path to Obsidian vault |
COMPACT_RESPONSES | false | Enable minified response keys for 40-60% smaller responses |
API_KEY | (none) | API key for authentication. When set, requires Bearer token or query param |
| Endpoint | Method | Description |
|---|---|---|
/health | GET | Health check |
/sse | GET | SSE endpoint for MCP |
/sse | POST | Direct MCP protocol calls |
/message | POST | SSE transport messages |
The server supports optional API key authentication. When API_KEY is set, all /sse and /message endpoints require authentication. The /health endpoint remains public.
Set the API_KEY environment variable:
# Docker
docker run -d \
--name obsidian-mcp \
-v /path/to/vault:/vault:rw \
-p 3001:3000 \
-e VAULT_PATH=/vault \
-e API_KEY=your-secret-key \
ghcr.io/smith-and-web/obsidian-mcp-server:latest
# npx
API_KEY=your-secret-key VAULT_PATH=/path/to/vault npx @smith-and-web/obsidian-mcp-server
Clients can authenticate using either method:
Authorization Header (recommended):
Authorization: Bearer your-secret-key
Query Parameter:
/sse?api_key=your-secret-key
Claude Desktop / Cursor (via mcp-remote):
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": [
"-y", "mcp-remote",
"https://your-domain.com/sse?api_key=your-secret-key"
]
}
}
}
Direct npx with API key:
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": ["@smith-and-web/obsidian-mcp-server"],
"env": {
"VAULT_PATH": "/path/to/your/vault",
"API_KEY": "your-secret-key"
}
}
}
}
For remote access with SSL:
Add a Proxy Host:
obsidian.yourdomain.comobsidian-mcp (container name)3000SSL Tab: Request Let's Encrypt certificate
Advanced Tab (for SSE):
proxy_buffering off;
proxy_cache off;
proxy_set_header Connection '';
proxy_http_version 1.1;
chunked_transfer_encoding off;
# View logs
docker-compose logs -f obsidian-mcp
# Restart
docker-compose restart
# Rebuild
docker-compose up -d --build
# Check host mount
ls -la /path/to/your/vault
# Check container access
docker exec obsidian-mcp ls -la /vault
# Clone and install
git clone https://github.com/smith-and-web/obsidian-mcp-server.git
cd obsidian-mcp-server
make install
# Run with example vault
make dev
# Test connection
make test-connection
Run make help to see all available commands:
Development:
make install Install dependencies
make dev Run server with hot-reload
make start Run server in production mode
make test-connection Test server connectivity
Docker:
make docker-build Build Docker image
make docker-up Start Docker container
make docker-down Stop Docker container
make docker-logs View container logs
make docker-restart Restart container
make docker-shell Open shell in container
The repository includes a Bruno collection for testing all 31 tools.
./bruno/obsidian-mcplocal or remote environmentThe collection is organized by category:
health/ - Server health and tool listingnotes/ - Note CRUD operationsdirectories/ - Directory operationsfrontmatter/ - Frontmatter operationstags/ - Tag managementsearch/ - Search and find-replacelinks/ - Backlinks and broken linkssections/ - Section-based operationsAn example vault is included in ./examples/test-vault/ for development and testing. It includes sample notes with tags, links, and sections to test all features.
See CONTRIBUTING.md for guidelines.
MIT License - see LICENSE for details.
Install via CLI
npx mdskills install smith-and-web/obsidian-mcp-serverObsidian MCP Server is a free, open-source AI agent skill. A Model Context Protocol (MCP) server that enables AI assistants like Claude to interact with your Obsidian vault. Access your notes, create content, manage tags, and search your knowledge base through natural conversation. - CRUD Operations: Create, read, update, and delete notes (with safety confirmation) - Write Modes: Overwrite, append, or prepend content - Batch Reading: Read multiple notes i
Install Obsidian MCP Server with a single command:
npx mdskills install smith-and-web/obsidian-mcp-serverThis downloads the skill files into your project and your AI agent picks them up automatically.
Obsidian MCP Server works with Claude Code, Claude Desktop, Cursor, Vscode Copilot, Windsurf, Continue Dev, Gemini Cli, Amp, Roo Code, Goose. Skills use the open SKILL.md format which is compatible with any AI coding agent that reads markdown instructions.