Add bin/mcp-server wrapper script for robust path resolution

Avoids module shadowing when CWD contains another bex package.
This commit is contained in:
tobjend 2026-07-01 08:06:17 +02:00
parent adc52c99ec
commit a1567bffbe

15
bin/mcp-server Executable file
View file

@ -0,0 +1,15 @@
#!/usr/bin/env python3
"""Wrapper for grammar-inference MCP server.
Ensures the correct bex module is loaded regardless of CWD.
"""
import sys
import os
GIE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, GIE_DIR)
# Remove any conflicting paths
sys.path = [p for p in sys.path if p != '']
from bex.mcp_server import main
main()