Skip to main content
Glama

Obsidian Local REST API MCP Server

by j-shelfwood
MIT License

Obsidian Local REST API MCP Server

An MCP (Model Context Protocol) server that provides LLM tool calls to interact with an Obsidian vault through a local REST API. This server acts as a bridge between MCP clients (like Claude Desktop, VS Code, etc.) and the Obsidian Local REST API.

Prerequisites

Installation

# Clone the repository git clone <repository-url> cd obsidian-local-rest-api-mcp # Install dependencies with bun bun install # Build the project bun run build

Configuration

Set environment variables for API connection:

export OBSIDIAN_API_URL="http://localhost:8000" # Default URL export OBSIDIAN_API_KEY="your-api-key" # Optional bearer token

Usage

Running the Server

# Development mode with auto-reload bun run dev # Production mode bun run start # Or run directly node build/index.js

MCP Client Configuration

Claude Desktop

Add to your claude_desktop_config.json:

{ "mcpServers": { "obsidian-vault": { "command": "node", "args": ["/absolute/path/to/obsidian-local-rest-api-mcp/build/index.js"], "env": { "OBSIDIAN_API_URL": "http://localhost:8000", "OBSIDIAN_API_KEY": "your-api-key-if-needed" } } } }
VS Code with MCP Extension

Use the included .vscode/mcp.json configuration file.

Available Tools

File Operations

  • list_files - List all files in the vault
  • get_file - Get content of a specific file
  • create_file - Create a new file or directory
  • update_file - Update file content
  • delete_file - Delete a file

Note Operations

  • list_notes - List notes with metadata
  • get_note - Get note with frontmatter
  • create_note - Create note with optional frontmatter
  • update_note - Update note content/frontmatter
  • delete_note - Delete a note
  • search_notes - Search notes by content

Metadata Operations

  • get_metadata_keys - List all frontmatter keys
  • get_metadata_values - Get unique values for a key

Development

# Watch mode for development bun run dev # Build TypeScript bun run build # Type checking bun run tsc --noEmit

Architecture

  • ObsidianApiClient - HTTP client wrapper for REST API endpoints
  • ObsidianMcpServer - MCP server implementation with tool handlers
  • Configuration - Environment-based configuration with validation

Error Handling

The server includes comprehensive error handling:

  • API connection failures
  • Invalid tool parameters
  • Network timeouts
  • Authentication errors

Errors are returned as MCP tool call responses with descriptive messages.

Debugging

Enable debug logging by setting environment variables:

export DEBUG=1 export NODE_ENV=development

Server logs are written to stderr to avoid interfering with MCP protocol communication on stdout.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make changes with proper TypeScript types
  4. Test with your Obsidian vault
  5. Submit a pull request

License

MIT

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

A bridge server that allows LLM tools to interact with an Obsidian vault through a local REST API, enabling file operations, note management, and metadata access through natural language.

  1. Prerequisites
    1. Installation
      1. Configuration
        1. Usage
          1. Running the Server
          2. MCP Client Configuration
        2. Available Tools
          1. File Operations
          2. Note Operations
          3. Metadata Operations
        3. Development
          1. Architecture
            1. Error Handling
              1. Debugging
                1. Contributing
                  1. License

                    Related MCP Servers

                    • -
                      security
                      A
                      license
                      -
                      quality
                      Enables interaction between LLMs and Obsidian vaults through the Model Context Protocol, supporting secure file operations, content management, and advanced search capabilities.
                      Last updated -
                      9
                      434
                      116
                      TypeScript
                      Apache 2.0
                      • Apple
                      • Linux
                    • -
                      security
                      A
                      license
                      -
                      quality
                      Provides a standardized interface for AI assistants to interact with Obsidian vaults through a local REST API, enabling reading, writing, searching, and managing notes.
                      Last updated -
                      37
                      TypeScript
                      MIT License
                    • -
                      security
                      F
                      license
                      -
                      quality
                      A lightweight server that enables AI assistants like Cursor & Claude to read from and write to Obsidian vaults, allowing actions like creating notes, checking existing content, and managing todos through natural language.
                      Last updated -
                      434
                      8
                      TypeScript
                    • -
                      security
                      A
                      license
                      -
                      quality
                      A server implementation that allows AI assistants to read, create, and manipulate notes in Obsidian vaults through the Model Context Protocol.
                      Last updated -
                      1,530
                      1
                      TypeScript
                      MIT License

                    View all related MCP servers

                    MCP directory API

                    We provide all the information about MCP servers via our MCP API.

                    curl -X GET 'https://glama.ai/api/mcp/v1/servers/j-shelfwood/obsidian-local-rest-api-mcp'

                    If you have feedback or need assistance with the MCP directory API, please join our Discord server