The Obsidian CLI does not support binary file output, causing corrupted
or empty results for images, PDFs, ZIPs, etc.
New approach for binary files (known MIME type from extension):
- Run 'obsidian vault info=path' to get the vault root filesystem path
- If 'file' param: run 'obsidian file file=<name>' and parse the 'path'
field from its output to get the vault-relative path
- If 'path' param: use it directly as the vault-relative path
- Read the file with Node fs.readFile() and return as MCP content
Images -> { type: 'image', data, mimeType }
Other binary -> { type: 'resource', resource: { uri, mimeType, blob } }
Unknown extensions fall through to the CLI with a runtime binary
detection fallback that also uses native FS if triggered.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
42 lines
1.0 KiB
JSON
42 lines
1.0 KiB
JSON
{
|
|
"name": "obsidian-mcp",
|
|
"version": "1.1.9",
|
|
"description": "MCP Bundle for Obsidian CLI - Enable AI assistants to manage Obsidian vaults through Model Context Protocol",
|
|
"type": "module",
|
|
"main": "dist/index.js",
|
|
"scripts": {
|
|
"build": "tsc",
|
|
"server": "node dist/http-server.js",
|
|
"validate-manifest": "mcpb validate manifest.json",
|
|
"pack": "npm run build && mcpb pack",
|
|
"inspect": "npx @modelcontextprotocol/inspector node dist/index.js",
|
|
"test": "jest",
|
|
"dev": "tsc --watch",
|
|
"validate-tools": "node scripts/validate-tools.js"
|
|
},
|
|
"keywords": [
|
|
"mcp",
|
|
"obsidian",
|
|
"model-context-protocol",
|
|
"ai-assistant",
|
|
"note-taking"
|
|
],
|
|
"author": "",
|
|
"license": "MIT",
|
|
"engines": {
|
|
"node": ">=18.0.0"
|
|
},
|
|
"dependencies": {
|
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
"zod": "^3.22.4"
|
|
},
|
|
"devDependencies": {
|
|
"@anthropic-ai/mcpb": "^2.1.2",
|
|
"@types/jest": "^29.5.11",
|
|
"@types/node": "^20.10.6",
|
|
"jest": "^29.7.0",
|
|
"ts-jest": "^29.1.1",
|
|
"typescript": "^5.3.3"
|
|
}
|
|
}
|