SuperAPI AI Directory

opencode-obsidian

Office & productivity

View repository

Updated 10-16 00:20

About this skill

OpenCode Quick Start #04: Build a Second Brain with Obsidian

What will this quick start do for you?

Let OpenCode read and write your Obsidian notebook:

  • Find the Obsidian vault location
  • Install MCPVault (@bitbonsai/mcpvault)
  • Write the MCP configuration into opencode.json
  • Verify reading and writing

Prerequisites

  • Node.js is installed (version doesn't matter, handled by 00-env-setup)
  • You already have an Obsidian vault

Ask OpenCode to run the following steps for me

Step 1: Find the user's Obsidian vault

First ask the user for the notebook location. Common locations:

Sync method Common path
OneDrive C:\Users\<你>\OneDrive\文件\<vault名稱>
Google Drive Under your cloud drive sync folder <vault名稱>(the drive letter and folder name depend on your setup)
Documents C:\Users\<你>\Documents\<vault名稱>

If you don't know, you can search:

# Windows(PowerShell)
Get-ChildItem -Path "$env:USERPROFILE\OneDrive" -Recurse -Directory -Force |
  Where-Object { Test-Path (Join-Path $_.FullName ".obsidian") }

Confirmation criteria:

  • The folder exists
  • It contains the .obsidian subfolder
  • The user confirms this is the main notebook

Step 2: Install mcpvault

npm install -g @bitbonsai/mcpvault

Confirm the installation location:

# Windows
where.exe mcpvault

# macOS / Linux
which mcpvault

Step 3: Write the OpenCode MCP configuration

Edit ~/.config/opencode/opencode.json, add:

{
  "mcp": {
    "obsidian": {
      "type": "local",
      "command": ["npx", "@bitbonsai/mcpvault", "<VAULT_PATH>"],
      "enabled": true
    }
  }
}

Windows example:

{
  "mcp": {
    "obsidian": {
      "type": "local",
      "command": ["npx", "@bitbonsai/mcpvault", "C:\\Users\\<你的使用者名稱>\\Documents\\<你的vault資料夾>"],
      "enabled": true
    }
  }
}

Step 4: Verify the connection

Reopen OpenCode, then ask it:

請列出我的 Obsidian vault 根目錄的資料夾。

Then test writing:

請在我的 Obsidian 建立一則測試筆記,內容寫「OpenCode 已成功連接 Obsidian」。

Completion report format

## Obsidian 連接完成

- Vault 路徑:<VAULT_PATH>
- mcpvault:已安裝 / 未安裝
- MCP 設定:已寫入 opencode.json
- 讀取測試:成功 / 失敗
- 寫入測試:成功 / 失敗

Advanced: CLI-Anything Obsidian CLI

If you need advanced features such as full-text search, metadata operations, tag management, note analysis, etc., you can install CLI-Anything's Obsidian CLI:

Prerequisites

  1. Install the Local REST API community plugin inside Obsidian
  2. Enable HTTPS in the plugin settings (optional) and note down the API key

Installation

pip install cli-anything-hub
cli-hub install obsidian

Usage example

cli-anything-obsidian search "SKILL.md"
cli-anything-obsidian tag list
cli-anything-obsidian note get "專案工作流程.md"

💡 mcpvault (the default option in this quick start) is suitable for basic reading and writing; Obsidian CLI is suitable for scenarios that require querying, analysis, and batch operations. The two can coexist.


FAQ

Problem Solution
npm install -g EPERM appears On Windows, run as administrator
Vault not found Search the .obsidian folder location
opencode.json format error The last item in JSON cannot have a trailing comma, and paths must be in double quotes

Appendix: Second brain folder structure setup

This section was originally the standalone quick start #04 in v1, and v2 merged it into this pack—because its prerequisites are exactly the first half, and keeping them separate only leaves people unsure which one to do first. Complete the first half first (MCP connection can read and write), then do this section.

Build the three-layer structure of the Obsidian second brain, the AGENTS.md division of labor, templates, and the weekly knowledge reorganization process.


Overall architecture

Obsidian vault/
├── 每日筆記/           # 第一層:原始輸入
│   ├── 2026-05-19.md
│   └── ...
├── 創作庫/             # 第二層:加工輸出
│   ├── Claude基本功EP10 - 老師建專案指南.md
│   └── ...
└── 知識庫/             # 第三層:知識沉澱
    ├── 專案模板/
    └── ...

Three-layer division of labor

Layer Folder Content Update frequency
First layer 每日筆記/ Raw ideas, meeting notes, temporary notes Daily
Second layer 創作庫/ Organized output (video notes, quick guides) Weekly
Third layer 知識庫/ Reusable knowledge (templates, SOPs) Monthly

Ask OpenCode to perform the following steps for me

Step 1: Check whether the vault has a three-layer structure

請檢查我的 Obsidian vault 是否有以下資料夾:
- 每日筆記/
- 創作庫/
- 知識庫/

列出每個資料夾中的檔案數量。

Step 2: If missing, create it for me

If any folder is missing, OpenCode will create it for me and create an explanatory note.

Step 3: Record the Obsidian path in AGENTS.md

Confirm that the project AGENTS.md records:

## Obsidian 關聯資料
- Obsidian vault:<VAULT_PATH>
- 每日筆記:`每日筆記/<日期>.md`
- 創作庫:`創作庫/`
- 知識庫:`知識庫/`

Completion report format

## 第二大腦設定完成

- 每日筆記/:✅ 已存在 / 🆕 已建立(N 筆)
- 創作庫/:✅ 已存在 / 🆕 已建立(N 筆)
- 知識庫/:✅ 已存在 / 🆕 已建立(N 筆)
- AGENTS.md 已記錄 Obsidian 路徑:✅ / ⚠️

Weekly knowledge reorganization process

Do it once a week to keep the second brain clean:

  1. Organize daily notes: move useful information to the creation library or knowledge library
  2. Update project progress: check each project's Obsidian cockpit
  3. Clean up useless notes: delete or archive expired content

Related quick guides

  • 08-workflow-skills — The three skills of start work / end work / project initialization (they will use the second brain established by this pack)
  • 03-notebooklm — NotebookLM, another route for turning materials into teaching materials