Supports using the Bun JavaScript runtime as an alternative to Node.js for running the MCP server with potentially improved performance.
Supports running the MCP server using Node.js runtime, enabling the connection between MCP clients and the Obsidian Local REST API.
Enables interaction with an Obsidian vault through the Local REST API, providing tools for file operations (listing, creating, updating, deleting), note management with frontmatter support, and metadata operations for working with frontmatter keys and values.
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
- Node.js 18+ or Bun runtime
- Obsidian Local REST API running locally (default: http://localhost:8000)
Installation
Configuration
Set environment variables for API connection:
Usage
Running the Server
MCP Client Configuration
Claude Desktop
Add to your claude_desktop_config.json
:
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
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:
Server logs are written to stderr to avoid interfering with MCP protocol communication on stdout.
Contributing
- Fork the repository
- Create a feature branch
- Make changes with proper TypeScript types
- Test with your Obsidian vault
- Submit a pull request
License
MIT
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.
Related MCP Servers
- -securityAlicense-qualityEnables interaction between LLMs and Obsidian vaults through the Model Context Protocol, supporting secure file operations, content management, and advanced search capabilities.Last updated -9434116TypeScriptApache 2.0
- -securityAlicense-qualityProvides 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 -37TypeScriptMIT License
- -securityFlicense-qualityA 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 -4348TypeScript
- -securityAlicense-qualityA server implementation that allows AI assistants to read, create, and manipulate notes in Obsidian vaults through the Model Context Protocol.Last updated -1,5301TypeScriptMIT License