mcp-obsidian
- Type
- MCP server
- Scanned
- Nov 12, 2026
- Version
- 5ee0b84fa831
- Files read
- 25
This MCP server connects an AI agent to your Obsidian vault through the Obsidian Local REST API plugin so it can search, read, create, edit, and delete notes. Because file paths are neither restricted from the hidden .obsidian plugin folder nor URL-encoded before calling the API, a prompt-injected agent could overwrite executable Obsidian plugin code or reach unintended Obsidian API endpoints such as command execution.
What it can reach
- Files
- Reads, searches, creates, overwrites, patches, and deletes files and folders in your Obsidian vault via the Obsidian Local REST API, and loads a .env file if present.
- Network
- Makes HTTPS or HTTP requests to the Obsidian Local REST API server at 127.0.0.1:27124 by default, or to a user-configured host and port.
- Secrets
- Reads OBSIDIAN_API_KEY from environment variables or .env and sends it as a Bearer token on every request to the Obsidian server.
Findings
-
HighUnencoded file paths allow traversal to other Obsidian API endpoints including command execution
src/mcp_obsidian/obsidian.py:79
Vault file and directory paths from tool arguments are inserted directly into the request URL without URL-encoding or checking for '..' segments. If prompt injection tricks the AI agent into passing a path like '../commands/' to obsidian_get_file_contents or '../commands/<id>/' to obsidian_append_content, the HTTP client resolves the '..' segment and calls GET /commands/ or POST /commands/<id>/ with your API key, listing or executing Obsidian core and plugin commands that this server was never meant to expose. Unencoded '#' or '?' characters in filenames also truncate the URL path, which can cause write or delete calls to hit the wrong path.
Fix: Reject paths containing '..' segments or leading slashes, and URL-encode each path segment with urllib.parse.quote(segment, safe='') before constructing '/vault/' URLs.
-
HighFile tools allow reading and overwriting .obsidian plugin code and secrets
None of the read, write, append, patch, or delete tools block access to the hidden '.obsidian/' folder inside the vault. Because using this server guarantees at least the 'obsidian-local-rest-api' plugin is installed and enabled at '.obsidian/plugins/obsidian-local-rest-api/main.js', a prompt-injected agent can call obsidian_put_content to overwrite an installed plugin's JavaScript (which Obsidian's desktop app runs with full operating system access on reload or restart) or call obsidian_get_file_contents on '.obsidian/plugins/*/data.json' to read API keys stored by Obsidian plugins.
Fix: Normalize vault-relative paths and block any path that accesses '.obsidian' (or other dot-prefixed configuration directories) across all file read, list, write, patch, and delete handlers.
-
LowTLS certificate verification is unconditionally disabled
src/mcp_obsidian/obsidian.py:14
Every HTTPS request to Obsidian passes verify=False, which disables certificate validation and overrides system or REQUESTS_CA_BUNDLE settings, with no option to turn verification on. On the default 127.0.0.1 loopback address this stays on your machine, but if you set OBSIDIAN_HOST to reach Obsidian over a local network or remote host as shown in the README, anyone on that network path can intercept the connection, steal your OBSIDIAN_API_KEY, and read or modify your notes.
Fix: Verify TLS certificates by default for non-loopback hosts, and add an environment variable such as OBSIDIAN_CA_BUNDLE or OBSIDIAN_VERIFY_SSL so users can trust the Obsidian plugin's certificate cleanly.
-
LowDockerfile copies binaries from an unpinned :latest image tag and runs as root
If you choose the optional Docker setup instead of uvx, the Dockerfile copies the uv and uvx binaries from the mutable 'ghcr.io/astral-sh/uv:latest' tag without pinning a version or digest, and leaves the container running as root. A compromised upstream ':latest' push would be pulled into newly built images.
Fix: Pin ghcr.io/astral-sh/uv and python:3.11-slim to specific version tags and SHA-256 digests, and switch to a non-root USER before ENTRYPOINT.
