Obsidian MCP server + VScode Agent + Claude



AI Summary

Summary of Setting Up Local MCP Server for Obsidian

Introduction

  • MCP (Model Context Protocol) allows automation using preferred AI tools.
  • Focus: Setting up a local MCP server for Obsidian.

Requirements

  • Comfort with terminal commands.
  • Compatibility with various operating systems (examples based on Mac OS).

Overview of MCP

  • Sequence diagram explaining user, host app, MCP client, MCP server, and external service (Obsidian).
  • Functionality: enables information exchange between host applications and Obsidian.

Components Needed

  1. Obsidian Local REST API Plugin
    • Exposes a REST API for external services.
    • Security: Use a fork to avoid supply chain issues.
  2. MCP Obsidian Server
    • Python application that connects to Obsidian’s REST API.
    • Functions: Read, create, update, and delete notes; list files; execute commands.

Installation Steps

  1. Set up Obsidian Vault:
    • Navigate to the vault folder.
    • Create subfolders for plugins.
  2. Clone Obsidian Local REST API Plugin:
    • Use git clone [URL] to fetch the plugin repo.
    • Run npm install to install dependencies.
    • Build the project: npm run build.
  3. Configure and Enable Plugin in Obsidian:
    • Go to Community Plugins settings to enable the Local REST API.
    • Regenerate certificates for HTTPS connections.
    • Add self-signed certificate to the local trust store.
  4. Set Up MCP Obsidian Server:
    • Clone the MCP server repo.
    • Install dependencies using uvsync.
    • Run the MCP server (use Python virtual environments).
  5. Configure Host Application:
    • Set up MCP server in the host application (e.g., Claude or VS Code).
    • Ensure commands to run the server are correctly specified.

Usage Instructions

  • Trigger interactions like listing notes or creating new ones through the configured MCP client.
  • Maintain security awareness; ensure non-destructive commands are run.
  • Use version control (e.g., Git) to manage Obsidian content safely.

Additional Integration with VS Code

  • Similar setup process in VS Code with agent configurations.
  • Supports a broader range of models for interactions with Obsidian.

Conclusion

  • Successfully integrating MCP with Obsidian allows streamlined automation of note management.