File tree 1 file changed +10
-6
lines changed
1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 4
4
ROOT_DIR=" $( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) /.." & > /dev/null && pwd) "
5
5
BIN_DIR=" $ROOT_DIR /bin"
6
6
MCP_DIR=" $ROOT_DIR /cache/__mcp__"
7
+ MCP_LOG_FILE=" $MCP_DIR /mcp-bridge.log"
7
8
MCP_JSON_PATH=" $ROOT_DIR /mcp.json"
8
9
FUNCTIONS_JSON_PATH=" $ROOT_DIR /functions.json"
9
10
MCP_BRIDGE_PORT=" ${MCP_BRIDGE_PORT:- 8808} "
@@ -23,7 +24,9 @@ start() {
23
24
llm_functions_dir=" $( cygpath -w " $llm_functions_dir " ) "
24
25
fi
25
26
echo " Start MCP Bridge server..."
26
- nohup node " $index_js " " $llm_functions_dir " > " $MCP_DIR /mcp-bridge.log" 2>&1 &
27
+ echo " Install node dependencies..." > " $MCP_LOG_FILE "
28
+ npm install --prefix " $ROOT_DIR /mcp/bridge" 1> /dev/null 2>> " $MCP_LOG_FILE "
29
+ nohup node " $index_js " " $llm_functions_dir " >> " $MCP_LOG_FILE " 2>&1 &
27
30
wait-for-server
28
31
echo " Merge MCP tools into functions.json"
29
32
" $0 " merge-functions -S
@@ -62,12 +65,13 @@ run@tool() {
62
65
# @cmd Show the logs
63
66
# @flag -f --follow Follow mode
64
67
logs () {
65
- args=" "
66
- if [[ -n " $argc_follow " ]]; then
67
- args=" $args -f"
68
+ if [[ ! -f " $MCP_LOG_FILE " ]]; then
69
+ _die " error: not found log file at '$MCP_LOG_FILE '"
68
70
fi
69
- if [[ -f " $MCP_DIR /mcp-bridge.log" ]]; then
70
- tail $args " $MCP_DIR /mcp-bridge.log"
71
+ if [[ -n " $argc_follow " ]]; then
72
+ tail -f " $MCP_LOG_FILE "
73
+ else
74
+ cat " $MCP_LOG_FILE "
71
75
fi
72
76
}
73
77
You can’t perform that action at this time.
0 commit comments