obsidian-mcp-remote
A remote MCP server that enables read/write access to a self-hosted Obsidian vault, exposing tools for reading, writing, patching, listing, and searching vault content. It works without Obsidian running and uses Git as a rollback mechanism.
README
obsidian-mcp-remote
A remote MCP server that gives Claude (Desktop, Code, or a Custom Connector) read/write access to a self-hosted Obsidian vault — no need to keep Obsidian running, no Local REST API plugin, works from any device.
Exposes the same five tools as the local Obsidian MCP setup: vault_read, vault_write,
vault_patch, vault_list, search_query — drop-in compatible.
How it works
- The vault is a plain Git checkout on your VPS (e.g. auto-pulled from a private Gitea/GitHub repo).
- This server mounts that checkout read-write and speaks MCP over HTTP.
- Two auth zones, so you don't need OAuth just to use it from your own machine over Tailscale:
- Internal (Tailscale network — Desktop-direct, Claude Code): a static bearer token.
- External (public internet — Mobile/Web Custom Connectors): a real OAuth 2.0 server
(PKCE S256 required, Dynamic Client Registration,
/oauth/authorizegated by a passkey or password).
- Git is your rollback net: every write is a plain file write, revertable via
git reverton the vault repo like any other change.
Quickstart
Requirements: Docker, a domain (only needed for the external/OAuth zone), a Tailscale network (only needed for the internal zone).
git clone <this-repo> obsidian-mcp-remote
cd obsidian-mcp-remote
npm run setup # generates .env with strong random secrets
# edit .env: fill in VAULT_PATH, TAILSCALE_IP, HOST_PORT, DOMAIN, OAUTH_CLIENT_REDIRECT_URI
docker compose up -d --build
curl http://<TAILSCALE_IP>:<HOST_PORT>/health # -> {"status":"ok"}
npm run setup never overwrites an existing .env — pass --force if you deliberately want to
rotate every generated secret.
For the external/OAuth zone to be reachable from claude.ai (Mobile/Web) or over plain internet,
put a reverse proxy with a real TLS certificate in front of HOST_PORT (e.g. Nginx Proxy Manager
- Let's Encrypt) and point
DOMAINat it. The internal/Tailscale zone works without any of that.
Connecting a client
Claude Code / anything that accepts a static bearer token (internal zone, over Tailscale):
{
"mcpServers": {
"obsidian": {
"type": "http",
"url": "http://<TAILSCALE_IP>:<HOST_PORT>/mcp",
"headers": { "Authorization": "Bearer <TOKEN_INTERNAL from .env>" }
}
}
}
Claude Desktop (via mcp-remote, since Desktop doesn't speak Streamable HTTP directly):
{
"mcpServers": {
"obsidian": {
"command": "npx",
"args": ["mcp-remote@latest", "https://<DOMAIN>/mcp"]
}
}
}
--header-only auth doesn't work here: mcp-remote always runs its OAuth discovery flow
regardless of flags, so Desktop goes through the external/OAuth zone (below), not TOKEN_INTERNAL.
First connection opens a browser to /oauth/authorize — log in with a passkey (if registered) or
the password. The issued refresh token keeps you logged in across restarts (see Passkey section).
claude.ai Custom Connector (Mobile/Web, external zone): Settings → Connectors → Add custom
connector → https://<DOMAIN>/mcp, with OAUTH_CLIENT_ID/OAUTH_CLIENT_SECRET from .env under
Advanced settings. Same /oauth/authorize login as Desktop above.
Passkey login (recommended)
/oauth/authorize accepts a WebAuthn passkey (Windows Hello, a phone's fingerprint sensor, a
hardware security key) instead of typing the password — not phishable the way a password is, and
usually faster. Register one once:
- Visit
https://<DOMAIN>/webauthn/setup. - Enter
OAUTH_PASSWORDto authorize the registration, then follow the browser's passkey prompt. - From then on,
/oauth/authorizeshows a "Mit Passkey anmelden" button. The password field stays as a fallback if the passkey device isn't available.
Only one passkey is stored at a time (single-user tool) — registering a new one replaces the old
one. Requires the real public HTTPS DOMAIN; won't work against a raw Tailscale IP or plain HTTP.
Security notes
- Never commit
.env— it's already in.gitignore, only.env.exampleis tracked. - Rotate secrets periodically (
npm run setup --force+ restart), especially after sharing your screen, pasting a token into a chat, or any other accidental exposure. - The OAuth password (
OAUTH_PASSWORD) is the only gate on the public/oauth/authorizeendpoint — rate-limited, but still a single factor. Use a long random value (the setup script generates one; don't replace it with something memorable). TOKEN_INTERNALis scoped to the Tailscale network by thedocker-compose.ymlport binding (${TAILSCALE_IP}:${HOST_PORT}:3000, never0.0.0.0) — don't change that binding without understanding you'd be exposing the internal token to the public internet.- Read/write access means a leaked token lets someone read your whole vault, not just write to it. Git history protects against destructive edits, not against exfiltration.
- Set
NTFY_TOPICin.envto get a push notification (via ntfy.sh, no account needed) whenever the rate limiter trips or a login attempt fails — otherwise you won't know someone's probing the endpoint. Pick an unguessable topic name; treat it like a secret. - Dependabot is enabled on this repo (
.github/dependabot.yml) for npm and Docker base image updates. CodeQL (.github/workflows/codeql.yml) and gitleaks (.github/workflows/gitleaks.yml) run on every push/PR plus a weekly schedule for CodeQL. - Dynamic Client Registration (
POST /register) only accepts loopback redirect URIs (http://localhost|127.0.0.1) — it's unauthenticated by design (RFC 7591), so accepting arbitraryhttps://targets would let anyone self-register a client and phish your password/passkey via a crafted/oauth/authorizelink, with the authorization code landing on their own server. - Registered clients and issued tokens live in a plain JSON file (
OAUTH_STORE_PATH), not encrypted at rest. Accepted for this threat model — the host already holds.envin the clear — but worth knowing if you ever back up or move that volume: treat it like any other secrets file. npm run oauth:list/npm run oauth:revoke -- <client_id>inspect or remove a registered client and its tokens directly in the store file — the only way to review or undo a consent grant on a tool with no admin UI. Requires a container restart to take effect, since the running server only reads this file once at startup. DCR clients that never complete a token exchange within 30 days are pruned automatically on the next restart; the preregistered client never is.- Rate limiting is in-memory per process and resets on every container restart — acceptable for a single-container deployment, but don't rely on it surviving a redeploy.
Development
npm install
npm test # node:test, no external test runner
npm run build
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。