@mauricio.wolff/mcp-obsidian 0.6.3 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.js +39 -2
- package/package.json +1 -1
package/dist/server.js
CHANGED
|
@@ -6,9 +6,46 @@ import { FileSystemService } from "./src/filesystem.js";
|
|
|
6
6
|
import { FrontmatterHandler } from "./src/frontmatter.js";
|
|
7
7
|
import { PathFilter } from "./src/pathfilter.js";
|
|
8
8
|
import { SearchService } from "./src/search.js";
|
|
9
|
-
|
|
9
|
+
import { readFileSync } from "fs";
|
|
10
|
+
import { fileURLToPath } from "url";
|
|
11
|
+
import { dirname, join } from "path";
|
|
12
|
+
// Get package.json version
|
|
13
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
14
|
+
const __dirname = dirname(__filename);
|
|
15
|
+
const packageJson = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf-8"));
|
|
16
|
+
const VERSION = packageJson.version;
|
|
17
|
+
// Handle --version and --help flags
|
|
18
|
+
const arg = process.argv[2];
|
|
19
|
+
if (arg === "--version" || arg === "-v") {
|
|
20
|
+
console.log(VERSION);
|
|
21
|
+
process.exit(0);
|
|
22
|
+
}
|
|
23
|
+
if (arg === "--help" || arg === "-h") {
|
|
24
|
+
console.log(`
|
|
25
|
+
@mauricio.wolff/mcp-obsidian v${VERSION}
|
|
26
|
+
|
|
27
|
+
Universal AI bridge for Obsidian vaults - connect any MCP-compatible assistant
|
|
28
|
+
|
|
29
|
+
Usage:
|
|
30
|
+
npx @mauricio.wolff/mcp-obsidian <vault-path>
|
|
31
|
+
|
|
32
|
+
Arguments:
|
|
33
|
+
<vault-path> Path to your Obsidian vault directory
|
|
34
|
+
|
|
35
|
+
Options:
|
|
36
|
+
--version, -v Show version number
|
|
37
|
+
--help, -h Show this help message
|
|
38
|
+
|
|
39
|
+
Examples:
|
|
40
|
+
npx @mauricio.wolff/mcp-obsidian ~/Documents/MyVault
|
|
41
|
+
npx @mauricio.wolff/mcp-obsidian /path/to/obsidian/vault
|
|
42
|
+
`);
|
|
43
|
+
process.exit(0);
|
|
44
|
+
}
|
|
45
|
+
const vaultPath = arg;
|
|
10
46
|
if (!vaultPath) {
|
|
11
47
|
console.error("Usage: npx @mauricio.wolff/mcp-obsidian /path/to/vault");
|
|
48
|
+
console.error("Run 'npx @mauricio.wolff/mcp-obsidian --help' for more information");
|
|
12
49
|
process.exit(1);
|
|
13
50
|
}
|
|
14
51
|
// Initialize services
|
|
@@ -18,7 +55,7 @@ const fileSystem = new FileSystemService(vaultPath, pathFilter, frontmatterHandl
|
|
|
18
55
|
const searchService = new SearchService(vaultPath, pathFilter);
|
|
19
56
|
const server = new Server({
|
|
20
57
|
name: "mcp-obsidian",
|
|
21
|
-
version:
|
|
58
|
+
version: VERSION
|
|
22
59
|
}, {
|
|
23
60
|
capabilities: {
|
|
24
61
|
tools: {},
|