mcp-obsidian
Provides tools to read, write, search, and manage files in an Obsidian vault through the Local REST API, including periodic notes, recent changes, and converting notes to blog posts.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
mcp-obsidian
Obsidian Local REST API를 통해 Obsidian vault와 상호작용하는 MCP(Model Context Protocol) 서버입니다.
개요
Claude 등 MCP 클라이언트가 Obsidian vault의 파일을 읽고, 쓰고, 검색하는 기능을 Tool 형태로 제공합니다. Obsidian 커뮤니티 플러그인인 Local REST API를 통해 vault와 통신합니다.
Related MCP server: obsidian-mcp-server
디렉토리 구조
mcp-obsidian/
├── src/
│ └── mcp_obsidian/
│ ├── __init__.py # 패키지 진입점, main() 함수 정의
│ ├── server.py # MCP 서버 설정 및 tool 핸들러 등록
│ ├── tools.py # 각 Tool 핸들러 클래스 정의
│ └── obsidian.py # Obsidian REST API 클라이언트
├── pyproject.toml
└── README.md파일별 기능
obsidian.py — REST API 클라이언트
Obsidian 클래스가 Obsidian Local REST API와 직접 통신합니다. 환경변수(OBSIDIAN_PROTOCOL, OBSIDIAN_HOST, OBSIDIAN_PORT)로 접속 정보를 설정하며, 모든 HTTP 요청에 Bearer 토큰 인증을 적용합니다.
메서드 | 설명 |
| vault 루트의 파일/디렉토리 목록 조회 |
| 특정 디렉토리의 파일 목록 조회 |
| 단일 파일 내용 반환 |
| 여러 파일 내용을 헤더와 함께 연결하여 반환 |
| 텍스트 기반 단순 검색 |
| JsonLogic 쿼리 기반 복합 검색 |
| 파일 끝에 내용 추가 |
| 헤딩/블록/프론트매터 기준으로 내용 삽입 |
| 파일 생성 또는 전체 내용 덮어쓰기 |
| 파일 또는 디렉토리 삭제 |
| 현재 주기적 노트(일간/주간 등) 조회 |
| 최근 주기적 노트 목록 조회 |
| 최근 수정된 파일 목록 조회 (Dataview DQL 사용) |
tools.py — Tool 핸들러
ToolHandler 추상 클래스를 기반으로 각 MCP Tool을 클래스로 구현합니다. 각 클래스는 get_tool_description()(Tool 스키마 반환)과 run_tool(args)(실제 실행)을 구현합니다.
클래스 | Tool 이름 | 설명 |
|
| vault 루트의 전체 파일 목록 |
|
| 특정 디렉토리의 파일 목록 |
|
| 단일 파일 내용 반환 |
|
| 여러 파일 내용 일괄 반환 |
|
| 텍스트 단순 검색 |
|
| JsonLogic 복합 검색 |
|
| 파일에 내용 추가 |
|
| 헤딩/블록/프론트매터 기준 부분 수정 |
|
| 파일 생성 또는 전체 교체 |
|
| 파일 삭제 (confirm 필수) |
|
| 현재 주기적 노트 조회 |
|
| 최근 주기적 노트 목록 |
|
| 최근 수정 파일 목록 |
|
| 노트를 블로그 포스팅 형식으로 변환 (커스텀) |
BlogConversionToolHandler (커스텀 Tool 상세)
obsidian_convert_to_blog는 기존 Obsidian 노트를 블로그 포스팅 형식으로 변환하여 저장하는 커스텀 Tool입니다.
동작 방식
이 Tool은 단순히 파일을 저장하는 역할만 합니다. 변환 로직은 Tool의 description에 포함된 상세한 지시문을 통해 Claude가 직접 수행합니다.
Claude가
obsidian_get_file_contents로 원본 노트를 먼저 읽음Claude가 description의 변환 규칙에 따라
processed_content생성이 Tool이
target_path에 결과물을 저장
입력 파라미터
파라미터 | 타입 | 설명 |
| string | 저장할 파일 경로 (vault 루트 기준 상대 경로) |
| string | Claude가 변환 규칙에 따라 생성한 마크다운 문자열 |
변환 규칙 (Claude에 전달되는 지시문 요약)
프론트매터: 없으면
title,cssclasses,tags,aliases를 포함한 YAML 추가문서 구조:
최상단에
> [!summary] 💡 이 글의 핵심callout (3~6개 불릿)# 1. 들어가며또는# 1. 개념으로 시작# 2.,# 3.번호 매긴 H2 본론 전개, 하위 항목은## 2.1계층 구조마지막은
> [!example] Referencecallout으로 마무리
문체: 건조한 평서체 (~이다), 독자 유도 표현 사용, 이모지/인사말 없음
포맷팅: 볼드(
**), 하이라이트(==텍스트==), 표, 코드 블록(언어 명시), Callout 박스 활용LaTeX: 인라인
$수식$, 블록$$수식$$, 정렬 필요시\begin{align}사용
server.py — MCP 서버
MCP 서버를 초기화하고 모든 Tool 핸들러를 등록합니다. @app.list_tools()와 @app.call_tool() 핸들러를 통해 클라이언트 요청을 처리합니다. stdio_server를 통해 표준 입출력으로 통신합니다.
__init__.py — 패키지 진입점
server.py의 main() 함수를 노출하여 pyproject.toml의 스크립트 엔트리포인트(mcp-obsidian)에서 호출됩니다.
설정
환경 변수
변수 | 필수 | 기본값 | 설명 |
| 필수 | - | Obsidian Local REST API 키 |
| 선택 |
| Obsidian REST API 호스트 |
| 선택 |
| Obsidian REST API 포트 |
| 선택 |
| 통신 프로토콜 ( |
.env 파일 또는 MCP 클라이언트 설정의 env 항목으로 지정할 수 있습니다.
설치 및 설정
사전 요구사항
Obsidian 커뮤니티 플러그인 Local REST API를 설치하고 활성화한 후 API 키를 복사합니다.
Claude Desktop 설정
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%/Claude/claude_desktop_config.json
{
"mcpServers": {
"mcp-obsidian": {
"command": "uvx",
"args": ["mcp-obsidian"],
"env": {
"OBSIDIAN_API_KEY": "<your_api_key_here>",
"OBSIDIAN_HOST": "<your_obsidian_host>",
"OBSIDIAN_PORT": "<your_obsidian_port>"
}
}
}
}{
"mcpServers": {
"mcp-obsidian": {
"command": "uv",
"args": [
"--directory",
"<dir_to>/mcp-obsidian",
"run",
"mcp-obsidian"
],
"env": {
"OBSIDIAN_API_KEY": "<your_api_key_here>",
"OBSIDIAN_HOST": "<your_obsidian_host>",
"OBSIDIAN_PORT": "<your_obsidian_port>"
}
}
}
}개발
의존성 설치
uv sync디버깅
MCP Inspector를 사용하면 Tool 호출을 브라우저에서 직접 테스트할 수 있습니다.
npx @modelcontextprotocol/inspector uv --directory /path/to/mcp-obsidian run mcp-obsidian서버 로그 확인 (macOS):
tail -n 20 -f ~/Library/Logs/Claude/mcp-server-mcp-obsidian.logTool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Notes and memory assistant: one Markdown vault that Claude, ChatGPT and any MCP client can share.
Read and write your Fresh Jots notes from Claude, Cursor, and any MCP client.
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Search and reason over your Obsidian-style Markdown vault, right from ChatGPT.
Related MCP Servers
- AlicenseBqualityDmaintenanceEnables Claude to interact with an Obsidian vault via the Local REST API plugin, supporting file operations, search, periodic notes, commands, and semantic search.22MIT
- AlicenseNot gradedqualityDmaintenanceEnables Claude Desktop to interact with an Obsidian vault through the Local REST API, allowing file listing, reading, searching, creating, and updating markdown notes.MIT
- AlicenseNot gradedqualityBmaintenanceEnables hybrid search, reading, writing, and managing a local Obsidian vault through MCP tools and a REST API, including section patching, appending, moving notes with link rewriting, and frontmatter updates.AGPL 3.0
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients such as Claude Desktop and Claude Code to list, read, search, write, append to, move, rename and delete Markdown notes, manage folders, tags and frontmatter, and create dated daily notes in a local vault, all without Obsidian running. Paths are confined to the vault root, though write and delete operations act directly on real files, so backups or version control are advised.MIT