Personal Knowledge Management via Obsidian MCP - capture learnings to daily notes and search vault
Ships in data. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description, though model invocation is off: only you can start it.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Capture learnings and search your Obsidian vault using the Obsidian MCP server.
This skill provides personal knowledge management functionality:
Required:
/home/dxta/Documents/Obsidian/personal~/.config/opencode/opencode.jsonVerify MCP Configuration:
cat ~/.config/opencode/opencode.json | grep -A 10 obsidian
Should show:
"obsidian": {
"type": "local",
"command": ["npx", "-y", "@huangyihe/obsidian-mcp"],
"environment": {
"OBSIDIAN_VAULT_PATH": "/home/dxta/Documents/Obsidian/personal",
"OBSIDIAN_API_TOKEN": "{env:OBSIDIAN_API_TOKEN}",
"OBSIDIAN_API_PORT": "27123"
},
"enabled": true
}
Enable Obsidian Local REST API:
export OBSIDIAN_API_TOKEN=your-token# Capture a learning to today's daily note
~/.config/opencode/skills/data/pkm/scripts/pkm.py capture "content to capture" --tags tag1,tag2
# Search vault for notes
~/.config/opencode/skills/data/pkm/scripts/pkm.py search "query" --max 10
# Show help
~/.config/opencode/skills/data/pkm/scripts/pkm.py --help
Capture a learning:
~/.config/opencode/skills/data/pkm/scripts/pkm.py capture "Learned about React hooks optimization" --tags react,frontend
Search for notes:
~/.config/opencode/skills/data/pkm/scripts/pkm.py search "obsidian"
Search with max results:
~/.config/opencode/skills/data/pkm/scripts/pkm.py search "project management" --max 20
Capture without tags:
~/.config/opencode/skills/data/pkm/scripts/pkm.py capture "Important meeting notes"
Capture with multiple tags:
~/.config/opencode/skills/data/pkm/scripts/pkm.py capture "Key insight about database design" --tags database,backend,sql
Learnings are captured to daily notes at:
Daily Notes/YYYY-MM-DD.md
Each learning entry is formatted as:
---
type: learning
source: opencode
tags: ["tag1", "tag2"]
created: 2025-01-02T10:30:00Z
---
## Learning
[Your captured content]
---
_Captured via OpenCode @ 10:30_
The PKM skill integrates with OpenCode's MCP tools:
obsidian_create_note or obsidian_update_note MCP toolsopencode.jsonTo verify MCP is working:
# In OpenCode, the skill will instruct AI to use:
@obsidian_search_vault(query="your query")
# Or create/update notes:
@obsidian_create_note(path="Daily Notes/2025-01-02.md", content="...")
Capture output (instructions for AI):
Please create/update note at: Daily Notes/2025-01-02.md
Content to append:
---
type: learning
source: opencode
tags: ["react", "frontend"]
created: 2025-01-02T10:30:00Z
---
## Learning
Learned about React hooks optimization
---
_Captured via OpenCode @ 10:30_
Use the obsidian MCP create_note or update_note tool.
If note exists, append this content to it.
Search output (instructions for AI):
Please search the Obsidian vault for: project management
Use the obsidian MCP search_vault tool with query: "project management"
Return of the top 10 results with relevant excerpts.
CLI mode output (direct invocation):
Note path: Daily Notes/2025-01-02.md
Content:
---
type: learning
source: opencode
tags: ["react", "frontend"]
created: 2025-01-02T10:30:00Z
---
## Learning
Learned about React hooks optimization
---
_Captured via OpenCode @ 10:30_
Use Claude Code with Obsidian MCP to create this note.
Obsidian MCP not configured
Obsidian MCP server not found or disabledopencode.json and OBSIDIAN_API_TOKEN is setObsidian not running
Connection refused or ECONNREFUSEDVault path not found
Vault path does not existopencode.json matches actual locationAPI token invalid
Unauthorized or 403 ForbiddenOBSIDIAN_API_TOKEN in environment or opencode.jsonUser Request: "I just learned about useCallback optimization"
Usage: The skill instructs AI to capture via MCP
Output (what AI executes):
@obsidian_create_note(
path="Daily Notes/2025-01-02.md",
content="---\ntype: learning\nsource: opencode\ntags: [\"react\", \"hooks\", \"optimization\"]\ncreated: 2025-01-02T10:30:00Z\n---\n\n## Learning\n\nLearned about useCallback optimization to prevent unnecessary re-renders.\n\n---\n_Captured via OpenCode @ 10:30_"
)
User Request: "What have I learned about databases?"
Usage: The skill instructs AI to search via MCP
Output (what AI executes):
@obsidian_search_vault(query="database", max_results=10)
User Request: "Capture this learning: 'Database indexing improves read performance by 100x'"
Command:
~/.config/opencode/skills/data/pkm/scripts/pkm.py capture "Database indexing improves read performance by 100x" --tags database,performance,optimization
Daily Notes/YYYY-MM-DD.md conventionopencode for captures via this skillWhat SKILL.md sets; muted values are Claude Code's defaults
/data:pkmfrom data
npx claudepluginhub dxta/claude-code-skills --plugin data2 skills in this plugin
Other plugins' skills for the same job