# Obsidian MCP Server
[Model Context Protocol (MCP)](https://modelcontextprotocol.io/) server for Obsidian vault integration. Enables AI assistants like Claude to read, write, search, and navigate your Obsidian notes.
## Features
- **Note CRUD**: Create, read, update, delete notes with frontmatter support
- **Search**: Full-text search with tag and folder filtering
- **Graph Navigation**: Explore links, backlinks, and note relationships
- **Daily Notes**: Quick access to daily notes with template support
- **Resources**: Expose vault notes as MCP resources
## Installation
```bash
git clone https://github.com/kirby-k-0723/obsidian-mcp.git
cd obsidian-mcp
npm install
npm run build
```
## Configuration
### Claude Code
Add to `~/.claude/settings.json`:
```json
{
"mcpServers": {
"obsidian": {
"command": "node",
"args": ["/path/to/obsidian-mcp/dist/index.js"],
"env": {
"OBSIDIAN_VAULT_PATH": "/path/to/your/vault"
}
}
}
}
```
### Claude Desktop
Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS):
```json
{
"mcpServers": {
"obsidian": {
"command": "node",
"args": ["/path/to/obsidian-mcp/dist/index.js"],
"env": {
"OBSIDIAN_VAULT_PATH": "/path/to/your/vault"
}
}
}
}
```
## Available Tools
| Tool | Description |
|------|-------------|
| `list_notes` | List all notes in vault with metadata (tags, links, backlinks) |
| `read_note` | Read note content and metadata |
| `create_note` | Create new note with optional frontmatter |
| `update_note` | Update existing note content |
| `delete_note` | Delete a note |
| `append_to_note` | Append content to existing note |
| `search_notes` | Search notes by content, with tag/folder filters |
| `get_backlinks` | Get all notes linking to a specific note |
| `get_graph` | Get note connection graph (links, backlinks, tags) |
| `get_daily_note` | Get today's or specific date's daily note |
| `create_daily_note` | Create daily note with optional template |
## Usage Examples
Once connected, you can ask Claude:
- "Show me all my notes tagged with #project"
- "Create a new note called 'Meeting Notes' with today's date"
- "What notes link to my 'Goals 2024' note?"
- "Search for notes mentioning 'machine learning'"
- "Add a task to today's daily note"
## Environment Variables
| Variable | Description | Default |
|----------|-------------|---------|
| `OBSIDIAN_VAULT_PATH` | Path to Obsidian vault | Required |
| `MODE` | Server mode: `stdio` or `sse` | `stdio` |
| `PORT` | HTTP port for SSE mode | `3847` |
## Development
```bash
# Development mode with hot reload
npm run dev
# Build TypeScript
npm run build
# Run production server
npm start
```
## Project Structure
```
src/
index.ts # MCP server entry point, tool handlers
types.ts # TypeScript type definitions
vault.ts # Vault filesystem operations
```
## License
ISC