Skip to main content
Glama
Obsidian MCP Server
by bazylhorsey

Obsidian MCP Server

Tests

A comprehensive Model Context Protocol (MCP) server for Obsidian that provides powerful vault access, knowledge graph analysis, and advanced integration features.

πŸ“š Documentation

Related MCP server: Obsidian MCP Server

Features

πŸ—‚οΈ Multi-Vault Support

  • Local Vaults: Direct file system access with real-time file watching

  • Remote Vaults: HTTP/REST API integration with automatic sync

  • Seamless switching between multiple vaults

πŸ”— Knowledge Graph

  • Build and analyze complete knowledge graphs from your notes

  • Find related notes based on links, tags, and content similarity

  • Analyze graph structure (hubs, orphan notes, clusters)

  • Suggest potential links between related notes

  • Path finding between notes

  • Full-text search across all notes

  • Filter by tags, folders, and metadata

  • Server-side and client-side search strategies

πŸ“ Note Operations

  • Read, create, update, and delete notes

  • Parse Obsidian-flavored markdown with frontmatter

  • Extract and track internal links, embeds, and tags

  • Automatic backlink generation

πŸ“Š Analytics

  • Vault statistics (note count, word count, link count)

  • Tag usage analysis

  • Folder structure insights

🎯 Obsidian Integration

  • Optional integration with community "Local REST API" plugin

  • Open notes directly in Obsidian app

  • Execute Obsidian commands

  • Create daily notes

  • Access to Obsidian URI protocol

  • Note: Requires plugin installation and app running locally

🎨 Canvas Support

  • Read and manipulate Obsidian Canvas files

  • Create and edit canvas nodes (file, text, link, group)

  • Manage canvas edges and connections

  • Full graph visualization support

  • Programmatic canvas generation

πŸ“Š Dataview Queries

  • SQL-like querying over your notes

  • Filter by frontmatter metadata and inline fields

  • Sort and group results

  • Field selection and aggregation

  • Support for complex WHERE clauses

  • Extract metadata from notes (frontmatter + inline fields)

πŸ“ Template System

  • Dynamic template rendering with variable substitution

  • Built-in date/time variables ({{date}}, {{time}}, {{weekday}}, etc.)

  • Custom variable support

  • Default values ({{variable|default}})

  • Date formatting ({{date:YYYY-MM-DD}})

  • Frontmatter merging

  • Create notes from templates programmatically

πŸ“… Periodic Notes

  • Daily, weekly, monthly, and yearly notes

  • Automatic date-based naming and organization

  • Custom templates for each note type

  • Date range calculations

  • List and query periodic notes

  • Configurable folder structure and formats

Architecture

The server is built with a clean, modular architecture:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚           MCP Server Layer              β”‚
β”‚  (Tools, Resources, Protocol Handling)  β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        Service Layer                     β”‚
β”‚  β€’ Knowledge Graph Service               β”‚
β”‚  β€’ Canvas Service                        β”‚
β”‚  β€’ Dataview Service                      β”‚
β”‚  β€’ Template Service                      β”‚
β”‚  β€’ Periodic Notes Service                β”‚
β”‚  β€’ Configuration Management              β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        Connector Layer (Adapters)        β”‚
β”‚  β€’ Local Vault Connector (File System)  β”‚
β”‚  β€’ Remote Vault Connector (HTTP API)    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
               β”‚
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚        Integration Layer                 β”‚
β”‚  β€’ Obsidian API Client                   β”‚
β”‚  β€’ Markdown Parser                       β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Key Design Patterns

  • Adapter Pattern: Abstract BaseConnector interface allows seamless switching between local and remote vaults

  • Service Layer: Separates business logic (knowledge graph) from data access

  • Configuration Management: Flexible config from files, environment, or defaults

  • Real-time Updates: File watchers for local vaults, periodic sync for remote

Installation

npm install
npm run build

Configuration

Create a obsidian-mcp.json configuration file:

{
  "vaults": [
    {
      "name": "my-local-vault",
      "type": "local",
      "path": "/path/to/obsidian/vault"
    },
    {
      "name": "my-cloud-vault",
      "type": "remote",
      "url": "https://your-sync-server.com/api",
      "apiKey": "your-api-key",
      "syncInterval": 60000
    }
  ],
  "obsidianApi": {
    "restApiUrl": "http://localhost:27124",
    "apiKey": "your-api-key",
    "vaultName": "my-local-vault"
  },
  "server": {
    "name": "obsidian-mcp-server",
    "version": "1.0.0"
  }
}

