Skip to main content

MCP server for Obsidian integration with AI assistants

Project description

Obsidian MCP Server Enhanced

Status: Phase 1 Complete

A Model Context Protocol (MCP) server for integrating Amazon Q with Obsidian.

Project Overview

This MCP server allows Amazon Q to interact with Obsidian vaults without requiring the Obsidian application to be open. It leverages the Obsidian Local REST API plugin to provide functionality for note management, search, and knowledge management.

Current Status

  • Phase 1 (Core Infrastructure): Complete
  • Basic file operations, search, and note templates are fully implemented
  • Built with FastMCP for seamless integration with Amazon Q
  • Uses decorator-based approach for prompt registration
  • Ready to begin Phase 2: Essential Features

Features

Currently Implemented

  • File Operations: Read, create, update, append to, and delete notes
  • Basic Folder Management: List files in folders
  • Search: Basic search functionality for notes
  • Daily Notes: Create daily notes with predefined sections
  • Meeting Notes: Create meeting notes with structured templates

Planned Features

  • Advanced Folder Management: Create, delete, rename, and move folders
  • Organization & Metadata: Manage tags, frontmatter, and file organization
  • Advanced Search & Discovery: Enhanced search by content, tags, and other criteria
  • Knowledge Management: Extract highlights, compile notes, and more
  • Search and Compile: Search for notes and compile information into a single note
  • Note Organization: Organize notes on specific topics with AI assistance

Getting Started

Prerequisites

  1. Obsidian: Install Obsidian and create a vault
  2. Local REST API Plugin: Install the Local REST API plugin in Obsidian
  3. Python 3.10+: Make sure you have Python 3.10 or newer installed

Installation

  1. Clone this repository:

    git clone https://github.com/yourusername/mcp-obsidian-enhanced.git
    cd mcp-obsidian-enhanced
    
  2. Create a virtual environment:

    python -m venv venv
    source venv/bin/activate  # On Windows: venv\Scripts\activate
    
  3. Install dependencies:

    pip install -e ".[dev]"
    
  4. Create a .env file with your Obsidian API configuration:

    OBSIDIAN_API_KEY=your_api_key_from_local_rest_api_plugin
    OBSIDIAN_HOST=127.0.0.1
    OBSIDIAN_PORT=27124
    

Integration with Amazon Q CLI

To integrate this MCP server with Amazon Q CLI, configure the MCP server in your AWS configuration:

  1. Create or update the file at ~/.aws/amazonq/mcp.json:
{
  "mcpServers": {
    "obsidian-mcp-server": {
        "command": "uv",
        "args": ["--directory", "/path/to/mcp-obsidian-enhanced", "run", "run_server.py"],
        "env": {},
        "disabled": false,
        "autoApprove": []
    }
  }
}
  1. Replace /path/to/mcp-obsidian-enhanced with the actual path to your repository.

Running the Server

Run the server with:

python run_server.py

To test with MCP Inspector:

npx @modelcontextprotocol/inspector uv --directory ./ "run" "run_server.py"

Available Tools

Tool Name Description
obsidian_read_note Get content of a note from your Obsidian vault
obsidian_create_note Create a new note in your Obsidian vault
obsidian_update_note Update an existing note in your Obsidian vault
obsidian_append_note Append content to an existing note
obsidian_delete_note Delete a note from your Obsidian vault
obsidian_list_files List files and folders in your Obsidian vault
obsidian_get_active_file Get the currently active file in Obsidian
obsidian_create_daily_note Create a daily note with predefined sections

Planned Tools (Phase 2)

Tool Name Description
obsidian_search Search for notes in your Obsidian vault
obsidian_summarize_note Summarize the content of a note
obsidian_search_and_compile Search for notes and compile information
obsidian_organize_notes Organize notes on a specific topic

Available Prompts

The server provides prompt templates using the decorator-based approach:

Meeting Notes

