second-brain-mcp
second-brain-mcp
모든 Obsidian 또는 일반 마크다운 볼트를 위한 읽기 전용 MCP 서버로, 검색 프로토콜을 말로 요청하는 대신 서버가 강제로 적용합니다.
마크다운 노트가 담긴 폴더를 지정하면 Claude Code, Claude Desktop, Cursor 등 모든 MCP 클라이언트가 네 가지 관리 도구를 통해 해당 지식 베이스를 질의할 수 있습니다. 서버는 구조적으로 쓸 수 없고, 볼트 디렉터리를 벗어날 수 없으며, 페이지 읽기 하드 예산에 도달하면 세션을 중단합니다.
왜 필요한가
개인 지식 베이스는 결국 하나의 도구에 종속되기 마련입니다. 노트는 Obsidian에 있고, 그 노트를 활용할 AI 어시스턴트는 다른 곳에 있으니 복사해서 붙여넣게 됩니다. 그리고 어시스턴트가 파일 접근 권한을 얻어도 "필요한 것만 읽어 주세요"라는 말은 규칙이 아니라 정중한 부탁일 뿐입니다.
이 서버는 두 문제를 모두 해결합니다:
하나의 커넥터로 모든 앱. MCP는 AI 도구의 USB-C와 같습니다. 볼트 커넥터를 한 번 작성하면 어떤 MCP 클라이언트든 사용할 수 있습니다.
프로토콜은 제안이 아니라 법입니다. 인덱스 우선 검색, 페이지 읽기 하드 예산, 읽기 전용 접근, 경로 샌드박스가 코드로 강제됩니다. 존재하는 연산은 오직 관리되는 연산뿐입니다.
Related MCP server: obsidian-gate
설치
Node.js 18 이상이 필요합니다.
옵션 A - npm에서 설치
claude mcp add second-brain -- npx -y @nanthansr/second-brain-mcp /abs/path/to/your/vault이 명령 한 줄로 Claude Code에 서버가 등록됩니다. npx가 패키지를 자동으로 가져와 실행합니다. 다른 클라이언트는 아래 구성 블록을 참조하세요.
옵션 B - 소스에서 설치
git clone https://github.com/nanthansr/second-brain-mcp
cd second-brain-mcp
npm install && npm run build
npm test # 15-check integration suite - should end with SMOKE PASS
claude mcp add second-brain -- node /abs/path/to/second-brain-mcp/dist/index.js /abs/path/to/your/vaultClaude Desktop
claude_desktop_config.json에 추가합니다(설정 → 개발자 → 구성 편집):
{
"mcpServers": {
"second-brain": {
"command": "npx",
"args": ["-y", "@nanthansr/second-brain-mcp", "/abs/path/to/your/vault"]
}
}
}Cursor
~/.cursor/mcp.json에 같은 블록을 추가합니다(또는 Cursor 설정 → MCP → 새 서버 추가).
준비된 볼트가 없나요?
볼트 인자를 아예 생략하면 서버가 번들에 포함된 가상 데모 볼트("Alex Rivera")를 제공합니다. 30초 안에 시험해 보기에 유용합니다:
claude mcp add second-brain-demo -- npx -y @nanthansr/second-brain-mcpObsidian 볼트 지정하기
볼트는 그냥 폴더입니다. Obsidian에서 "폴더를 볼트로 열기"라고 할 때 선택한 바로 그 폴더입니다. 그 폴더의 절대 경로를 인자로 전달하세요:
OS | Example |
Windows |
|
macOS / Linux |
|
참고:
볼트 루트의
index.md가 인덱스 우선 흐름(get_index)을 활성화합니다. 각 노트당 한 줄씩 기술된 카탈로그 페이지입니다. 이 파일이 없어도 모든 기능은 정상 작동합니다. 모델이search_notes로 대체합니다.Obsidian 자체 구성(
.obsidian/)과 기타 모든 점(dot) 폴더는 서버에 보이지 않습니다.서버는 어떤 것도 수정하지 않으므로 실행 중에도 Obsidian을 열어 둘 수 있습니다.
사용법
연결되면 질문만 하면 됩니다. 일반적인 흐름은 다음과 같습니다(데모 볼트를 대상으로 한 실제 세션에서 가져옴):
"Alex Rivera는 무엇을 작업 중이고 Sam은 누구인가요?" →
get_index→read_note×3 (각각read 1/5,read 2/5,read 3/5로 표시됨) → 인용된 답변.
"이번 주 볼트에서 변경된 것은 무엇인가요?" →
list_recent(days: 7)→ 날짜 목록, 최신순.
"가격에 관한 메모는 어디에 두고 있나요?" →
search_notes(query: "pricing")→ 줄 번호가 표시된 스니펫과 함께 일치하는 페이지 반환, 예산 소모 없음.
MCP 프롬프트를 지원하는 클라이언트에는 vault-retrieval도 제공됩니다. 특정 질문에 대해 모델을 인덱스 우선 프로토콜에 고정하는 슬래시 명령 템플릿입니다.
클라이언트가 받는 것
종류 | 이름 | 기능 | 예산 |
도구 |
|
| 무료 |
도구 |
| 대소문자를 구분하지 않는 검색, 페이지와 줄 번호가 있는 스니펫 반환 | 무료 |
도구 |
| 볼트 상대 경로로 한 페이지의 전체 내용 반환 | 차감 |
도구 |
| 최근 N일 이내 수정된 페이지를 최신순으로 반환 | 무료 |
리소스 |
| 인덱스를 MCP 리소스로 제공 | 무료 |
프롬프트 |
| 인덱스 우선 프로토콜을 재사용 가능한 프롬프트 템플릿으로 제공 | - |
의도된 흐름은 신중한 사람이 위키를 사용하는 방식과 같습니다. 카탈로그를 읽고, 중요한 한두 페이지를 연 다음, 인용과 함께 답변합니다. 검색은 비용이 저렴하지만 읽기는 예산이 적용됩니다.
구성
설정 | 방법 | 기본값 |
볼트 경로 | 첫 번째 CLI 인자 또는 | 번들된 |
페이지 읽기 예산 |
| 세션당 5회 |
보안 모델
구조적으로 읽기 전용. 코드베이스에는 쓰기, 편집, 삭제 도구가 존재하지 않습니다.
경로 샌드박스. 모든 경로는 먼저
path.resolve로 정규화된 후 볼트 루트와 비교됩니다. 경로 이탈 시도(../…)는 거부되며.md파일만 읽을 수 있습니다.페이지 하드 예산. N번의
read_note호출(기본 5회) 이후 서버는 추가 읽기를 거부하고 모델에게 지금까지 읽은 내용을 바탕으로 종합하라고 안내합니다. 실패한 읽기는 예산을 소모하지 않습니다.크기 상한. 노트는 50KB에서 잘리고, 검색 결과와 최근 목록도 상한이 적용됩니다.
점(dot) 폴더 건너뜀.
.obsidian,.git및 기타 점 폴더는 보이지 않습니다.코드는 공개, 데이터는 비공개. 리포지토리에는 서버 코드와 가상의 데모 볼트만 포함됩니다. 실제 볼트는 런타임에 마운트한 폴더이며, 절대 사용자의 머신을 벗어나지 않습니다.
FAQ
내 데이터가 내 머신을 벗어나나요? 아니요. 서버는 MCP 클라이언트의 자식 프로세스로 로컬에서 실행되며 디스크에서 파일을 읽습니다. 네트워크 코드는 포함되어 있지 않습니다.
내 노트를 수정하거나 삭제할 수 있나요? 아니요. 쓰기 도구가 없습니다. 이는 설정이 아니라 코드 자체의 속성입니다.
모델이 예산을 소진하면 어떻게 되나요? 6번째 읽기는 모델에게 이미 읽은 페이지를 바탕으로 종합하라고 알리는 오류를 반환합니다. 새 대화에서는 새 예산이 부여됩니다.
데모 답변에 왜 "Alex Rivera"가 언급되나요? 번들로 제공되는 가상 데모 볼트를 사용 중이기 때문입니다. 첫 번째 인자로 자신의 볼트 경로를 전달하세요.
개발
npm run build # tsc -> dist/
npm test # build + 15-check smoke test (spawns the real server over stdio)스모크 테스트는 SDK 자체 클라이언트를 컴파일된 서버에 연결해 실제 프로토콜로 수행하며 목(mock)을 사용하지 않습니다. 네 가지 도구, 리소스, 프롬프트, 경로 이탈 거부, 그리고 읽기 예산이 N+1번째 읽기를 거부하는지 검증합니다. CI는 Linux와 Windows, Node 20 및 22에서 실행합니다.
이런 방식으로 만든 이유가 궁금하다면 docs/design-notes.md를 참조하세요. 전송 방식, MCP의 세 가지 기본 요소, 스키마를 프롬프트로 사용하는 방법, 샌드박스와 예산 결정에 대한 내용이 있습니다.
로드맵
인증을 포함한 원격 변형(스트리밍 가능한 HTTP)을 지원하여 호스팅 클라이언트에서도 볼트에 접근할 수 있게 하기
선택적 폴더별 범위 지정(
wiki/만 제공하고journal/숨기기)
기여
이슈와 PR을 환영합니다. 불변 조건을 지켜 주세요. 쓰기 도구 없음, 네트워크 호출 없음, 스모크 테스트가 약화되지 않고 계속 통과 상태를 유지해야 합니다.
라이선스
MIT · 변경 사항은 CHANGELOG.md를 참조하세요.
Available Tools
4 toolsget_indexGet the vault indexA
Returns index.md, the catalog of every page in the vault (one line each). ALWAYS call this first to locate relevant pages, then read only the 1-2 pages that matter. Does not count against the page budget.
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden. It discloses the output behavior (one line per page) and adds a meaningful operational trait: 'Does not count against the page budget,' which is beyond what the schema or title conveys. It could mention side-effect-free/read-only nature, but the context strongly implies a safe read.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three short sentences deliver the core purpose, usage directive, and budget behavior in order of importance. No filler or redundant restating of the title.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a zero-parameter tool with no output schema, the description fully covers what the agent needs: what it returns, how to use it first, and why it is safe to invoke. There are no missing details that would prevent a correct call.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters and schema coverage is 100%, so there are no parameter semantics to document. The description adds useful meaning about the returned content, which is more than necessary for a parameterless tool.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
States a specific verb ('Returns') and resource ('index.md'), and precisely defines the output as 'the catalog of every page in the vault (one line each).' This clearly differentiates it from the sibling tools like search_notes or read_note.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly directs the agent to 'ALWAYS call this first' and then 'read only the 1-2 pages that matter,' giving a clear workflow. It does not explicitly name search_notes or list_recent as alternatives, but the sequential guidance is strong enough to establish when this tool should be used.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
list_recentList recently updated pagesA
Lists pages modified in the last N days (default 7), newest first. Good for 'what changed lately'. Does not count against the page budget.
| Name | Required | Description | Default |
|---|---|---|---|
| days | No | Look-back window in days (default 7) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the full burden and does disclose useful behavioral traits: a default look-back window, newest-first ordering, and that it does not consume page budget. It does not describe the returned page format or any limits beyond the schema, but for a simple read-only list tool this is solid transparency.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two short sentences carry the core behavior, the primary use case, and a key operational constraint with no filler. The most important information is front-loaded, and every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple tool with one fully documented optional parameter and no output schema, the description covers the essential behaviors: what is listed, the time window, ordering, and budget impact. It could be more complete by describing what fields/details appear in the returned page list, but it is sufficient for an agent to select and invoke the tool correctly.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100% and the single 'days' parameter is already documented with type, range, and default. The description only repeats the default window, adding no new semantic meaning beyond what the schema already provides, so the baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states a specific verb ('Lists') and resource ('pages'), with a defined time window and sort order ('last N days (default 7), newest first'). It does not explicitly name or differentiate itself from sibling tools like search_notes or get_index, but the 'recently modified' framing makes its distinct purpose reasonably clear.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives clear usage context with 'Good for what changed lately' and adds a practical benefit ('Does not count against the page budget'). However, it does not mention when not to use it or point to alternative sibling tools, so it stops short of full routing guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
read_noteRead one pageA
Returns the full content of one markdown page by vault-relative path (e.g. wiki/people/sam-okafor.md). Counts against the hard page budget of 5 reads per session - locate pages via get_index or search_notes first, then read only what matters.
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Vault-relative path to a .md file |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries the full burden and discloses a key non-obvious behavior: the hard page budget of 5 reads per session. It also clarifies that the tool returns full content. It could additionally mention error behavior for missing paths or confirm it is a pure read, but it is already meaningfully transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Two sentences with no filler. The first sentence establishes the core function and path format; the second adds the budget constraint and recommended preceding workflow. Every sentence earns its place.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a single-parameter read tool with no output schema, the description is complete: it states what is returned, how to address the resource, and a critical usage constraint. It also routes the agent to the right discovery tools before reading.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, so the baseline is 3. The description adds value with a concrete path example ('wiki/people/sam-okafor.md') and reinforces the vault-relative .md semantics, making the expected input format clearer to the agent.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('Returns the full content') and a precise resource ('one markdown page by vault-relative path'). With the title 'Read one page' and sibling tools like search_notes and list_recent, it is immediately distinguishable as a targeted read operation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
It explicitly tells the agent to locate pages via get_index or search_notes first and to 'read only what matters', plus it warns about the hard 5-read budget. It does not explicitly mention list_recent or state when not to use this tool, so it falls just short of full exclusion guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
search_notesSearch the vaultA
Case-insensitive text search across every markdown page. Returns matching pages with line-numbered snippets. Use when the index does not answer 'where does this live'. Does not count against the page budget.
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | Text to search for (literal, not regex) | |
| max_results | No | Max pages to return (default 10, cap 30) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations provided, the description carries the behavioral disclosure burden. It discloses case-insensitive matching, global scope, snippet return format, and the useful operational fact that it does not count against the page budget. It does not explicitly state read-only behavior, but this is strongly implied by 'search'.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, each carrying distinct value: the core behavior, the return format, and the usage trigger plus budget note. It is front-loaded and free of filler.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
For a simple two-parameter search tool with no output schema, the description covers scope, matching behavior, return shape, and when to use it. Nothing essential for correct invocation is missing.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 100%, so the parameters are already fully documented. The description adds context about case-insensitivity and scope but does not materially extend what the schema provides for query and max_results.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description states a specific verb ('search') and resource ('every markdown page'), with concrete details like case-insensitivity and line-numbered snippets. It is clearly distinct from sibling tools like get_index, read_note, and list_recent.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly says to use it 'when the index does not answer where does this live', giving a clear trigger condition. It does not enumerate exclusions or compare against read_note/list_recent, but the context is unambiguous enough for an agent to route correctly.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
get_index - First observed
list_recent - First observed
read_note - First observed
search_notes
TDQS
Scored across 4 tools
Each tool has a clearly distinct role: index for catalog lookup, search for text search, read for content retrieval, and list_recent for recency. The descriptions even specify when to prefer one over another, removing ambiguity.
All tool names use snake_case with an imperative verb first, creating a predictable pattern. list_recent is slightly less parallel than list_recent_notes, but the deviation is minor and does not confuse the set.
Four tools is well-scoped for a retrieval-focused note vault: discovery via index/search/recent and content access via read. Each tool serves a distinct workflow step with no redundancy.
The surface fully covers read-oriented workflows: locating notes, finding content by text, checking recent changes, and reading full pages. The only notable gap is write/edit operations, but the tool descriptions consistently frame this as a read-only vault interface.
Maintenance
Related MCP Connectors
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Search, read, and safely update Markdown notes in your connected Phasoric knowledge vaults.
Agent-native notes, tasks, dev-docs, vaults, sync & handoffs. MCP + OpenAPI dual surface.
- GraniteOAuthmd.granite
Encrypted Markdown notes and team knowledge base. Search, read and write notes in vaults you allow.
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides read-only access to an Obsidian vault, enabling file listing, content reading, and text search across notes via MCP.42Apache 2.0
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to read, search, write, and link notes in an Obsidian vault via MCP tools and resources.MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to search, read, and list notes and tags in a Markdown vault using read-only tools.MIT
- FlicenseNot gradedqualityCmaintenanceEnables MCP clients to search, read, list, and append to markdown notes in a local Obsidian vault or folder of .md files.-