Files
Nexus/scripts/wsl_mcp_mysql.sh
T
Your Name 80d73d1b74 fix: WSL startup compatibility + dependency updates
- redis/client.py: use BlockingConnectionPool.from_url() (fixes 'url' kwarg error)
- database/engine_compat.py: patch aiomysql do_ping to satisfy pool_pre_ping
- database/session.py: apply engine_compat patch before create_async_engine
- requirements.txt: SQLAlchemy 2.0.49 (fixes aiomysql ping() reconnect signature)
- .env.example: document NEXUS_REDIS_URL format
- scripts/wsl_ensure_venv.sh: create project .venv (PEP 668 safe)
- scripts/wsl_start_dev.sh: use .venv python, validate Redis before start
- scripts/wsl_integration_smoke.sh: code-only verification mode
- scripts/wsl_check_mysql.py / bootstrap_database.py: MySQL setup helpers
- scripts/sync_frontend_vendor.py: vendor asset sync utility

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-23 15:27:18 +08:00

29 lines
855 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
#!/usr/bin/env bash
# Cursor MCP: mysql-mcp-server via WSL (Node 20+ required for import attributes).
set -euo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PROJECT="$(cd "${SCRIPT_DIR}/.." && pwd)"
cd "${PROJECT}"
NODE20="${HOME}/.local/node-v20.19.2/bin/node"
WIN_NODE="/mnt/c/nvm4w/nodejs/node.exe"
# 1) WSL Node 20 — 可连 172.31.x 内网 MySQL
if [ -x "${NODE20}" ]; then
export PATH="$(dirname "${NODE20}"):${PATH}"
exec npx -y @yclenove/mysql-mcp-server
fi
# 2) Windows Node 22interop
if [ -x "${WIN_NODE}" ]; then
WSL_USER="$(whoami)"
MCP_JS="/mnt/c/Users/${WSL_USER}/AppData/Roaming/npm/node_modules/@yclenove/mysql-mcp-server/dist/index.js"
if [ -f "${MCP_JS}" ]; then
exec "${WIN_NODE}" "${MCP_JS}"
fi
fi
echo "ERROR: Need Node 20+. Run in WSL: bash scripts/wsl_install_node20.sh" >&2
exit 1