@mcp.prompt("meeting-notes")
async def meeting_notes_prompt(
    title: str,
    date: str = "",
    participants: str = "",
    folder: str = "Meetings",
    tags: List[str] = None
) -> Dict[str, Any]:
    """Create a meeting note with the given details."""
    # Implementation...

Create Note

@mcp.prompt("create-note")
async def create_note_prompt(
    title: str,
    content: str,
    folder: str = "",
    tags: List[str] = None
) -> Dict[str, Any]:
    """Create a new note with the given details."""
    # Implementation...

Organize Notes

@mcp.prompt("organize-notes")
async def organize_notes_prompt(
    topic: str,
    folder: str = ""
) -> Dict[str, Any]:
    """Organize notes related to a specific topic."""
    # Implementation...

Configuration Options

Environment Variable Description Default
OBSIDIAN_API_KEY API key from Local REST API plugin (Required)
OBSIDIAN_HOST Host where Obsidian is running 127.0.0.1
OBSIDIAN_PORT Port for the API 27124
OBSIDIAN_PROTOCOL Protocol to use https
OBSIDIAN_VERIFY_SSL Whether to verify SSL certificates false
OBSIDIAN_TIMEOUT Connection timeout in seconds 10
LOG_LEVEL Logging level (INFO, DEBUG, etc.) INFO

Implementation Roadmap

Phase 1: Core Infrastructure (Complete)

  • ✅ Basic server setup with FastMCP
  • ✅ Configuration management
  • ✅ Obsidian API client
  • ✅ Basic file operations
  • ✅ Basic folder management tools

Phase 2: Essential Features (Planned)

  • Advanced search functionality
  • Metadata management
  • Improved templates
  • Note organization capabilities
  • Search and compile functionality
  • Note summarization

Phase 3: Advanced Features (Planned)

  • Knowledge management tools
  • Bulk operations
  • Advanced search capabilities

Phase 4: Optimization & Polish (Planned)

  • Performance optimizations
  • Enhanced error handling
  • Comprehensive logging
  • Detailed documentation

Testing the API Directly

You can test the Obsidian Local REST API endpoints directly using curl:

List Files in a Folder

curl -X GET "http://127.0.0.1:27124/vault/FolderName?list=true" \
  -H "Authorization: Bearer YOUR_API_KEY"

Read a Note

curl -X GET "http://127.0.0.1:27124/vault/path/to/note.md" \
  -H "Authorization: Bearer YOUR_API_KEY"

Create/Update a Note

curl -X PUT "http://127.0.0.1:27124/vault/path/to/note.md" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: text/markdown" \
  -d "# Note Title\n\nNote content here."

Search Notes

curl -X POST "http://127.0.0.1:27124/search/simple" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "query=search_term"

Contributing

Contributions are welcome! Please see the CONTRIBUTING.md file for guidelines.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

iflow_mcp_labeveryday_mcp_obsidian-0.1.0.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

File details

Details for the file iflow_mcp_labeveryday_mcp_obsidian-0.1.0.tar.gz.

File metadata

  • Download URL: iflow_mcp_labeveryday_mcp_obsidian-0.1.0.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_labeveryday_mcp_obsidian-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5515df6874199eb11681bae68fdbfa2816f71db6fde62ab434f6d0aeb6ddd8bc
MD5 c309152a9d7ea8f8425d49ab3cce233b
BLAKE2b-256 95abc1c17ddb84121aa344149d5d61f4b09a871883bf51cac8cea524873c075b

See more details on using hashes here.

File details

Details for the file iflow_mcp_labeveryday_mcp_obsidian-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: iflow_mcp_labeveryday_mcp_obsidian-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 13.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.10.0 {"installer":{"name":"uv","version":"0.10.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Debian GNU/Linux","version":"13","id":"trixie","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for iflow_mcp_labeveryday_mcp_obsidian-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 101a2268ab4246959804f66dbc28cf3fc74ad6e0ab07943be33b0a58699cde79
MD5 83a8749c96196056b786be6c69f4dfa8
BLAKE2b-256 0e045d42db0c603f1a2bdf597e1c1f056246b645af834edebd3c0020c2d8ed19

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page