Claude MCP for Obsidian using Rest API

Hi Obsidian Community!

https://github.com/PublikPrinciple/obsidian-mcp-rest

I’m working on implementing an MCP (Model Context Protocol) server that integrates with Obsidian’s Local REST API plugin. The goal is to allow AI assistants like Claude to interact directly with Obsidian vaults in a secure, local manner.

Project Overview

Technical Details

The implementation uses:

  • Node.js/TypeScript
  • Obsidian Local REST API Plugin
  • Standard MCP communication via stdin/stdout

Current Features:

  • List vault notes
  • Read note contents
  • Write/update notes
  • Search functionality
  • Get note metadata

Current Issues

  1. TypeScript compilation errors relating to MCP type definitions
  2. Need guidance on best practices for Obsidian REST API integration
  3. Looking for input on security considerations when interfacing with Obsidian

Questions for the Community

  1. Has anyone implemented something similar using the Local REST API plugin?
  2. Are there specific Obsidian API considerations I should be aware of?
  3. Any recommendations for handling vault permissions safely?
  4. Looking for code review and security audit from experienced Obsidian plugin developers

How You Can Help

  1. Review the current implementation on GitHub
  2. Share experiences with Local REST API plugin
  3. Suggest improvements or best practices
  4. Help with TypeScript/Node.js implementation

Implementation Details

// Example of current tool implementation
export class ReadNoteTool extends BaseTool {
  constructor(api: ObsidianAPI) {
    super(
      api,
      'readNote',
      'Read the contents of a specific note',
      {
        type: 'object',
        required: ['path'],
        properties: {
          path: {
            type: 'string',
            description: 'Path to the note to read'
          }
        }
      }
    );
  }

  async execute(args: { path: string }): Promise<ToolResponse> {
    const note = await this.api.readNote(args.path);
    return {
      content: [{
        type: 'text',
        text: note.content
      }]
    };
  }
}
3 Likes

Love it, following :muscle:

Very cool reach out off post if down to collab