obsidian-plugin-virtual-memories

otrebu/obsidian-plugin-virtual-memories

3.2

If you are the rightful owner of obsidian-plugin-virtual-memories and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.

The Virtual Memories - Obsidian MCP Integration is a cloud-based system that enables AI assistants to write notes directly to your Obsidian vault using the Model Context Protocol (MCP).

Tools
1
Resources
0
Prompts
0

Virtual Memories - Obsidian MCP Integration

A cloud-based integration system that allows AI assistants to write notes directly to your Obsidian vault using the Model Context Protocol (MCP). This project consists of two main components:

  1. MCP Server - A Cloudflare Worker that provides an MCP endpoint for AI assistants
  2. Obsidian Plugin - A plugin that syncs notes from the cloud to your vault

Architecture

AI Assistant (Claude/ChatGPT)
    ↓ (MCP Protocol)
Cloudflare MCP Server
    ↓ (Cloudflare KV - Buffer Storage)
Obsidian Plugin
    ↓ (Vault API)
Your Obsidian Vault

The system uses a "store-and-forward" approach where notes are buffered in Cloudflare KV and then synced to your local vault by the Obsidian plugin.

Features

  • šŸ¤– AI Integration - Connect AI assistants to Obsidian via MCP
  • ā˜ļø Cloud Buffer - Notes are stored in the cloud until synced
  • šŸ”„ Auto-sync - Automatic periodic syncing with configurable intervals
  • šŸ” Secure - API key authentication support
  • šŸ“ Flexible Storage - Choose target folder for notes
  • šŸŽÆ Multiple Notes - Support for different note names
  • ⚔ Real-time - Manual sync available via command/ribbon

Setup Instructions

1. Deploy the MCP Server

Prerequisites
Steps
  1. Clone this repository:
git clone https://github.com/otrebu/obsidian-plugin-virtual-memories.git
cd obsidian-plugin-virtual-memories/mcp-server
  1. Install dependencies:
npm install
  1. Create a KV namespace:
wrangler kv:namespace create "NOTES_KV"
wrangler kv:namespace create "NOTES_KV" --preview
  1. Update wrangler.toml with your KV namespace IDs (from step 3)

  2. (Optional) Set an API key for authentication:

wrangler secret put API_KEY
# Enter your secret API key when prompted
  1. Deploy to Cloudflare:
npm run deploy
  1. Note your Worker URL (e.g., https://obsidian-mcp-server.your-account.workers.dev)

2. Configure MCP Client (AI Assistant)

For Claude Desktop, add to your claude_desktop_config.json:

{
  "mcpServers": {
    "obsidian": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/server-remote",
        "https://obsidian-mcp-server.your-account.workers.dev/sse"
      ]
    }
  }
}

Replace the URL with your actual Worker URL.

3. Install the Obsidian Plugin

Development Installation
  1. Build the plugin:
cd obsidian-plugin-virtual-memories/obsidian-plugin
npm install
npm run build
  1. Copy the built files to your vault:
# Create plugin directory
mkdir -p /path/to/your/vault/.obsidian/plugins/virtual-memories

# Copy files
cp main.js manifest.json /path/to/your/vault/.obsidian/plugins/virtual-memories/
  1. Enable the plugin in Obsidian:
    • Open Settings → Community Plugins
    • Disable "Safe Mode" if needed
    • Find "Virtual Memories" and enable it
Plugin Configuration
  1. Open Settings → Virtual Memories
  2. Configure:
    • MCP Server URL: Your Worker URL (e.g., https://obsidian-mcp-server.your-account.workers.dev)
    • API Key: Your API key (if you set one in the Worker)
    • Target Folder: Optional folder for notes (e.g., MCP Notes)
    • Auto Sync: Enable/disable automatic syncing
    • Sync Interval: How often to sync (in seconds)

Usage

From AI Assistant

In your AI conversation (e.g., Claude):

Please save this summary to my Obsidian notes:

## Meeting Notes
- Discussed project timeline
- Action items for next week
- Budget considerations

The AI will use the obsidian_append_note tool to buffer the content.

In Obsidian

  • Manual Sync: Click the cloud icon in the ribbon or use Command Palette → "Sync MCP Notes Now"
  • Auto Sync: Will sync automatically if enabled in settings
  • On Startup: Plugin syncs on Obsidian startup

MCP Server API

Tools

obsidian_append_note

Append text to a note in Obsidian.

Parameters:

  • text (string, required) - The markdown text to append
  • noteName (string, optional) - Name of the note (without .md). Defaults to "MCP Inbox"

Example:

{
  "text": "## New Section\\n\\nSome content here",
  "noteName": "Daily Notes"
}

HTTP Endpoints

  • GET / - Health check
  • POST /sse - MCP SSE endpoint
  • GET /fetch - Fetch buffered notes (used by plugin)

Development

MCP Server

cd mcp-server
npm install
npm run dev  # Start local development server

Obsidian Plugin

cd obsidian-plugin
npm install
npm run dev  # Watch mode for development

Testing

  1. Use the MCP Inspector to test the server:
npx @modelcontextprotocol/inspector https://your-worker.workers.dev/sse
  1. Test the plugin by manually triggering sync and checking logs

Project Structure

.
ā”œā”€ā”€ mcp-server/           # Cloudflare Worker MCP server
│   ā”œā”€ā”€ src/
│   │   └── index.ts      # Main server code
│   ā”œā”€ā”€ wrangler.toml     # Cloudflare config
│   └── package.json
│
ā”œā”€ā”€ obsidian-plugin/      # Obsidian plugin
│   ā”œā”€ā”€ main.ts           # Plugin main file
│   ā”œā”€ā”€ manifest-template.json
│   ā”œā”€ā”€ esbuild.config.mjs
│   └── package.json
│
└── README.md

Security Considerations

  • API Key: Always use an API key in production to prevent unauthorized access
  • HTTPS: All communication uses HTTPS
  • KV Storage: Notes are deleted after fetching to prevent duplicates
  • Local First: The plugin only writes to your local vault

Troubleshooting

Plugin doesn't sync

  • Check MCP Server URL in settings
  • Verify API key is correct
  • Check browser console (Ctrl+Shift+I) for errors
  • Ensure Worker is deployed and accessible

AI can't use the tool

  • Verify MCP client configuration
  • Check Worker logs: wrangler tail
  • Test with MCP Inspector

Notes appear duplicated

  • This shouldn't happen as notes are deleted after fetch
  • If it does, check for multiple plugin instances or sync conflicts

Contributing

Contributions are welcome! Please feel free to submit issues or pull requests.

License

MIT

Acknowledgments

Based on the concept described in the project documentation, combining:

  • Cloudflare's MCP server examples
  • Obsidian's plugin API
  • Model Context Protocol specification