mirror of
https://fastgit.cc/github.com/Yeachan-Heo/oh-my-claudecode
synced 2026-04-20 21:00:50 +08:00
Add shell wrapper (bridge/run-mcp-server.sh) that sets NODE_PATH to global npm root before launching the MCP server. This allows @ast-grep/napi installed globally to be found when the server runs from the plugin cache directory. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
14 lines
445 B
Bash
Executable File
14 lines
445 B
Bash
Executable File
#!/bin/bash
|
|
# MCP Server wrapper that ensures global npm modules are resolvable
|
|
# This enables @ast-grep/napi and other globally-installed native modules
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
# Add global npm modules to NODE_PATH for native module resolution
|
|
GLOBAL_NPM_ROOT="$(npm root -g 2>/dev/null)"
|
|
if [ -n "$GLOBAL_NPM_ROOT" ]; then
|
|
export NODE_PATH="${GLOBAL_NPM_ROOT}:${NODE_PATH:-}"
|
|
fi
|
|
|
|
exec node "$SCRIPT_DIR/mcp-server.cjs"
|