obsidian-mcp

MCP.Pizza Chef: Sunwood-ai-labs

obsidian-mcp is an MCP client designed to connect Obsidian note-taking environments with LLMs via the Model Context Protocol. It enables real-time context sharing and interaction between Obsidian's markdown notes and AI models, facilitating advanced workflows such as note summarization, context-aware querying, and automated knowledge management within Obsidian. Built with TypeScript and Node.js, it supports seamless integration into developer and productivity toolchains.

Use This MCP client To

Sync Obsidian notes with LLMs for real-time context access Generate summaries of Obsidian markdown notes Query Obsidian knowledge base using natural language Automate tagging and linking of notes via LLM insights Integrate Obsidian with AI-enhanced workflows and tools

README

Header Image

obsidian-mcp MCP Server

GitHub Stars GitHub Issues License

TypeScript Node.js Obsidian MCP

A Model Context Protocol server for Obsidian integration

This is a TypeScript-based MCP server that implements integration with Obsidian. It demonstrates core MCP concepts by providing:

  • Resources representing Obsidian vault contents
  • Tools for accessing vault data
  • API integration with Obsidian

Project Statistics

  • Total lines of code: 345
  • Main files:
    • src/tool-handlers.ts (76 lines)
    • src/resource-handlers.ts (45 lines)
    • src/server.ts (32 lines)
    • src/api-client.ts (25 lines)

Directory Structure

obsidian-mcp/
├── .codegpt/
│   └── head
├── src/
│   ├── api-client.ts
│   ├── index.ts
│   ├── resource-handlers.ts
│   ├── server.ts
│   └── tool-handlers.ts
├── .SourceSageignore
├── package.json
├── README.md
└── tsconfig.json

Features

Resources

  • Access Obsidian server info via obsidian://server-info URI
  • Get vault contents with metadata
  • JSON format for easy integration

Tools

  • get_vault_contents - Retrieve contents of Obsidian vault
    • Takes path as optional parameter (default: root directory)
    • Returns structured JSON response

API Integration

  • Secure HTTPS connection with Obsidian API
  • Custom axios client with error handling
  • Windows path normalization support

Development

Prerequisites

  • Node.js v18+
  • TypeScript 5.3+
  • Obsidian API key (set as OBSIDIAN_API_KEY environment variable)

Setup

# Install dependencies
npm install

# Build the server
npm run build

# Start development server with auto-rebuild
npm run watch

Installation

To use with Claude Desktop, add the server config:

On MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json On Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "obsidian-mcp": {
      "command": "/path/to/obsidian-mcp/build/index.js",
      "env": {
        "OBSIDIAN_API_KEY": "your-api-key-here"
      }
    }
  }
}

Debugging

We recommend using the MCP Inspector:

npm run inspector

The Inspector will provide a URL to access debugging tools in your browser.

Dependencies

Runtime

  • @modelcontextprotocol/sdk: MCP server implementation
  • axios: HTTP client for API communication

Development

  • @types/node: TypeScript definitions for Node.js
  • typescript: TypeScript compiler

obsidian-mcp FAQ

How do I install obsidian-mcp client?
You can install obsidian-mcp via npm or yarn from its GitHub repository, following the setup instructions provided in the README file.
Does obsidian-mcp support real-time synchronization?
Yes, obsidian-mcp supports real-time syncing of notes between Obsidian and connected LLMs for up-to-date context.
Can obsidian-mcp work with multiple LLM providers?
Yes, it is provider-agnostic and works with OpenAI, Anthropic Claude, and Google Gemini models.
What programming languages is obsidian-mcp built with?
obsidian-mcp is built using TypeScript and Node.js for robust and scalable integration.
Is obsidian-mcp secure for sensitive notes?
Yes, it follows MCP principles for secure, scoped, and observable model interactions to protect your data.
Can I customize the data flow between Obsidian and LLMs?
Yes, obsidian-mcp allows configuration of context sharing and tool invocation to fit your workflow needs.
Does obsidian-mcp support markdown formatting?
Yes, it fully supports Obsidian's markdown format for note content parsing and context extraction.
How does obsidian-mcp handle large vaults?
It efficiently indexes and streams relevant note context to LLMs to manage large Obsidian vaults without performance loss.