o

obsidian-mcp-server

@sunub/obsidian-mcp-server
0 Stars 187 次浏览 sunub 更新于 2026-08-23

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_property title, tags, summary frontmatter .
  • ** **: write_property frontmatter .
  • ** **: organize_attachments (: ) .
  • ** **: create_document_with_properties , .
  • ** **: vitest End-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"
      }
    }
  }
}

  1. **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"              //    
    
  2. **Node.js **: Node.js 22 .

    node --version  # v22.0.0  
    
  3. ** **: 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

相关 MCP 服务