sunub/obsidian-mcp-server
If you are the rightful owner of obsidian-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Obsidian MCP Server facilitates seamless interaction with Obsidian vault documents for external applications and AI, enabling easy reading, analysis, and automatic property generation and application.
Obsidian MCP Server
obsidian-mcp-server
๋ Model Context Protocol(MCP)์ ๊ตฌํํ ์๋ฒ๋ก, ๋ก์ปฌ Obsidian vault์ ๋ฌธ์๋ค์ AI ์์ด์ ํธ๋ ์ธ๋ถ ์ ํ๋ฆฌ์ผ์ด์
์์ ์ฝ๊ฒ ํ์ํ๊ณ ๊ด๋ฆฌํ ์ ์๋๋ก ๊ฐ๋ ฅํ ๋๊ตฌ API๋ฅผ ์ ๊ณตํฉ๋๋ค.
Obsidian Vault๋ฅผ ์ด์ฉํด AI๊ฐ ํ์ฉ ๊ฐ๋ฅํ ์ง์ ๋ฒ ์ด์ค(Knowledge Base)๋ก ํ์ฅํ์ฌ ์ฌ์ฉํ ์ ์๊ฒ๋ ํ๊ณ ๋ฌธ์ ๊ฒ์, ์์ฝ, ์ ๋ฆฌ์ ๊ฐ์ ๋ถ๊ฐ์ ์ธ ์์ ์ ์๋ํํ์ฌ ์ฌ์ฉ์๊ฐ ํต์ฌ์ ์ธ "๊ธ์ฐ๊ธฐ ํ๋"์๋ง ์ง์คํ ์ ์๋ ํ๊ฒฝ์ ๊ตฌ์ถํ๊ณ ์ ์ ์ํ์ต๋๋ค.
ํต์ฌ ์ํคํ ์ฒ
๋ณธ ์๋ฒ๋ VaultManager
์ Indexer
๋ฅผ ์ค์ฌ์ผ๋ก ๊ตฌ์ถ๋์ด ๋๊ท๋ชจ Vault์์๋ ๋์ ์ฑ๋ฅ๊ณผ ๋ฉ๋ชจ๋ฆฌ ํจ์จ์ฑ์ ๋ณด์ฅํฉ๋๋ค.
Indexer
๊ธฐ๋ฐ ๊ฒ์: ์๋ฒ ์์ ์ ๊ฐ๋ฒผ์ด ์ญ ์ธ๋ฑ์ค(Inverted Index)๋ฅผ ์์ฑํ์ฌ ํค์๋ ๊ฒ์ ์ ๊ฑฐ์ ์ฆ๊ฐ์ ์ธ ๊ฒฐ๊ณผ๋ฅผ ๋ฐํํฉ๋๋ค(O(1)). ์ ์ฒด ํ์ผ ๋ด์ฉ์ ๋ฉ๋ชจ๋ฆฌ์ ์์ฃผ์ํค์ง ์์ ๋ฉ๋ชจ๋ฆฌ ์ฌ์ฉ๋์ ์ต์ํํฉ๋๋ค.VaultManager
: Vault ๋ด์ ๋ชจ๋ ๋ฌธ์๋ฅผ ํจ์จ์ ์ผ๋ก ๊ด๋ฆฌํ๋ฉฐ, ํ์ผ ์์คํ ๊ณผ ์ํธ์์ฉํ์ฌ ๋ฌธ์์ ์์ฑ, ์์ , ์ญ์ ๋ฅผ ์ฒ๋ฆฌํฉ๋๋ค.
์ฃผ์ ๊ธฐ๋ฅ
- ๊ณ ๊ธ ๋ฌธ์ ํ์:
vault
๋๊ตฌ๋ฅผ ํตํด ํค์๋ ๊ฒ์, ์ ์ฒด ๋ชฉ๋ก ์กฐํ, ํน์ ๋ฌธ์ ์ฝ๊ธฐ, ํต๊ณ ๋ถ์ ๋ฑ ๋ค์ํ ํ์ ๊ธฐ๋ฅ์ ์ ๊ณตํฉ๋๋ค. - AI ๊ธฐ๋ฐ ์์ฑ ์์ฑ:
generate_property
๋๊ตฌ๋ ๋ฌธ์ ๋ณธ๋ฌธ์ ๋ถ์ํ์ฌtitle
,tags
,summary
๋ฑ ์ ์ ํ frontmatter ์์ฑ์ ์๋์ผ๋ก ์์ฑํฉ๋๋ค. - ์์ ํ ์์ฑ ์
๋ฐ์ดํธ:
write_property
๋๊ตฌ๋ฅผ ์ฌ์ฉํ์ฌ ์์ฑ๋ ์์ฑ์ ๊ธฐ์กด frontmatter์ ๋ณํฉํ์ฌ ํ์ผ์ ์์ ํ๊ฒ ๊ธฐ๋กํฉ๋๋ค. - ์ฒจ๋ถ ํ์ผ ์๋ ์ ๋ฆฌ:
organize_attachments
๋๊ตฌ๋ ๋ฌธ์์ ์ฐ๊ฒฐ๋ ์ฒจ๋ถ ํ์ผ(์: ์ด๋ฏธ์ง)์ ์๋์ผ๋ก ๊ฐ์งํ์ฌ ๋ฌธ์ ์ ๋ชฉ์ ๋ง๋ ํด๋๋ก ์ด๋์ํค๊ณ ๋งํฌ๋ฅผ ์ ๋ฐ์ดํธํฉ๋๋ค. - ํตํฉ ์ํฌํ๋ก์ฐ:
create_document_with_properties
์ ๊ฐ์ ๋๊ตฌ๋ฅผ ํตํด ๋ฌธ์ ๋ถ์๋ถํฐ ์์ฑ ์์ฑ, ํ์ผ ์ ๋ฐ์ดํธ๊น์ง์ ์ ์ฒด ๊ณผ์ ์ ๋จ์ผ ๋ช ๋ น์ผ๋ก ์คํํฉ๋๋ค. - ์ ๋ขฐ์ฑ ๋ฐ ํ
์คํธ:
vitest
๋ฅผ ์ฌ์ฉํ End-to-End ํ ์คํธ์ GitHub Actions ๊ธฐ๋ฐ์ CI/CD ํ์ดํ๋ผ์ธ์ ํตํด ์๋ฒ์ ์์ ์ฑ๊ณผ ๊ฐ ๋๊ตฌ API์ ์๋ต ์คํค๋ง๋ฅผ ๊ฒ์ฆํฉ๋๋ค.
๋๊ตฌ API
obsidian-mcp-server
๋ MCP ํด๋ผ์ด์ธํธ๋ฅผ ํตํด ํธ์ถํ ์ ์๋ ๋ค์๊ณผ ๊ฐ์ ๋๊ตฌ๋ค์ ์ ๊ณตํฉ๋๋ค.
vault
Vault ๋ด ๋ฌธ์๋ฅผ ํ์ํ๊ณ ๋ถ์ํ๋ ํต์ฌ ๋๊ตฌ์
๋๋ค. action
ํ๋ผ๋ฏธํฐ๋ฅผ ํตํด ๋ค์ํ ๊ธฐ๋ฅ์ ์ํํ ์ ์์ต๋๋ค.
list_all
: Vault ๋ด ๋ชจ๋ ๋ฌธ์์ ๋ชฉ๋ก๊ณผ ๋ฉํ๋ฐ์ดํฐ๋ฅผ ๋ฐํํฉ๋๋ค.search
: ํค์๋๋ฅผ ๊ธฐ๋ฐ์ผ๋ก ๋ฌธ์ ์ ๋ชฉ, ๋ด์ฉ, ํ๊ทธ๋ฅผ ๊ฒ์ํฉ๋๋ค.read
: ํน์ ํ์ผ์ ๋ด์ฉ์ ์ฝ๊ณ frontmatter์ ๋ณธ๋ฌธ์ ๋ฐํํฉ๋๋ค.stats
: Vault ๋ด ๋ชจ๋ ๋ฌธ์์ ํต๊ณ(๋จ์ด, ๊ธ์ ์ ๋ฑ)๋ฅผ ์ ๊ณตํฉ๋๋ค.
generate_property
๋ฌธ์ ๊ฒฝ๋ก(filePath
)๋ฅผ ์
๋ ฅ๋ฐ์ ํด๋น ๋ฌธ์์ ๋ด์ฉ์ ๋ถ์ํ๊ณ , AI๊ฐ ์ถ์ฒํ๋ frontmatter ์์ฑ์ ์์ฑํ์ฌ ๋ฐํํฉ๋๋ค.
write_property
ํ์ผ ๊ฒฝ๋ก(filePath
)์ JSON ํ์์ ์์ฑ(properties
)์ ์
๋ ฅ๋ฐ์, ํด๋น ํ์ผ์ frontmatter๋ฅผ ์
๋ฐ์ดํธํฉ๋๋ค.
create_document_with_properties
๋ฌธ์ ๋ถ์, ์์ฑ ์์ฑ, ํ์ผ ์ ๋ฐ์ดํธ์ ์ ๊ณผ์ ์ ํ ๋ฒ์ ์ฒ๋ฆฌํ๋ ํตํฉ ๋๊ตฌ์ ๋๋ค.
organize_attachments
ํค์๋๋ก ๋ฌธ์๋ฅผ ์ฐพ์ ํด๋น ๋ฌธ์์ ์ฐ๊ฒฐ๋ ๋ชจ๋ ์ฒจ๋ถ ํ์ผ์ images/{๋ฌธ์ ์ ๋ชฉ}
ํด๋๋ก ์ด๋์ํค๊ณ , ๋ฌธ์ ๋ด์ ๋งํฌ๋ฅผ ์๋์ผ๋ก ์
๋ฐ์ดํธํฉ๋๋ค.
์์ํ๊ธฐ
-
์ ์ฅ์ ๋ณต์ ๋ฐ ์์กด์ฑ ์ค์น:
git clone https://github.com/sunub/obsidian-mcp-server.git cd obsidian-mcp-server npm install
-
ํ๊ฒฝ ๋ณ์ ์ค์ : ํ๋ก์ ํธ ๋ฃจํธ์
.env
ํ์ผ์ ์์ฑํ๊ณ Obsidian vault์ ์ ๋ ๊ฒฝ๋ก๋ฅผ ์ง์ ํฉ๋๋ค.VAULT_DIR_PATH=/path/to/your/obsidian/vault
-
ํ๋ก์ ํธ ๋น๋:
npm run build
-
์๋ฒ ์คํ:
node build/index.js
์ด์ MCP ํด๋ผ์ด์ธํธ์์ ์๋ฒ์ ์ฐ๊ฒฐํ์ฌ ๋๊ตฌ๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
๊ฐ๋ฐ
ํ ์คํธ ์คํ
vitest
๋ฅผ ์ฌ์ฉํ์ฌ End-to-End ํ
์คํธ๋ฅผ ์คํํ ์ ์์ต๋๋ค.
npm test
CI/CD
์ด ํ๋ก์ ํธ๋ GitHub Actions๋ฅผ ์ฌ์ฉํ์ฌ CI/CD ํ์ดํ๋ผ์ธ์ ๊ตฌ์ถํ์ต๋๋ค. main
๋ธ๋์น์ push ๋๋ pull request๊ฐ ๋ฐ์ํ๋ฉด ์๋์ผ๋ก ๋น๋์ ํ
์คํธ๊ฐ ์ํ๋ฉ๋๋ค.