Obsidian MCP server

Automatically captures Claude Code responses and saves them as structured markdown files in your Obsidian vault with configurable templates, project-specific organization, and automatic frontmatter generation for seamless AI conversation archiving.
Back to servers
Setup instructions
Provider
robwilde
Release date
Jul 28, 2025
Language
Go
Stats
1 star

The Obsidian MCP Server creates a bridge between Claude Code and Obsidian, enabling you to automatically save AI-generated content directly to your Obsidian vault with proper formatting and organization based on your project settings.

Installation

To install the Obsidian MCP Server:

git clone https://github.com/robwilde/obsidian-mcp-server.git
cd obsidian-mcp-server
python3 install.py

The installer will:

  • Check for Python 3.8+ and install MCP dependencies
  • Prompt for your Obsidian vault path
  • Install the MCP server globally to ~/.claude/
  • Configure Claude Code settings automatically
  • Optionally create project-specific configuration

Basic Usage

After installation, you can ask Claude Code to save content to Obsidian using simple commands:

"Create a security review of the authentication system and save to Obsidian"
"Generate API documentation and save it to Obsidian as a report"
"Document the database schema and save to Obsidian"

Claude Code will automatically format and save the content to your Obsidian vault.

Configuration

Global Settings

The MCP server uses a global configuration file at ~/.claude/settings.json:

{
  "mcpServers": {
    "obsidian-claude-code": {
      "command": "python3",
      "args": ["/home/user/.claude/obsidian_mcp_server.py"],
      "env": {
        "OBSIDIAN_VAULT_PATH": "/path/to/your/obsidian/vault"
      }
    }
  }
}

Project-Specific Configuration

For project-specific settings, create a .claude/obsidian.json file:

{
  "folder": "Projects/My Awesome Project",
  "templates": {
    "report": "# {title}\n\n**📋 Report Generated**\n- **Date:** {timestamp}\n- **Project:** {project}\n\n{content}",
    "review": "# Code Review: {title}\n\n**👀 Review Details**\n- **Date:** {timestamp}\n- **Project:** {project}\n\n{content}",
    "note": "# {title}\n\n**📝 Note**\n- **Created:** {timestamp}\n- **Project:** {project}\n\n{content}"
  }
}

To add project configuration to existing projects:

python3 install.py --project-config

Reading Obsidian Files

You can ask Claude Code to read files directly from your Obsidian vault:

"Read this Obsidian file: obsidian://open?vault=MyVault&file=Notes/ProjectPlan"
"@obsidian obsidian://open?vault=MyVault&file=Docs%2FMeeting%20Notes%202025"

The system handles URL-encoded characters for spaces and special characters.

Custom Templates

You can customize how different content types are formatted by modifying the templates in your project configuration:

{
  "templates": {
    "security-review": "# 🔒 Security Review: {title}\n\n**Reviewed by:** Claude Code\n**Date:** {timestamp}\n\n## Executive Summary\n\n{content}",
    "api-docs": "# 📚 API Documentation: {title}\n\n**Generated:** {timestamp}\n**Version:** 1.0\n\n{content}"
  }
}

Generated File Format

Files are automatically saved with frontmatter and formatting based on your templates:

---
created: 2025-01-27T14:30:22.123456
source: claude-code
tags: [claude-code, report, project-name]
---

# Security Review: Authentication System

**📋 Report Generated**
- **Date:** 2025-01-27 14:30:22
- **Project:** my-awesome-project
- **Type:** Technical Report

---

[Your content here, formatted according to the template]

---

*Generated by Claude Code*

Troubleshooting

Common Issues

If the MCP server is not found:

# Reinstall MCP dependencies
pip install --upgrade mcp

If the vault path is not found:

# Check environment variable
echo $OBSIDIAN_VAULT_PATH

# Or update settings manually
vim ~/.claude/settings.json

If project configuration is not detected:

# Create project config in current directory
python3 install.py --project-config

Debug Mode

Enable debug logging for troubleshooting:

export MCP_DEBUG=1

Requirements

  • Python 3.8+
  • Claude Code (with MCP support)
  • Obsidian (any recent version)
  • MCP Python package (auto-installed by installer)

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "obsidian-claude-code" '{"command":"python3","args":["/home/user/.claude/obsidian_mcp_server.py"],"env":{"OBSIDIAN_VAULT_PATH":"/path/to/your/obsidian/vault"}}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "obsidian-claude-code": {
            "command": "python3",
            "args": [
                "/home/user/.claude/obsidian_mcp_server.py"
            ],
            "env": {
                "OBSIDIAN_VAULT_PATH": "/path/to/your/obsidian/vault"
            }
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "obsidian-claude-code": {
            "command": "python3",
            "args": [
                "/home/user/.claude/obsidian_mcp_server.py"
            ],
            "env": {
                "OBSIDIAN_VAULT_PATH": "/path/to/your/obsidian/vault"
            }
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later