Fix for Calva Backseat Driver Extension in Antigravity

Given my (my LLM's?) struggles with editing Clojurescript , I installed Calva Backseat Driver extension with great hopes that it would help mitigate the issue.

Given my relative newness to the cljs ecosystem, I struggled with the steps to get it to work.

Phase 1: Prepare your Clojure Environment

Start your REPL: Run Calva: Jack-in or connect to an existing REPL. (Wait until the status bar turns green).

It will walk you through the steps. This part is project specific so my screenshots are not going to be much help.

Start the Bridge (MCP Socket Server):

Ctrl+Shift+P -> Bring up the command palette and choose this option -

Capture the Path: A notification will appear saying "MCP Server Started." Click the Copy Command + port-file button.

Keep this on your clipboard; it contains the exact absolute paths to the script and your project's port file.

Phase 2 - Define the MCP server -

In the Agent Panel, on the top right, click on the 3 dots to reveal the MCP servers

Then, Manage MCP servers -

Then, View raw config

This will open the mcp.json where you need to define it like this -

{
"mcpServers": {
"backseat-driver": {
"command": "node",
"args": [
"<absolute path to calva-mcp-server.js in user-home-config directory>",
"<absolute path to port file (which points to your project's .calva/mcp-server/port)"
]
}
}
}

Now when you try to use this default setting, you will be treated to a glorious error -

This is because the content within calva-mcp-server.js is too large to be meaningfully processed by this process leading to this timeout.

To get around this issue, create a simple bridge script called raw-bridge.js-

const net = require('net');

// Connect to the Calva socket server
const client = net.connect(1664, '127.0.0.1', () => {
process.stderr.write('[RawBridge] Connected to Calva on 1664\n');
});

// Pipe Antigravity's requests directly to Calva
process.stdin.pipe(client);

// Pipe Calva's responses (including huge ones) directly to Antigravity
client.pipe(process.stdout);

client.on('error', (err) => {
process.stderr.write(`[RawBridge] Error: ${err.message}\n`);
process.exit(1);
});

client.on('end', () => process.exit(0));

In the mcp.json file that we created earlier, replace the reference to the js file with the reference to this raw-bridge.js file (absolute path).

Now, when you click on the refresh button, you should be able to see all the tools -