The Obsidian Local REST API MCP Server enables programmatic interaction with an Obsidian vault through a local REST API, serving as a bridge for LLMs and MCP clients to manage vault content.
- File Operations: List, retrieve, create, update, and delete files within the vault
- Note Operations: Manage the full lifecycle of notes, including listing, retrieving, creating, updating, and deleting notes with their frontmatter metadata
- Search Capability: Search through notes based on content or metadata queries
- Metadata Management: List all frontmatter keys and retrieve unique values for specific keys
- Integration: Seamless connection with MCP clients like Claude Desktop and VS Code via the Model Context Protocol
- Error Handling: Comprehensive handling of API failures, invalid parameters, timeouts, and authentication issues
- Debugging: Tools for troubleshooting server connectivity and configuration
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 AI-Native MCP (Model Context Protocol) server that provides intelligent, task-oriented tools for interacting with Obsidian vaults through a local REST API.
🧠 AI-Native Design Philosophy
This MCP server has been redesigned following AI-Native principles rather than simple API-to-tool mapping. Instead of exposing low-level CRUD operations, it provides high-level, task-oriented tools that LLMs can reason about more effectively.
Before vs After: The Transformation
Old Approach (CRUD-Based) | New Approach (AI-Native) | Why Better |
---|---|---|
list_files (returns everything) | list_directory(path, limit, offset) | Prevents context overflow with pagination |
create_file + update_file | write_file(path, content, mode) | Single tool handles create/update/append |
create_note + update_note | create_or_update_note(path, content, frontmatter) | Intelligent upsert removes decision complexity |
search_notes(query) | search_vault(query, scope, path_filter) | Precise, scopeable search with advanced filtering |
(no equivalent) | get_daily_note(date) | High-level abstraction for common workflow |
(no equivalent) | get_recent_notes(limit) | Task-oriented recent file access |
(no equivalent) | find_related_notes(path, on) | Conceptual relationship discovery |
🛠 Available Tools
Directory & File Operations
list_directory
Purpose: List directory contents with pagination to prevent context overflow
AI Benefit: LLM can explore vault structure incrementally without overwhelming context
read_file
Purpose: Read content of any file in the vault
write_file
Purpose: Write file with multiple modes - replaces separate create/update operations
AI Benefit: Single tool handles all write scenarios, removes ambiguity
delete_item
Purpose: Delete any file or directory
AI-Native Note Operations
create_or_update_note
Purpose: Intelligent upsert - creates if missing, updates if exists
AI Benefit: Eliminates "does this note exist?" decision tree
get_daily_note
Purpose: Smart daily note retrieval with common naming patterns
AI Benefit: Abstracts file system details and naming conventions
get_recent_notes
Purpose: Get recently modified notes
AI Benefit: Matches natural "what did I work on recently?" queries
Advanced Search & Discovery
search_vault
Purpose: Multi-scope search with advanced filtering
AI Benefit: Precise, targeted search reduces noise
find_related_notes
Purpose: Discover conceptual relationships between notes
AI Benefit: Enables relationship-based workflows and serendipitous discovery
Legacy Tools (Backward Compatibility)
The server maintains backward compatibility with existing tools like get_note
, list_notes
, get_metadata_keys
, etc.
Prerequisites
- Node.js 18+ or Bun runtime
- Obsidian Local REST API running locally (default: http://obsidian-local-rest-api.test)
Installation
Using npx (Recommended)
From Source
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.
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.
Troubleshooting
MCP Server Fails to Start
If your MCP client shows "Start Failed" or similar errors:
- Test the server directly:Should output the version number.
- Test MCP protocol:Should show initialization response.
- Check Environment Variables:
- Ensure
OBSIDIAN_API_URL
points to a running Obsidian Local REST API - Test the API directly:
curl http://obsidian-local-rest-api.test/api/files
(or your configured API URL)
- Ensure
- Verify Obsidian Local REST API:
- Install and run Obsidian Local REST API
- Confirm it's accessible on the configured port
- Check if authentication is required
Common Issues
"Command not found": Make sure Node.js/npm is installed and npx is available
"Connection refused": Obsidian Local REST API is not running or wrong URL
Laravel Valet .test domains: If using Laravel Valet, ensure your project directory name matches the .test domain (e.g., obsidian-local-rest-api.test
for a project in /obsidian-local-rest-api/
)
"Unauthorized": Check if API key is required and properly configured
"Timeout": Increase timeout in client configuration or check network connectivity
Cherry Studio Configuration
For Cherry Studio, use these exact settings:
- Name:
obsidian-vault
(or any name you prefer) - Type:
Standard Input/Output (stdio)
- Command:
npx
- Arguments:
obsidian-local-rest-api-mcp
- Environment Variables:
OBSIDIAN_API_URL
: Your API URL (e.g.,http://obsidian-local-rest-api.test
for Laravel Valet)OBSIDIAN_API_KEY
: Optional API key if authentication is required
- Environment Variables:
OBSIDIAN_API_URL
:http://obsidian-local-rest-api.test
(or your API URL)OBSIDIAN_API_KEY
:your-api-key
(if required)
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
local-only server
The server can only run on the client's local machine because it depends on local resources.
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.
- 🧠 AI-Native Design Philosophy
- 🛠 Available Tools
- Prerequisites
- Installation
- Configuration
- Usage
- Development
- Architecture
- Error Handling
- Debugging
- Troubleshooting
- Contributing
- License
Related Resources
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