obsidian-mcp

MCP.Pizza Chef: Sunwood-ai-labs

obsidian-mcp is an MCP client designed to connect Obsidian, a popular knowledge management app, with the Model Context Protocol ecosystem. It enables real-time, structured context sharing between Obsidian notes and LLMs, facilitating advanced AI workflows such as note summarization, context-aware querying, and knowledge extraction. Built with TypeScript and Node.js, it supports secure, scoped interactions and enhances productivity by bridging local knowledge bases with powerful AI models.

Use This MCP client To

Sync Obsidian notes as context for LLM-powered assistants Enable real-time querying of Obsidian knowledge bases Automate summarization of notes using LLMs Integrate Obsidian with multi-model AI workflows Facilitate context-aware content generation from notes Support scoped, secure access to personal knowledge data Bridge local markdown files with cloud AI services

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 does obsidian-mcp connect Obsidian with LLMs?
It acts as an MCP client that streams structured note data to LLMs for real-time context integration.
What programming languages and frameworks does obsidian-mcp use?
It is built with TypeScript and Node.js, ensuring cross-platform compatibility and ease of extension.
Can obsidian-mcp handle large Obsidian vaults efficiently?
Yes, it is designed to manage large markdown repositories by streaming relevant context dynamically.
Is obsidian-mcp secure for personal knowledge data?
Yes, it supports scoped and secure interactions, limiting data exposure to only what is necessary for the task.
Does obsidian-mcp support multiple LLM providers?
Yes, it is provider-agnostic and works with OpenAI, Anthropic Claude, Google Gemini, and others.
How do I install and configure obsidian-mcp?
Installation involves cloning the GitHub repo, installing dependencies via npm, and configuring your Obsidian vault path in the client settings.
Can obsidian-mcp be extended with custom plugins?
Yes, its modular TypeScript architecture allows developers to add custom data handlers and integrations.
What kind of AI workflows can obsidian-mcp enable?
It enables workflows like note summarization, context-aware search, content generation, and knowledge extraction.