Obsidian MCP Server
Allows interaction with an Obsidian vault, providing tools for file operations, wikilinks, backlinks, tags, frontmatter, callouts, embeds, Dataview queries, canvas files, templates, and advanced search.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Obsidian MCP Server
An MCP server (Model Context Protocol) that exposes tools for interacting with an Obsidian vault. This server provides comprehensive Obsidian functionality to LLMs and IDEs through the Model Context Protocol.
Quick Start (Production)
Using Docker Hub
The easiest way to get started is using the pre-built Docker image from Docker Hub:
# Pull the latest image
docker pull dthdyver/obsidian-mcp-server:latest
# Run with your Obsidian vault
docker run -d \
--name obsidian-mcp \
-p 8765:8765 \
-v /path/to/your/obsidian/vault:/vault:ro \
dthdyver/obsidian-mcp-server:latestProduction Deployment
For production deployments, use Docker Compose:
# docker-compose.yml
services:
obsidian-mcp:
image: dthdyver/obsidian-mcp-server:latest
ports:
- "8765:8765"
environment:
- VAULT_PATH=/vault
- PORT=8765
- MCP_PATH=/mcp
volumes:
- /path/to/your/obsidian/vault:/vault:ro
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8765/health"]
interval: 30s
timeout: 10s
retries: 3Deploy with:
docker-compose up -dConfigure Your MCP Client
Once running, configure your MCP client to connect to the server:
Cursor IDE:
{
"mcpServers": {
"obsidian-network": {
"url": "http://localhost:8765/mcp"
}
}
}Claude Desktop:
{
"mcpServers": {
"obsidian-network": {
"url": "http://localhost:8765/mcp"
}
}
}Related MCP server: Obsidian MCP Server
Features
File Operations
Create, read, update, delete files and directories
List files and markdown notes
Rename and move files/directories
Append content to files
Obsidian-Specific Features
Wikilinks: Generate wikilinks with display text, headings, and block references
Backlinks: Find all notes that link to a target
Tags: Add, remove, and list tags in notes
Frontmatter: Get, set, update, and remove YAML properties
Callouts: Generate callout blocks (note, warning, tip, etc.)
Embeds: Generate embeds with display text, headings, blocks, and sizing
Dataview: Execute Dataview queries (TABLE, LIST, TASK)
Canvas: Create canvas files with nodes and edges
Templates: Create, list, get, and apply templates with variable substitution
Advanced Search: Search with operators (file:, tag:, path:, content:)
Session Management
SQLite Session Store: Persistent session storage using SQLite database
Session Persistence: Sessions survive container restarts and reboots
Automatic Cleanup: Old sessions (24+ hours) are automatically cleaned up
Graceful Shutdown: Proper session cleanup on server shutdown
Available Tools
The server provides 23 tools covering Obsidian's core functionality:
File Operations: add_file, change_file, append_file, delete_file, delete_directory, get_file, list_files, list_notes, read_note, write_note, rename_file, move_file
Obsidian Features: create_wikilink, find_backlinks, manage_tags, search_advanced, manage_frontmatter, create_callout, create_embed, execute_dataview, create_canvas, manage_templates, search_notes
Example Usage
Once configured, you can ask your LLM to:
"Create a new note about project planning with frontmatter"
"Find all notes that link to 'meeting notes'"
"Generate a callout warning about the deadline"
"Create a canvas with connected nodes"
"Search for all tasks with high priority"
"Apply the meeting template with today's date"
Security Notes
The server runs with read-write access to your vault
Ensure proper firewall rules if exposing to network
Consider read-only mounts for production use
The server validates paths to prevent directory traversal
OAuth 2.1: Enable authentication for network deployments
HTTPS: Use HTTPS in production for OAuth endpoints
Token Security: Bearer tokens are validated on every request
Development
Prerequisites
Node.js 22+
Bun (package manager)
Docker and Docker Compose (for containerized runs)
SQLite3 (for session persistence)
Getting up and running
Create and
.envfile (copy.env.example)Ensure your deployment mounts the vault directory to the container path referenced by VAULT_PATH (default
/vault)Install dependencies
bun install
Run in dev (TypeScript via ts-node, source maps) using Docker
bun run dev
Type-check and build to
dist/bun run build
Follow docker logs (optional)
Session Persistence
The server uses SQLite to persist session data in the /data directory. This ensures that:
Sessions survive container restarts
Session data is not lost when the container is rebuilt
The database file is stored in
./data/sessions.dbon the host
To customize the database location, set the DB_PATH environment variable:
export DB_PATH=/custom/path/sessions.dbAccess from your network LLMs/clients:
Initialize: POST http://:${PORT}${MCP_PATH}
Open SSE stream: GET http://:${PORT}${MCP_PATH} (with Accept: text/event-stream)
Dockerized development (live reload)
Use the dev Compose overlay to run watch mode inside Docker, mounting your source and your local vault.
The container will run
bun installon start and thenbun run dev:watch.Source changes under src/ will trigger automatic restarts.
Your local vault at $HOST_VAULT is mounted read-only at $VAULT_PATH inside the container.
Environment
Basic Configuration
VAULT_PATH: Path the server treats as the vault root. Defaults to
/vault. Override for local dev or deployments as needed.
OAuth 2.1 Authentication (Optional)
The MCP server supports OAuth 2.1 authentication with multiple providers. Authentication is optional and can be enabled via environment variables.
Environment Variables
Variable | Description | Default | Required |
| Enable OAuth authentication |
| No |
| OAuth provider ( | - | Yes (if enabled) |
| OAuth client ID | - | Yes (if enabled) |
| OAuth client secret | - | Yes (if enabled) |
| OAuth issuer URL | - | Yes (if enabled) |
| OAuth scopes |
| No |
| OAuth redirect URI |
| No |
Provider-Specific Configuration
Google OAuth:
export AUTH_ENABLED=true
export AUTH_PROVIDER=google
export OAUTH_CLIENT_ID=your_google_client_id
export OAUTH_CLIENT_SECRET=your_google_client_secret
export OAUTH_ISSUER=https://accounts.google.com
export OAUTH_SCOPE=openid email profile
export OAUTH_REDIRECT_URI=http://localhost:8765/auth/callbackGitHub OAuth:
export AUTH_ENABLED=true
export AUTH_PROVIDER=github
export OAUTH_CLIENT_ID=your_github_client_id
export OAUTH_CLIENT_SECRET=your_github_client_secret
export OAUTH_ISSUER=https://github.com
export OAUTH_SCOPE=user:email
export OAUTH_REDIRECT_URI=http://localhost:8765/auth/callbackMicrosoft OAuth:
export AUTH_ENABLED=true
export AUTH_PROVIDER=microsoft
export OAUTH_CLIENT_ID=your_microsoft_client_id
export OAUTH_CLIENT_SECRET=your_microsoft_client_secret
export OAUTH_ISSUER=https://login.microsoftonline.com/common/v2.0
export OAUTH_SCOPE=openid email profile
export OAUTH_REDIRECT_URI=http://localhost:8765/auth/callbackGeneric OAuth Provider:
export AUTH_ENABLED=true
export AUTH_PROVIDER=generic-oauth
export OAUTH_CLIENT_ID=your_client_id
export OAUTH_CLIENT_SECRET=your_client_secret
export OAUTH_ISSUER=https://your-provider.com
export OAUTH_AUTHORIZATION_ENDPOINT=https://your-provider.com/oauth/authorize
export OAUTH_TOKEN_ENDPOINT=https://your-provider.com/oauth/token
export OAUTH_USERINFO_ENDPOINT=https://your-provider.com/oauth/userinfo
export OAUTH_SCOPE=openid email profile
export OAUTH_REDIRECT_URI=http://localhost:8765/auth/callbackOAuth Endpoints
When authentication is enabled, the server exposes these endpoints:
Authorization:
GET /auth- Redirects to OAuth providerCallback:
GET /auth/callback- Handles OAuth callbackUser Info:
GET /userinfo- Returns user information (requires Bearer token)Metadata:
GET /.well-known/oauth-authorization-server- OAuth metadata discoveryJWKS:
GET /.well-known/jwks.json- JSON Web Key Set
Usage with Authentication
Enable authentication by setting
AUTH_ENABLED=trueConfigure your OAuth provider with the appropriate environment variables
Start the server with authentication enabled
Access the MCP endpoint with a valid Bearer token:
# Get authorization URL
curl http://localhost:8765/auth
# After OAuth flow, use the access token
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"jsonrpc": "2.0", "method": "initialize", "params": {...}}' \
http://localhost:8765/mcpSecurity Notes
HTTPS Required: In production, always use HTTPS for OAuth endpoints
Token Validation: The server validates Bearer tokens on every request
Scope Validation: Ensure your OAuth scopes match your requirements
Redirect URI: Must be registered with your OAuth provider
Client Secrets: Store securely and never expose in logs or code
Health check
Local (after build):
bun run build && bun run health
or run directly without building: bun run health:dev
In Docker: the image defines a HEALTHCHECK. After
docker compose up, usedocker compose psto see health status. Logs include the JSON result from the health script.
Notes
This server provides comprehensive Obsidian functionality through the Model Context Protocol
All tools are thoroughly tested with API test cases covering all implemented tools
Supports most of Obsidian's core capabilities including linking, metadata, search, and visual features
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…
Search your Obsidian vault to quickly find notes by title or keyword, summarize related content, a…
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides a standardized interface for AI assistants to interact with Obsidian vaults through a local REST API, enabling reading, writing, searching, and managing notes.69MIT
- AlicenseBqualityNot gradedmaintenanceEnables AI assistants like Claude to read, search, create, and manage notes in Obsidian vaults, with features for link analysis, tag management, daily notes, templates, and optional Google Calendar integration. Provides comprehensive vault operations including batch updates, backlinks discovery, and secure file management with path traversal protection.311MIT
- AlicenseNot gradedqualityDmaintenanceEnables LLMs to read, search, and manage Obsidian vault markdown files, including YAML frontmatter, wikilinks, and graph operations through a secure stateless I/O layer.MIT
- AlicenseAqualityDmaintenanceEnables full Obsidian vault operations including reading, writing, searching, deleting notes, managing tags and links, with support for both local and remote access via stdio or HTTP transports.104,244 npm3MIT