obsidian-mcp-server
MCP 服务配置
复制以下 JSON 到 OPClaw 或其他 MCP 客户端的配置文件中即可使用
{
"mcpServers": {
"obsidian-mcp-server": {
"args": [
"-y",
"@sunub/obsidian-mcp-server"
],
"command": "npx",
"env": {
"VAULT_DIR_PATH": "/absolute/path/to/your/obsidian/vault"
}
}
}
}
服务介绍
Obsidian MCP Server
obsidian-mcp-server Model Context Protocol(MCP) , Obsidian vault AI API .
Obsidian Vault AI (Knowledge Base) , , " " .
VaultManager Indexer Vault .
- **
Indexer**: (Inverted Index) (O(1)). . VaultManager: Vault , , , .
- ** **:
vault, , , . - **AI **:
generate_propertytitle,tags,summaryfrontmatter . - ** **:
write_propertyfrontmatter . - ** **:
organize_attachments(: ) . - ** **:
create_document_with_properties, . - ** **:
vitestEnd-to-End GitHub Actions CI/CD API .
API
obsidian-mcp-server MCP .
vault
Vault . action .
list_all: Vault .search: , , .read: frontmatter .stats: Vault (, ) .
generate_property
(filePath) , AI frontmatter .
write_property
(filePath) JSON (properties) , frontmatter .
create_document_with_properties
, , .
organize_attachments
`images/{ }` , .
MCP
MCP AI (Claude Desktop, Gemini ) .
Claude Desktop
claude_desktop_config.json :
{
"mcpServers": {
"obsidian-mcp-server": {
"command": "npx",
"args": ["-y", "@sunub/obsidian-mcp-server"],
"env": {
"VAULT_DIR_PATH": "/absolute/path/to/your/obsidian/vault"
}
}
}
}
Gemini
gemini_config.json :
{
"mcpServers": {
"obsidian-mcp-server": {
"command": "npx",
"args": ["-y", "@sunub/obsidian-mcp-server"],
"env": {
"VAULT_DIR_PATH": "/absolute/path/to/your/obsidian/vault"
}
}
}
}
-
**Vault **:
VAULT_DIR_PATH** ** .// "VAULT_DIR_PATH": "/Users/username/Documents/MyVault" "VAULT_DIR_PATH": "C:\\Users\\username\\Documents\\MyVault" // Windows "VAULT_DIR_PATH": "/mnt/c/Users/username/Documents/MyVault" // WSL // "VAULT_DIR_PATH": "~/Documents/MyVault" // "VAULT_DIR_PATH": "./vault" // -
**Node.js **: Node.js 22 .
node --version # v22.0.0 -
** **: AI MCP .
()
:
#
VAULT_DIR_PATH=/path/to/vault npx -y @sunub/obsidian-mcp-server
#
npx -y @sunub/obsidian-mcp-server --vault-path /path/to/vault
vitest End-to-End :
#
npm test
# Watch
npm run test:watch
#
npm run format
#
npm run lint
# ( + )
npm run check
CI/CD
GitHub Actions CI/CD :
- ****: TypeScript
- ****: Biome
- ****: Vitest E2E
- ****: npm
ISC License