Sunwood-ai-labs

obsidian-mcp MCP Server

Community Sunwood-ai-labs
Updated

A Model Context Protocol server

obsidian-mcp MCP Server

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.jsonOn 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

MCP Server · Populars

MCP Server · New

    hsingjui

    ContextWeaver

    ContextWeaver 是一个基于 MCP 协议、利用 Tree-sitter 和向量搜索为大语言模型提供本地代码库智能上下文编织与检索的工具。

    Community hsingjui
    qase-tms

    Qase MCP Server

    An official Qase MCP server

    Community qase-tms
    repowise-dev

    repowise

    Codebase intelligence for AI-assisted engineering teams: code health scores, auto-generated docs, git analytics, dead code detection, and architectural decisions via MCP.

    Community repowise-dev
    wwwzhouhui

    即梦 MCP 服务器

    一个为即梦AI打造的MCP服务器,让Claude、Cherry Studio等AI应用直接调用即梦的AI生成能力。基于jimeng-free-api-all开源项目,提供OpenAI兼容接口。 核心功能:文本生成图像(即梦4.0/3.1)、图像合成(多图融合)、文本生成视频(480p-1080p)、图像生成视频(静态转动态)。 支持三种模式:stdio(Claude Desktop)、SSE(Web)、HTTP REST API(跨平台)。Docker一键部署,开箱即用。异步轮询优化,确保长时间任务稳定完成。 需要Python 3.10+和Docker,配置SessionID即可使用,每日免费66积分。适合AI创作者、开发者学习MCP协议。MIT开源,代码透明。

    Community wwwzhouhui
    kaorii-ako

    栞 Shiori

    Open-source AI study companion — Google Classroom sync, Gemini AI plans, SRS flashcards, GPA predictor, AI quiz, MCP server for Claude Code. Try demo at shiori-v1.vercel.app

    Community kaorii-ako