
Obsidian
STDIOMCP server connecting AI models with Obsidian knowledge base for note management
MCP server connecting AI models with Obsidian knowledge base for note management
English | 中文
This project implements a Model Context Protocol (MCP) server for connecting AI models with Obsidian knowledge bases. Through this server, AI models can directly access and manipulate Obsidian notes, including reading, creating, updating, and deleting notes, as well as managing folder structures.
Created by huangyihe
The MCP server provides the following comprehensive tools:
list_notes
: List notes in the Obsidian vault with optional folder filtering
recursive
parameter: Control whether to list files recursively in subdirectories (default: true)recursive: false
to list only files in the specified folder without subdirectoriesread_note
: Read the content of a specific note in the Obsidian vaultread_multiple_notes
: Read content from multiple notes simultaneously for batch processingcreate_note
: Create a new note in the Obsidian vault with full contentdelete_note
: Delete a note from the Obsidian vaultsearch_vault
: Advanced search across all file types with filename and content matchingmove_note
: Move or rename notes to new locations (supports all file types including PDFs)manage_folder
: Complete folder CRUD operations (create/rename/move/delete)update_note
: Enhanced Update content using text replacements OR precision insertion
^block-id
supportauto_backlink_vault
: 🔗 Auto Backlink Generation
[[note name]]
)notes_insight
: 🧠 AI-Powered Strategic Analysis ⭐ NEW
Choose the most suitable installation method based on your technical level and usage needs:
Method | Target Users | Advantages | Disadvantages |
---|---|---|---|
🎯 One-Click Install (DXT) | General users | Simplest, GUI configuration | Requires DXT-enabled client |
📦 Remote Install (NPM) | Node.js users | Auto-updates, no installation | Requires network connection |
🔧 Local Deploy | Advanced users | Offline use, full control | Manual updates required |
Suitable for: General users who want the simplest installation experience
Download the pre-built extension package: obsidian-mcp.dxt
Double-click the downloaded .dxt
file and the system will automatically install the extension. Then fill in the configuration interface:
/Users/username/Documents/MyVault
)27123
)Suitable for: Node.js developers who want automatic updates and version management
Simply add the following configuration to your MCP client config file:
Using npx (recommended, no pre-installation required):
{ "mcpServers": { "obsidian-mcp": { "command": "npx", "args": [ "@huangyihe/obsidian-mcp" ], "env": { "OBSIDIAN_VAULT_PATH": "/path/to/your/vault", "OBSIDIAN_API_TOKEN": "your_api_token", "OBSIDIAN_API_PORT": "27123" } } } }
Note: First run will automatically download the package, subsequent runs use cache, ensuring you always use the latest version.
Suitable for: Users who need customization, advanced control, or offline usage
Step 1: Global Install
npm install -g @huangyihe/obsidian-mcp
Step 2: MCP Client Configuration
{ "mcpServers": { "obsidian-mcp": { "command": "obsidian-mcp", "env": { "OBSIDIAN_VAULT_PATH": "/path/to/your/vault", "OBSIDIAN_API_TOKEN": "your_api_token", "OBSIDIAN_API_PORT": "27123" } } } }
Step 1: Clone Repository
git clone https://github.com/newtype-01/obsidian-mcp.git cd obsidian-mcp
Step 2: Install Dependencies
npm install
Step 3: Build Project
npm run build
Step 4: Configure Environment Variables
cp .env.example .env # Edit .env file with your configuration
Step 5: Start Server
npm start
Using Docker Compose (Recommended)
# Configure environment variables cp .env.example .env # Edit .env file # Start service docker-compose up -d
Using Docker Command
# Build image docker build -t obsidian-mcp . # Run container docker run -d \ --name obsidian-mcp \ --env-file .env \ --network host \ -v $(OBSIDIAN_VAULT_PATH):$(OBSIDIAN_VAULT_PATH) \ obsidian-mcp
All installation methods require the following configuration:
OBSIDIAN_VAULT_PATH
: Path to your Obsidian vaultOBSIDIAN_API_TOKEN
: API token for Obsidian Local REST API pluginOBSIDIAN_API_PORT
: API port for Obsidian Local REST API (default: 27123)⚠️ Important: For remote NPM installation and global installation, you MUST use the OBSIDIAN_
prefix for environment variables. The variables VAULT_PATH
, API_TOKEN
without the prefix will not work correctly.
The project includes a test script to verify server functionality:
node test-mcp.js
npm run dev
to run the server in development modesrc
directoryMIT
Pull Requests and Issues are welcome!