pkm-mcp-server 1.5.1 → 1.5.2

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.
@@ -35,13 +35,20 @@ if [ -z "$CAPTURE_TYPE" ] || [ -z "$CAPTURE_TITLE" ] || [ -z "$CAPTURE_CONTENT"
35
35
  exit 0
36
36
  fi
37
37
 
38
- # MCP config for obsidian-pkm server
38
+ # MCP config auto-detect repo (../index.js exists) vs installed (use npx)
39
39
  SCRIPT_DIR=$(cd "$(dirname "$0")" && pwd -P)
40
40
  MCP_CONFIG=$(node -e "
41
+ const { existsSync } = require('fs');
42
+ const path = require('path');
43
+ const localIndex = path.join(process.argv[1], '..', 'index.js');
44
+ const useLocal = existsSync(localIndex);
41
45
  const env = { VAULT_PATH: process.argv[2] };
42
46
  if (process.env.OPENAI_API_KEY) env.OPENAI_API_KEY = process.env.OPENAI_API_KEY;
43
- console.log(JSON.stringify({ mcpServers: { 'obsidian-pkm': { command: 'node', args: [process.argv[1]], env } } }));
44
- " "$SCRIPT_DIR/../index.js" "${VAULT_PATH:-$HOME/Documents/PKM}")
47
+ const server = useLocal
48
+ ? { command: 'node', args: [localIndex], env }
49
+ : { command: 'npx', args: ['-y', 'pkm-mcp-server@latest'], env };
50
+ console.log(JSON.stringify({ mcpServers: { 'obsidian-pkm': server } }));
51
+ " "$SCRIPT_DIR" "${VAULT_PATH:-$HOME/Documents/PKM}")
45
52
 
46
53
  # Build prompt via Node.js to avoid shell injection from user content
47
54
  PROMPT_FILE=$(mktemp)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pkm-mcp-server",
3
- "version": "1.5.1",
3
+ "version": "1.5.2",
4
4
  "description": "MCP server for Obsidian vault integration with Claude Code — 19 tools for notes, search, and graph traversal",
5
5
  "main": "cli.js",
6
6
  "exports": {