Obsidian Second Brain MCP
Enables AI agents to store and retrieve project context, bugs, decisions, and session logs by reading and appending markdown files in a local Obsidian vault, without requiring any cloud services.
README
Obsidian Second Brain MCP and Skill
Local MCP server and Codex skill for Obsidian-backed project memory.
This project turns an Obsidian vault into durable project context for AI coding agents. It is meant to complement tools like CodeGraph:
- CodeGraph answers: "How does this code work?"
- Obsidian Second Brain MCP answers: "What do we know about this project, bug, feature, decision, session, release, and next action?"
The server is local-first. It reads and appends Markdown files in your Obsidian vault. It does not require a cloud service, API key, or hosted database.
What It Provides
MCP tools:
project_memory_start- load a compact project context pack before meaningful work.project_memory_status- check repo-to-Obsidian linkage.project_memory_log_bug- record bug reports, investigation, fixes, verification, and next actions.project_memory_log_feature- record feature intent, implementation, verification, and follow-up.project_memory_record_decision- record durable choices and rationale.project_memory_close_session- write a session closeout with outcome, changed files, verification, open questions, next actions, and deployment status.
CLI commands:
obsidian-second-brain-mcp serveobsidian-second-brain-mcp initobsidian-second-brain-mcp statusobsidian-second-brain-mcp agents-snippet
Codex skill:
skills/obsidian-second-brain-mcp/SKILL.md
Requirements
- Node.js 20 or newer.
- An Obsidian vault stored on the local filesystem.
- An AI agent that supports MCP over stdio, such as Codex CLI.
Install From Source
git clone https://github.com/YOUR-USERNAME/obsidian-second-brain-mcp-and-skill.git
cd obsidian-second-brain-mcp-and-skill
npm install
npm run build
npm link
Confirm the CLI is available:
obsidian-second-brain-mcp --help
Configure Codex MCP
Add this MCP server to your Codex config. The exact config file location may vary by Codex version, but a common location is:
~/.codex/config.toml
Example:
[mcp_servers.obsidian_second_brain]
command = "obsidian-second-brain-mcp"
args = ["serve"]
Restart Codex after editing MCP config.
Link A Repo To An Obsidian Project
From the repo you want to document:
obsidian-second-brain-mcp init \
--project "Example Project" \
--vault "/absolute/path/to/your/Obsidian Vault" \
--obsidian-project "01_Projects/Example Project" \
--write-agents
This creates:
.obsidian-second-brain.json
AGENTS.md
It also creates missing starter notes inside the configured Obsidian project folder:
Project Brief.md
Bugs.md
Decisions.md
Runbook.md
Next Actions.md
Activity Log.md
Changelog.md
Releases.md
Open Questions.md
Session Log.md
Check the link:
obsidian-second-brain-mcp status
Repo Config
Each linked repo has a .obsidian-second-brain.json file:
{
"projectName": "Example Project",
"projectCode": "EP",
"vaultPath": "/absolute/path/to/your/Obsidian Vault",
"obsidianProjectPath": "01_Projects/Example Project",
"hubNote": "EP_ExampleProject_Home.md"
}
If you do not want to store vaultPath in each repo, omit it and set:
export OBSIDIAN_VAULT_PATH="/absolute/path/to/your/Obsidian Vault"
Do not commit .obsidian-second-brain.json if it contains private local paths. Use examples/project-config.example.json as the public template.
Install The Codex Skill
Copy the skill folder into your Codex skills directory:
mkdir -p ~/.codex/skills
cp -R skills/obsidian-second-brain-mcp ~/.codex/skills/
Restart Codex. The skill tells Codex when to use the MCP tools during project work.
Intended Agent Workflow
When you start work in a linked repo, the agent should:
- Call
project_memory_startwith the repo path. - Use the returned project notes as durable context.
- For bugs, call
project_memory_log_bugduring investigation and again when fixed or verified. - For features, call
project_memory_log_featurewhen scope or implementation becomes clear. - Use
project_memory_record_decisionfor durable choices. - Before final response, call
project_memory_close_sessionif meaningful work happened. - Ask whether to deploy or release when deployment status is relevant but not known.
Privacy
This repo contains no personal vault paths, project names, API keys, or private notes.
The MCP server runs locally and only reads/writes files in the vault path you configure. It does not send your notes anywhere.
You should still avoid committing:
.obsidian-second-brain.jsonfiles with private paths.- Obsidian notes copied from a private vault.
- Secrets or API keys in project notes.
Development
npm install
npm run typecheck
npm run build
Run the server manually:
obsidian-second-brain-mcp serve
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.