Obsidian MCP Server
Enables users to search, list, and read notes in an Obsidian vault via a CLI or HTTP API, integrating with Obsidian for note management.
README
Typescript MCP Server with Obsidian Integration
A command-line interface for interacting with your Obsidian vault.
Prerequisites
- Node.js 14.x or later
- npm or yarn
- An Obsidian vault
Setup
- Clone the repository
- Install dependencies:
npm install - Create a
.envfile in the project root with your Obsidian vault path:OBSIDIAN_VAULT_PATH=/path/to/your/obsidian/vault
Development
Starting and Stopping Services
Start All Services
To start the backend, frontend, and health data server simultaneously:
# From the project root directory
npm run dev
This will start:
- Backend server (default: http://localhost:3000)
- Frontend development server (default: http://localhost:5173)
- Health data server (default: http://localhost:8000)
Stop All Services
To stop all running services:
# From the project root directory
npm run stop
Manual Service Management
Backend Server
# Start backend server
cd server
npm run dev
Frontend Development Server
-
Navigate to the client directory:
cd client -
Install dependencies (if not already installed):
npm install -
Start the development server:
npm run dev
The application will be available at http://localhost:5173 by default.
Apple Health Data Server
The application includes a server to serve Apple Health data. Follow these steps to set it up:
- Ensure you have Python 3.8+ installed
- Install the required Python packages:
pip install -r requirements.txt - Start the server:
python server/main.py
The server will start on http://localhost:8000 by default.
API Endpoints
GET /- List all files and directories in the appleHealthData directoryGET /file/{path}- Get file contents or list directory contentsGET /docs- Interactive API documentation (Swagger UI)GET /redoc- Alternative API documentation (ReDoc)
For more details, see APPLE_HEALTH_SERVER.md.
Available Scripts
This project includes several npm scripts to help with development and testing:
Start the Server Application
npm start
Starts the application using ts-node. The server will be available at http://localhost:3000 by default (or the port specified in your environment variables).
Development Mode with Auto-Reload
npm run dev
Starts the application in development mode using nodemon, which automatically restarts the server when you make changes to any TypeScript file in the src directory.
Build the Project
npm run build
Compiles TypeScript files to JavaScript in the dist directory.
Run Tests
npm test
Runs the test suite (currently no tests are configured).
Run CLI Tool
# Run the CLI tool directly
npm run cli [command]
# Examples:
npm run cli list
npm run cli search "query"
npm run cli read "path/to/note.md"
Environment Variables
The application uses the following environment variables:
OBSIDIAN_VAULT_PATH: Path to your Obsidian vault (required)PORT: Port number for the server (default: 3000)
Create a .env file in the project root to set these variables:
OBSIDIAN_VAULT_PATH=/path/to/your/obsidian/vault
PORT=3000
Project Structure
src/- Source codetools/- MCP tool implementationsobsidian.ts- Obsidian vault integration
index.ts- Main application entry pointrouter.ts- API route definitionstypes.ts- TypeScript type definitions
dist/- Compiled JavaScript (created when runningnpm run build)test-obsidian.ts- Test script for Obsidian toolsrc/cli.ts- Command-line interface
CLI Usage
Getting Started
After setting up your environment, you can use the CLI tool to interact with your Obsidian vault. The tool provides three main commands: search, list, and read.
Search for Notes
Search for notes containing specific text:
# Basic search
npm run cli search "search query"
# Limit the number of results (default: 5)
npm run cli search "search query" -- --limit 10
# Example: Search for notes about "project management"
npm run cli search "project management"
Example output:
Searching for "project management" (max 5 results)...
1. Project Management Best Practices
Path: 01_Projects/Project Management Best Practices.md
Modified: 5/25/2025, 2:30:45 PM
Size: 12 KB
Project management is the practice of...
2. Team Meeting Notes
Path: 02_Meetings/Team Meeting Notes.md
Modified: 5/26/2025, 10:15:22 AM
Size: 8 KB
Discussed project management tools and...
List Notes in a Directory
List all notes in a specific directory:
# List notes in the root directory
npm run cli list
# List notes in a specific directory
npm run cli list "00_Slipbox"
# Limit the number of results (default: 10)
npm run cli list "00_Slipbox" -- --limit 5
# Example: List all notes in the "Projects" directory
npm run cli list "01_Projects"
Example output:
Listing notes in "01_Projects" (max 10 results)...
Directory: 01_Projects
Total files: 15
1. Project Alpha
Path: 01_Projects/Project Alpha.md
Modified: 5/20/2025, 3:45:12 PM
Size: 5 KB
2. Project Beta
Path: 01_Projects/Project Beta.md
Modified: 5/22/2025, 9:15:33 AM
Size: 3 KB
Read a Specific Note
View the content of a specific note:
# Read a note by its path relative to your vault root
npm run cli read "00_Slipbox/MyNote.md"
# Example: Read a note from a subdirectory
npm run cli read "01_Projects/Project Alpha/Meeting Notes.md"
Example output:
Reading note: 00_Slipbox/MyNote.md
My Note Title
Path: 00_Slipbox/MyNote.md
Modified: 5/26/2025, 11:00:00 AM
Size: 2 KB
--- CONTENT ---
# My Note
This is the content of my note...
- List item 1
- List item 2
- List item 3
--- END OF CONTENT ---
Global Installation (Optional)
For easier access, you can install the CLI globally:
# From the project directory
npm link
# Now you can use it from anywhere
obsidian-cli list
obsidian-cli search "query"
obsidian-cli read "path/to/note.md"
API Endpoints
If you prefer to use the HTTP API directly:
Search for notes
curl -X POST http://localhost:3000/api/tools/obsidian/search \
-H "Content-Type: application/json" \
-d '{"query": "project", "limit": 5}'
List notes in a directory
curl -X POST http://localhost:3000/api/tools/obsidian/list \
-H "Content-Type: application/json" \
-d '{"directory": "00_Slipbox", "limit": 10}'
Read a specific note
curl -X POST http://localhost:3000/api/tools/obsidian/read \
-H "Content-Type: application/json" \
-d '{"filePath": "00_Slipbox/SomeNote.md"}'
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。