Obsidian Readonly MCP
Read-only MCP server for querying a running Obsidian vault from agentic runtimes, exposing safe Obsidian CLI commands.
README
Obsidian Readonly MCP
Read-only MCP tools for querying a running Obsidian vault from Codex or another agentic runtime.
Why this exists
The Obsidian CLI is not just a filesystem reader; it is connected to your main Obsidian app. Commands such as backlinks, links, outline, and indexed search need to talk to the running Obsidian app. In agentic runtimes, the agent's filesystem sandbox can block or destabilize that app/IPC boundary. For example, running obsidian help inside an agent sandbox can cause the Obsidian app to crash.
Giving the whole agent unsandboxed shell access fixes the IPC problem, but it gives the agent too much permission. This MCP server is the narrower solution:
sandboxed agent
-> read-only MCP tool call
-> host-side MCP server
-> obsidian CLI
-> running Obsidian app
The agent can stay sandboxed. The host-side MCP server gets permission to reach Obsidian, but it exposes only a fixed allowlist of read-only Obsidian commands.
Safety model
This server:
- exposes only read-only Obsidian operations
- rejects unknown tools
- validates vault-relative paths and rejects
..path traversal - builds
obsidianargv directly without shell interpolation - caps output size
- times out long calls
It does not expose:
- note creation or editing
- delete, move, rename, append, prepend
- property mutation
- plugin/theme install, enable, disable, reload, uninstall
obsidian commandobsidian eval- app reload/restart/open/tab/workspace mutation
- browser/web/open actions
Feel free to modify it to add these features if you need them.
Tools
Core vault reads:
searchsearch_contextreaddaily_readdaily_pathbacklinkslinksoutlinealiasestagstagunresolvedpropertiesproperty_readhelp
Filesystem/index reads through Obsidian:
filefilesfolderfolderswordcountdeadendsorphansrecentsrandom_readvaultvaultsversion
Structured features:
basesbase_querybase_viewsbookmarkstaskstemplatestemplate_readsnippetssnippets_enabled
History/config metadata reads:
diffhistoryhistory_listhistory_readhotkeyhotkeyspluginspluginplugins_enabledthemethemestabsworkspaceworkspacescommands
Developer read-only inspection:
dev_consoledev_errorsdev_cssdev_dom
Install With uvx
You can run the MCP server directly from GitHub without cloning the repo:
[mcp_servers.obsidian_readonly]
command = "uvx"
args = [
"--from",
"git+https://github.com/eothL/obsidian-readonly-mcp",
"obsidian-readonly-mcp"
]
[mcp_servers.obsidian_readonly.env]
OBSIDIAN_READONLY_VAULT = "Your Vault Name"
Use the Obsidian vault name, not the filesystem path. It should be the same value you would pass to obsidian vault="Your Vault Name" ....
If this package is later published to PyPI, the config can become:
[mcp_servers.obsidian_readonly]
command = "uvx"
args = ["obsidian-readonly-mcp"]
[mcp_servers.obsidian_readonly.env]
OBSIDIAN_READONLY_VAULT = "Your Vault Name"
Restart Codex or start a new thread so the MCP server is discovered.
Install From A Local Clone
Clone this repo somewhere stable, then add the MCP server to your Codex config:
[mcp_servers.obsidian_readonly]
command = "python3"
args = ["/absolute/path/to/obsidian-readonly-mcp/src/obsidian_readonly_mcp.py"]
[mcp_servers.obsidian_readonly.env]
OBSIDIAN_READONLY_VAULT = "Your Vault Name"
Restart Codex or start a new thread so the MCP server is discovered.
Codex Plugin
This repository also includes Codex plugin metadata:
.codex-plugin/plugin.json.mcp.jsonskills/obsidian-readonly-mcp/SKILL.md
The plugin bundles the MCP server and the companion skill so Codex can learn to prefer the read-only Obsidian tools for vault exploration. The plugin MCP config does not hard-code a vault name; set OBSIDIAN_READONLY_VAULT in your environment or pass the vault argument in tool calls.
Usage
Once loaded, tools are exposed as names such as:
mcp__obsidian_readonly__search
mcp__obsidian_readonly__read
mcp__obsidian_readonly__backlinks
mcp__obsidian_readonly__links
mcp__obsidian_readonly__outline
Example tool arguments:
{"query": "agent harness memory", "limit": 10}
{"file": "Agent harness memory", "counts": true, "format": "json"}
Local smoke test
With Obsidian open:
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05"}}' \
'{"jsonrpc":"2.0","id":2,"method":"tools/list","params":{}}' \
| python3 src/obsidian_readonly_mcp.py
End-to-end read:
printf '%s\n' \
'{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"search","arguments":{"query":"agent harness","limit":3}}}' \
| python3 src/obsidian_readonly_mcp.py
Companion Skill
This repo includes a Codex skill in skills/obsidian-readonly-mcp/. Install or copy that skill into your Codex skills directory if you want agents to automatically prefer these tools for Obsidian vault exploration.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。