Vault Types Explained

Local Vault (type: "local")

  • Direct filesystem access to your Obsidian vault folder

  • Fastest performance, real-time file watching

  • Use this for vaults stored on your computer or mounted network drives

Remote Vault (type: "remote")

  • Connects to a self-hosted sync server via HTTP/REST API

  • For vaults hosted on your own cloud infrastructure (not Obsidian's sync service)

  • Examples: Custom REST API, CouchDB, WebDAV wrapper, etc.

  • Requires you to implement or use a compatible sync server

Obsidian API (Optional)

  • Only needed if you want to control the Obsidian desktop app

  • Requires the "Local REST API" community plugin in Obsidian

  • Enables: Opening notes in app, executing commands, accessing app features

  • NOT used for reading/writing vault content (use local/remote vaults for that)

Configuration via Environment Variables

Alternatively, use environment variables:

# Local vault
export OBSIDIAN_VAULT_PATH="/path/to/vault"
export OBSIDIAN_VAULT_NAME="my-vault"

# Remote vault
export OBSIDIAN_REMOTE_URL="https://your-sync-server.com/api"
export OBSIDIAN_REMOTE_NAME="cloud"
export OBSIDIAN_REMOTE_API_KEY="your-key"
export OBSIDIAN_SYNC_INTERVAL="60000"

# Obsidian API (optional)
export OBSIDIAN_API_URL="http://localhost:27124"
export OBSIDIAN_API_KEY="your-key"

Common Configuration Scenarios

Scenario 1: Just a local vault (most common)

{
  "vaults": [
    {
      "name": "personal",
      "type": "local",
      "path": "/home/user/Documents/ObsidianVault"
    }
  ]
}

Scenario 2: Local vault + iCloud/Dropbox (also use local type)

{
  "vaults": [
    {
      "name": "synced",
      "type": "local",
      "path": "/home/user/iCloud/ObsidianVault"
    }
  ]
}

Note: iCloud/Dropbox sync is handled by the cloud service itself - just point to the synced folder.

Scenario 3: Multiple local vaults

{
  "vaults": [
    {
      "name": "personal",
      "type": "local",
      "path": "/home/user/Documents/PersonalVault"
    },
    {
      "name": "work",
      "type": "local",
      "path": "/home/user/Documents/WorkVault"
    }
  ]
}

Scenario 4: Self-hosted remote server (advanced)

{
  "vaults": [
    {
      "name": "cloud",
      "type": "remote",
      "url": "https://your-server.com/obsidian-api",
      "apiKey": "your-api-key",
      "syncInterval": 60000
    }
  ]
}

Note: Requires you to implement or deploy a compatible REST API server.

Usage

Start the Server

npm start

Or use the binary:

node dist/index.js

Available MCP Tools

The server exposes the following tools through the MCP protocol:

Note Operations

  • get_note - Retrieve a note by path

  • search_notes - Search notes with filters

  • create_note - Create a new note

  • update_note - Update existing note

  • delete_note - Delete a note

Vault Information

  • get_vault_stats - Get vault statistics

  • list_tags - List all tags

  • list_folders - List all folders

Knowledge Graph

  • get_knowledge_graph - Get complete graph structure

  • get_related_notes - Find related notes

  • analyze_graph - Analyze graph structure

  • suggest_links - Suggest potential links

Canvas Operations

  • get_canvas - Read a canvas file

  • create_canvas - Create a new empty canvas

  • list_canvas_files - List all canvas files in vault

  • add_canvas_node - Add a node (file, text, link, or group)

  • add_canvas_edge - Add an edge/connection between nodes

  • delete_canvas_node - Delete a node from canvas

  • delete_canvas_edge - Delete an edge from canvas

Dataview Queries

  • dataview_query - Execute Dataview-style queries on notes

  • get_note_metadata - Get metadata for a specific note

  • get_unique_values - Get all unique values for a field

Template System

  • list_templates - List all available templates

  • render_template - Render a template with variables

  • create_from_template - Create a new note from a template

Periodic Notes

  • create_daily_note - Create or get daily note

  • create_weekly_note - Create or get weekly note

  • create_monthly_note - Create or get monthly note

  • create_yearly_note - Create or get yearly note

  • get_periodic_note_info - Get info about a periodic note

  • list_periodic_notes - List periodic notes in a date range

MCP Resources

All notes are exposed as resources with URIs:

obsidian://{vault-name}/{note-path}

Development

Project Structure

src/
β”œβ”€β”€ index.ts                      # Main MCP server
β”œβ”€β”€ types/                        # TypeScript type definitions
β”‚   β”œβ”€β”€ index.ts                 # Core types
β”‚   β”œβ”€β”€ canvas.ts                # Canvas types
β”‚   β”œβ”€β”€ dataview.ts              # Dataview types
β”‚   β”œβ”€β”€ template.ts              # Template types
β”‚   └── periodic.ts              # Periodic notes types
β”œβ”€β”€ connectors/                   # Vault connectors (adapters)
β”‚   β”œβ”€β”€ BaseConnector.ts
β”‚   β”œβ”€β”€ LocalConnector.ts
β”‚   └── RemoteConnector.ts
β”œβ”€β”€ services/                     # Business logic services
β”‚   β”œβ”€β”€ KnowledgeGraph.ts        # Knowledge graph analysis
β”‚   β”œβ”€β”€ CanvasService.ts         # Canvas file operations
β”‚   β”œβ”€β”€ DataviewService.ts       # Dataview query processing
β”‚   β”œβ”€β”€ TemplateService.ts       # Template rendering
β”‚   └── PeriodicNotesService.ts  # Periodic notes management
β”œβ”€β”€ api/                          # External API integrations
β”‚   └── ObsidianAPI.ts
└── utils/                        # Utilities
    β”œβ”€β”€ config.ts
    └── markdown.ts

Build

npm run build

Watch Mode

npm run watch

Integration with Obsidian

For advanced features, install the Obsidian Local REST API plugin:

  1. Install the plugin from Obsidian Community Plugins

  2. Enable the plugin and note the API key

  3. Configure the obsidianApi section in your config

Use Cases

For AI Assistants

  • Access and navigate your Obsidian knowledge base

  • Create and update notes based on conversations

  • Find related information across notes

  • Suggest connections between ideas

For Automation

  • Automated note creation and organization

  • Batch processing of notes

  • Knowledge graph analysis and visualization

  • Link maintenance and suggestions

For Integrations

  • Connect Obsidian with other tools via MCP

  • Build custom workflows

  • Create dashboards and reports

  • Sync with external systems

Advanced Features

Canvas Support

Obsidian Canvas is a powerful visual workspace. This server provides full programmatic access to create and manipulate canvas files:

Example: Create a visual mind map

// Create a new canvas
await mcp.callTool('create_canvas', { canvasPath: 'diagrams/mindmap.canvas' });

// Add nodes
await mcp.callTool('add_canvas_node', {
  canvasPath: 'diagrams/mindmap.canvas',
  nodeType: 'file',
  file: 'notes/central-idea.md',
  x: 0, y: 0, width: 400, height: 200
});

await mcp.callTool('add_canvas_node', {
  canvasPath: 'diagrams/mindmap.canvas',
  nodeType: 'text',
  text: '# Key Concept',
  x: 500, y: 0, width: 300, height: 150,
  color: '1'  // Red
});

// Connect nodes with edges
await mcp.callTool('add_canvas_edge', {
  canvasPath: 'diagrams/mindmap.canvas',
  fromNode: 'node-id-1',
  toNode: 'node-id-2',
  label: 'relates to'
});

Dataview Queries

Query your notes like a database with SQL-like syntax:

Example: Find recent project notes

await mcp.callTool('dataview_query', {
  query: {
    from: '#project',
    where: [
      { field: 'status', operator: 'eq', value: 'active' },
      { field: 'modified', operator: 'gte', value: '2024-01-01' }
    ],
    sort: [{ field: 'modified', direction: 'desc' }],
    limit: 10
  }
});

Example: Group notes by tag

await mcp.callTool('dataview_query', {
  query: {
    from: 'projects/',
    groupBy: 'status',
    select: ['title', 'modified', 'tags']
  }
});

Example: Get metadata from inline fields

// Note content: "Status:: In Progress\nPriority:: High"
const metadata = await mcp.callTool('get_note_metadata', {
  notePath: 'projects/my-project.md'
});
// Returns: { status: 'In Progress', priority: 'High', ... }

Template System

Create reusable templates with variable substitution and automatic date handling:

Example: Create a meeting note template

---
tags: [meeting]
templateVariables:
  - name: attendees
    type: string
    description: Meeting attendees
---

# Meeting: {{title}}

**Date:** {{date}}
**Time:** {{time}}
**Attendees:** {{attendees|TBD}}

## Agenda

-

## Notes

## Action Items

- [ ]

Example: Use the template

await mcp.callTool('create_from_template', {
  templatePath: 'Templates/meeting.md',
  targetPath: 'Meetings/2024-01-15-team-sync.md',
  variables: {
    attendees: 'Alice, Bob, Charlie'
  },
  frontmatter: {
    project: 'Q1 Planning'
  }
});

Built-in Variables:

  • {{date}} - Current date (YYYY-MM-DD)

  • {{time}} - Current time (HH:mm)

  • {{datetime}} - Current datetime

  • {{year}}, {{month}}, {{day}} - Date components

  • {{weekday}} - Day of week (Monday, Tuesday, etc.)

  • {{week}} - Week number (01-53)

  • {{title}}, {{filename}}, {{folder}} - File context

Periodic Notes

Automatically create and organize daily, weekly, monthly, and yearly notes:

Example: Create today's daily note

await mcp.callTool('create_daily_note', {
  vault: 'my-vault'
});
// Creates: Daily Notes/2024-01-15.md

Example: Create this week's note

await mcp.callTool('create_weekly_note', {
  vault: 'my-vault',
  variables: {
    goals: 'Complete project proposal'
  }
});
// Creates: Weekly Notes/2024-W03.md

Example: List all monthly notes

await mcp.callTool('list_periodic_notes', {
  vault: 'my-vault',
  type: 'monthly',
  startDate: '2024-01-01',
  endDate: '2024-12-31'
});

Configuration: Periodic notes can be configured with custom folders, formats, and templates:

{
  "periodicNotes": {
    "daily": {
      "folder": "Journal/Daily",
      "format": "YYYY-MM-DD",
      "template": "Templates/daily-note.md"
    },
    "weekly": {
      "folder": "Journal/Weekly",
      "format": "YYYY-[W]WW"
    }
  }
}

Technical Highlights

Markdown Parsing

  • Full support for Obsidian-flavored markdown

  • Frontmatter extraction (YAML)

  • Internal link parsing ([[link]], [[link|alias]])

  • Embed detection (![[embed]])

  • Tag extraction (#tag, #nested/tag)

  • Inline field parsing (key:: value pattern)

Canvas Operations

  • Complete Canvas file format support (JSON-based)

  • All node types: file, text, link, group

  • Edge/connection management with customization

  • Color and styling support

  • Programmatic canvas generation

Dataview Integration

  • SQL-like query language for notes

  • Multiple filter operators (eq, neq, gt, gte, lt, lte, contains, startsWith, endsWith, exists)

  • Sorting and grouping capabilities

  • Field selection and projection

  • Support for frontmatter and inline fields

  • Nested field access with dot notation

Template System

  • Variable substitution with {{variable}} syntax

  • Built-in date/time variables with formatting

  • Default values: {{variable|default}}

  • Date formatting: {{date:YYYY-MM-DD}}

  • Frontmatter merging and manipulation

  • Template discovery and listing

Periodic Notes

  • Automatic date-based note generation

  • Configurable folder structure and naming

  • Template integration for custom layouts

  • Date range calculations (daily, weekly, monthly, yearly)

  • ISO week number support

  • Flexible date format patterns

  • Smart link resolution (title-based and path-based)

  • Automatic backlink generation

  • Bidirectional link tracking

Performance

  • Efficient caching strategies

  • File watching for instant updates

  • Lazy loading and pagination support

Security Considerations

  • Local vaults: Requires file system access to vault directory

  • Remote vaults: Use HTTPS and secure API keys

  • API keys: Never commit to version control

  • File watching: Only monitors .md files

Requirements

  • Node.js 18 or higher

  • TypeScript 5.x

  • Access to Obsidian vault(s)

License

MIT

Contributing

Contributions are welcome! Please feel free to submit issues and pull requests.

Support

For issues and questions:


Built with ❀️ for the Obsidian and MCP communities

Available Tools

29 tools
add_canvas_edgeC

Add an edge between nodes in canvas

Inputs: canvasPath (required), fromNode (required), toNode (required), vault (required), +2 more.

add_canvas_nodeC

Add a node to canvas (file, text, link, or group)

Inputs: canvasPath (required), height (required), nodeType (required), vault (required), +8 more.

analyze_graphC

Analyze the knowledge graph structure

Inputs: vault (required).

create_canvasC

Create a new canvas file

Inputs: path (required), vault (required).

create_daily_noteC

Create a daily note for a specific date

Inputs: vault (required), date, variables.

create_from_templateC

Create a new note from a template

Inputs: targetPath (required), templatePath (required), vault (required), frontmatter, +1 more.

create_monthly_noteC

Create a monthly note for a specific date

Inputs: vault (required), date, variables.

create_noteC

Create a new note

Inputs: content (required), path (required), vault (required), frontmatter.

create_weekly_noteC

Create a weekly note for a specific date

Inputs: vault (required), date, variables.

create_yearly_noteC

Create a yearly note for a specific year

Inputs: vault (required), date, variables.

dataview_queryC

Execute a Dataview-style query on notes

Inputs: vault (required), from, groupBy, limit, +3 more.

delete_noteC

Delete a note

Inputs: path (required), vault (required).

get_canvasC

Get canvas file contents

Inputs: path (required), vault (required).

get_knowledge_graphB

Get the complete knowledge graph for a vault

Inputs: vault (required).

get_noteC

Get a note by its path

Inputs: path (required), vault (required).

get_note_metadataC

Get metadata for a specific note

Inputs: path (required), vault (required).

get_periodic_note_infoC

Get info about a periodic note

Inputs: type (required), vault (required), date.

get_unique_valuesC

Get all unique values for a metadata field

Inputs: field (required), vault (required).

get_vault_statsC

Get statistics about a vault

Inputs: vault (required).

list_canvas_filesC

List all canvas files in vault

Inputs: vault (required).

list_foldersC

List all folders in a vault

Inputs: vault (required).

list_periodic_notesC

List periodic notes of a specific type

Inputs: type (required), vault (required), endDate, startDate.

list_tagsC

List all tags in a vault

Inputs: vault (required).

list_templatesC

List all available templates

Inputs: vault (required).

render_templateC

Render a template with variables

Inputs: templatePath (required), vault (required), frontmatter, targetPath, +1 more.

search_notesC

Search for notes in a vault

Inputs: query (required), vault (required), folder, limit, +1 more.

update_noteC

Update an existing note

Inputs: content (required), path (required), vault (required), frontmatter.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 29 tools

    Disambiguation4/5

    Most tools have distinct purposes, but there is some overlap between 'get_related_notes' and 'suggest_links' (both involve finding related notes), and 'analyze_graph' and 'get_knowledge_graph' both deal with graph analysis. Descriptions help clarify differences, but agents might occasionally confuse these pairs.

    Naming Consistency5/5

    Tool names follow a consistent verb_noun pattern throughout, such as 'create_note', 'get_note', 'list_tags', and 'update_note'. There are no deviations in naming conventions, making the set predictable and readable.

    Tool Count3/5

    With 29 tools, the count is borderline high for a note-taking and knowledge management server. While it covers many features, it feels heavy and could overwhelm agents, suggesting some tools might be redundant or overly specialized.

    Completeness5/5

    The tool set provides comprehensive coverage for Obsidian's domain, including CRUD operations for notes and canvases, periodic notes, templates, queries, graph analysis, and vault management. There are no obvious gaps, and agents can handle full workflows without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      Enables MCP clients to interact with Obsidian vaults via filesystem operations and optional REST API integration for advanced UI commands. It features multi-vault auto-discovery, concurrent-safe file handling, and comprehensive tools for searching, reading, and managing vault content.
      12
      3,971 npm
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to remotely access and interact with Obsidian vaults via MCP, supporting note operations, tag management, graph queries, and command execution.
      4
      GPL 3.0
    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables MCP-based operations on an Obsidian vault, including reading, editing, and custom script tools.
      BSD Zero Clause