obsidian-mysql-mcp
Provides tools for searching, reading, and appending notes in an Obsidian vault, with MCP writes restricted to inbox/, plus index/status reporting.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
obsidian-mysql-mcp
Obsidian remains the editable source of Markdown. MySQL stores a searchable index, document revisions, sync changes, and write audit records. Codex and DSH connect to the same stdio MCP server.
Bidirectional synchronization is available through the explicit sync CLI.
Writes from the MCP server itself remain restricted to inbox/; ordinary
notes under wiki/, raw/, and 我/ remain Obsidian-owned.
Requirements
Python 3.10+
A MySQL 8 server and an account allowed to create the configured database
An Obsidian vault containing Markdown files
The MySQL password is never written to config.local.toml or committed to Git.
On Windows it is stored in Credential Manager; the OBSIDIAN_MYSQL_PASSWORD
environment variable remains as an explicit override.
Related MCP server: Datacron
Install
git clone https://github.com/TomJiang123/obsidian-mysql-mcp.git
cd obsidian-mysql-mcp
python -m pip install -e ".[dev]"Configure
Create config.local.toml from config.example.toml, or launch the GUI:
$env:PYTHONPATH = "src"
python -m obsidian_mysql_mcp.guiStore the password once, then the GUI and every MCP client can read it without an exported variable:
$env:PYTHONPATH = "src"
python -m obsidian_mysql_mcp password set
python -m obsidian_mysql_mcp password showpassword set prompts twice and writes to Windows Credential Manager under
obsidian-mysql-mcp:mysql-password. password clear removes it, and a stored
password can be inspected through Credential Manager itself. Password lookup is
skipped when OBSIDIAN_MYSQL_PASSWORD is already set, and can be disabled per
config with [mysql] credential_target = false.
The GUI can test the connection, save non-secret settings, scan the vault, and show status.
Index
$env:PYTHONPATH = "src"
python -m obsidian_mysql_mcp index --full
python -m obsidian_mysql_mcp status
python -m obsidian_mysql_mcp search "matrix"MCP
Start the stdio server:
$env:PYTHONPATH = "src"
python -m obsidian_mysql_mcp.mcp_serverThe GUI starts the optional local HTTP transport at
http://127.0.0.1:8765/mcp. It binds to loopback only. Keep stdio for clients
that launch the MCP process themselves.
Exposed tools:
obsidian_search(query, limit)obsidian_read(path, max_chars)obsidian_status()obsidian_append(filename, content, title)
Client examples are in docs/codex-config.example.toml
and docs/dsh-cordis.example.yml. Keep the real
password out of client profiles and source control. On Windows, store it in
Credential Manager with password set; the child process inherits the same
Windows account and resolves the credential itself. Export
OBSIDIAN_MYSQL_PASSWORD only for clients running under another account or on
a non-Windows host.
The append tool accepts vault-relative names but always stores the result under
inbox/. Path traversal is rejected.
Bidirectional sync
C-stage sync lives behind an explicit CLI command:
$env:PYTHONPATH = "src"
python -m obsidian_mysql_mcp sync
python -m obsidian_mysql_mcp sync --applyThe first command is a dry run. --apply permits the authorized sync engine to
publish MySQL changes to Markdown, but the MCP server itself remains
inbox/-only. Divergent edits, ambiguous renames, and deletes that require a
manual decision create rows in sync_conflicts and change neither content
source.
index establishes the common baseline for every scanned note, including files
whose content was already indexed. Run an index pass once after upgrading an
existing A-stage database before using sync.
Test
$env:PYTHONPATH = "src"
python -m pytest -qThe live MySQL 8 suite is opt-in and creates then drops one uniquely named database per test:
$env:PYTHONPATH = "src"
$env:OBSIDIAN_MYSQL_E2E = "1"
$env:OBSIDIAN_MYSQL_E2E_HOST = "127.0.0.1"
$env:OBSIDIAN_MYSQL_E2E_PORT = "3306"
$env:OBSIDIAN_MYSQL_E2E_USER = "root"
$env:OBSIDIAN_MYSQL_E2E_PASSWORD = "<your password>"
python -m pytest tests/test_mysql_e2e.py -qWindows EXE
Install the build extra and run the local build script:
python -m pip install -e ".[build]"
.\build.ps1The GUI executable is written to
dist\ObsidianMySQLMCP\ObsidianMySQLMCP.exe. It is a management panel: it
configures the vault and MySQL, scans the index, and starts a loopback MCP HTTP
service. Codex/DSH can alternatively launch the Python module over stdio.
The generated executable is a local build artifact and is not committed.
When the panel starts the MCP child, its output is written next to the
executable as mcp-server.log.
The scanner and indexer tests use MemoryRepository; a live MySQL check needs a
valid local account.
Data model
documents: current searchable Markdown and stable document IDssync_changes: create, update, rename, and delete eventswrite_audit: records writes made through MCPapp_meta: persisted scan statussync_baselines: common content hash and path after a completed syncsync_conflicts: unresolved sync decisionssync_apply_journal: interrupted Markdown replacement recovery records
The schema already contains revision, content_hash, writer_owner,
deleted_at, and sync_changes; C-stage sync adds the three tables above.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Serve a folder of Markdown notes as an MCP server: hybrid search, reading, and sourced answers.
Linked markdown notes as memory for AI apps: search, read, save and link notes over MCP.
Markdown-based note-taking with a hosted MCP server. Your notes serve you and your AI.
Related MCP Servers
- AlicenseBqualityAmaintenanceA generic Markdown vault MCP server with FTS5 full-text search, semantic vector search, frontmatter-aware indexing, incremental reindexing, and non-markdown attachment support that exposes search, read, write, and edit tools.48775 PyPI42MIT
- AlicenseAqualityBmaintenanceLocal MCP server for querying and maintaining a Markdown vault. Provides full-text search, backlinks, note retrieval, and optional confined write tools, without sending the whole vault to the client context.2226 PyPI1Apache 2.0
- AlicenseAqualityCmaintenanceLocal MCP server that automates an open Obsidian vault through Obsidian's official CLI, offering tools for note creation/update, search, tasks, daily notes, and organization. It uses MCP over STDIO, requires no cloud services, and provides safety/audit features for autonomous writes.10MIT
- AlicenseAqualityBmaintenanceEnables MCP clients to read, write, search, and manage notes, canvases, kanban boards, and other Obsidian vault content over a network, without requiring the Obsidian desktop app.33MIT