Files
oh-my-claudecode/bridge/run-mcp-server.sh
Yeachan-Heo db9c4578dc fix(mcp): resolve global npm modules for AST tools in plugin context
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>
2026-01-28 09:36:42 +00:00

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"