Proxying Node.js MCP Servers via Python
Some IDEs (like Google Antigravity) can be finicky about starting Node.js MCP servers or resolving shell environments. If you have a working Python environment, wrapping your Node tools in a simple Python script is a robust way to ensure they start reliably.
The Solution
This script sets the correct working directory and calls the absolute path of your backlog binary, transparently piping stdin and stdout.
#!/usr/bin/env python3
import sys
import subprocess
import os
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--project-root", default=None)
args, unknown = parser.parse_known_args()
# 1. Set the working directory
if args.project_root:
project_root = os.path.abspath(args.project_root)
else:
script_dir = os.path.dirname(os.path.abspath(__file__))
project_root = os.path.abspath(os.path.join(script_dir, "../.."))
os.chdir(project_root)
# 2. Use the absolute path to the node-based binary
BACKLOG_BIN = "/opt/homebrew/bin/backlog"
try:
process = subprocess.Popen(
[BACKLOG_BIN, 'mcp', 'start'],
stdin=sys.stdin,
stdout=sys.stdout,
stderr=sys.stderr
)
process.wait()
except KeyboardInterrupt:
sys.exit(0)
except Exception as e:
print(f"Proxy Error: {e}", file=sys.stderr)
sys.exit(1)
if __name__ == "__main__":
main()
IDE Configuration
In Google Antigravity, add the proxy script to your mcpServers configuration. Using the Python path ensures the correct virtual environment is utilized.
{
"mcpServers": {
"backlog": {
"command": "/path/to/your/venv/bin/python3",
"args": [
"/path/to/your/project/backlog_mcp_proxy.py",
"--project-root",
"/path/to/your/target/project"
]
}
}
}
Important
Ensure the script is executable (
chmod +x) and that the project_root logic in the script correctly points to the directory containing your backlog/ folder.