◉ANTIGRAVITY LABJP
Articles/Integrations
⬡ Integrations/2026-03-30Intermediate

Antigravity MCP Won't Connect? Work Through Config, Startup, Auth, Network in That Order

A four-stage way to isolate Antigravity MCP connection errors: config file, server startup, authentication, and network. Includes a small script that calls a server directly, and the GUI-app environment trap that cost me a morning.

MCP30troubleshooting133connection errorsintegration7

The morning after I added GitHub MCP, that one server was missing from the tool list. I had regenerated the token the night before and pasted it into the config. The log held a single line that could have meant either an auth failure or a failed startup.

The cause wasn't the token. Antigravity simply couldn't see the environment variable from my shell. echo printed the value in the terminal, I took that as proof, and I lost a night to it.

What I'd like to say first: an MCP connection error is stuck at one of four stages, config can't be read, the server won't start, auth fails, or traffic doesn't get through. Check them in that order and you'll usually find the cause before reaching the fourth.

What has to happen before a tool appears

  • The config file is read and the server declarations are extracted
  • The declared command is launched (or the URL is contacted)
  • A JSON-RPC initialize is exchanged
  • The server's tool list is returned to the agent

Where it stops decides where you look.

SymptomStageLook first at
No servers listed at allConfig loadingJSON validity of the config file
One server stays greyStartupcommand, PATH, Node.js version
Starts, but tools are empty or auth errors appearAuthToken scope and expiry, environment variables
Works at first, then times out or returns 403NetworkRate limits, corporate network restrictions

Stage 1: Is the config being read?

Antigravity's MCP settings live in mcp_config.json under a mcpServers key. A project-level file and a global one can both exist, and they are merged. Once, a server I thought had vanished was just shadowed by an older declaration I'd forgotten.

{
  "mcpServers": {
    "github": {
      "command": "npx",
      "args": ["-y", "@modelcontextprotocol/server-github"],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-token-here"
      }
    }
  }
}

If the file is broken as JSON, no server starts. A trailing comma, single quotes, and args written as a string instead of an array are all mistakes I've actually made. Letting a script read the file before launch beats eyeballing it, and I wrote that up separately.

Finding why no MCP server starts, before launch

Stage 2: Does the server start on its own?

If the config is valid but the server stays grey, run it outside Antigravity. Paste the same command and args into a terminal.

node --version
npx -y @modelcontextprotocol/server-github

Two things to confirm: that Node.js isn't too old for the server (each README states its requirement; when unsure, match the current LTS), and that the executable named in command can be found.

If it works in the terminal but Antigravity reports spawn npx ENOENT, the GUI app doesn't know where npx lives. That is a PATH issue, covered here:

Fixing spawn npx ENOENT when an MCP server won't start

One note before you chase port conflicts. Servers launched via command talk over stdin/stdout and open no port, so lsof -i showing nothing is normal. Ports matter only for servers reached by URL.

Stage 3: Is authentication going through?

If the server starts but tools are empty or auth errors come back, suspect the token, in a fixed order:

  • Does the token's scope include the operation you want?
  • Has it expired? Fine-grained tokens usually have an expiry you chose at creation, which is easy to forget.
  • Is the env value still an empty string?
  • Is the value visible to the Antigravity process itself?

The last one was my morning. A value printed by echo in your terminal is only true inside that shell. Apps opened from the Dock or a launcher often never read .zshrc. The reliable fixes are to put the value in the env block of mcp_config.json, or to point command at a small wrapper script that exports it.

If you write tokens into config, keep that file out of Git. I keep tokens out of project-level files entirely and use only the global one.

Figma permission errors

When Figma MCP reports a permission error, the token may have been created without enough read scope. Add the scope, regenerate, replace the value, then quit Antigravity fully and reopen it.

Stage 4: Is traffic getting through?

If auth works but failures start later, suspect limits on the wire.

GitHub's REST API documents 60 requests per hour unauthenticated and 5,000 authenticated. An agent told to sweep many repositories can burn through that faster than you'd expect. Check what's left:

curl -s -H "Authorization: Bearer $GITHUB_PERSONAL_ACCESS_TOKEN" \
  https://api.github.com/rate_limit

Behind a corporate proxy, outbound calls to some hosts may be blocked. Try curl to the same host from the same network first; that separates "Antigravity problem" from "network problem".

Calling the server directly

If nothing above explains it, call the server from outside Antigravity. For a stdio server, spawn it as a child process, send one initialize, and read the reply.

// mcp-ping.mjs — node mcp-ping.mjs <command> [args...]
import { spawn } from "node:child_process";
 
const [cmd, ...args] = process.argv.slice(2);
const child = spawn(cmd, args, { stdio: ["pipe", "pipe", "inherit"] });
 
const timer = setTimeout(() => {
  console.error("No response within 10 seconds");
  child.kill();
  process.exit(1);
}, 10000);
 
child.stdout.once("data", (buf) => {
  clearTimeout(timer);
  console.log("Reply:", buf.toString().slice(0, 300));
  child.kill();
});
 
child.on("error", (e) => {
  clearTimeout(timer);
  console.error("Failed to start:", e.code, e.message);
  process.exit(1);
});
 
child.stdin.write(
  JSON.stringify({
    jsonrpc: "2.0",
    id: 1,
    method: "initialize",
    params: {
      protocolVersion: "2024-11-05",
      capabilities: {},
      clientInfo: { name: "mcp-ping", version: "0.1" },
    },
  }) + "\n"
);

Reading it is simple. "Failed to start" means stage 2, an auth error in the reply means stage 3, and silence until timeout means the server stalled during initialization. If this script gets a reply while Antigravity still fails, suspect config loading or the GUI app's environment.

I wrote these forty-odd lines only after assuming "the server must be buggy" and reading logs for far too long. Had I started here, that morning would have taken ten minutes.

Before blaming the server, call its initialize yourself. I now do this once whenever I add a new server.

What to do next

Pick one server that isn't working, hand its command and args straight to mcp-ping.mjs, and see what comes back. The result tells you which of the four stages is stuck.

Related reading:

Share

Thank You for Reading

Antigravity Lab is ad-free, supported entirely by members like you. We publish practical guides daily with implementation code, benchmarks, and production-ready patterns. If you've found it useful, we'd love to have you on board.

  • ✦Copy-paste ready implementation code
  • ✦New advanced guides published daily
  • ✦$5/mo or $10 for lifetime access
View Membership →

If you found this article helpful, a small tip ($1.50) would mean a lot to us. Your support helps keep this site ad-free and covers server and hosting costs.

Related Articles

⬡ Integrations2026-10-22
The Project-Local mcp_config.json Is Read, but No MCP Server Starts — Checking With a One-File Probe
Antigravity CLI logs that it is using a project-local config, yet the MCP servers in it never start. Where the official issue stands (still open as of November 2026), what that log line does and does not promise, a tiny probe server to check your own setup, a table for telling similar symptoms apart, and realistic ways to keep MCP servers per project.
⬡ Integrations2026-08-20
Find the one broken MCP entry before Antigravity starts, with a Node script under 60 lines
A single typo in your MCP settings can take every server down with it. Here is a small preflight script that catches the mistakes statically, the real output from a deliberately broken config, and the duplicate-key trap that JSON hides from you.
⬡ Integrations2026-10-19
Connecting GitHub MCP to Antigravity CLI: The Fix Was One Word, url to serverUrl
To use GitHub MCP from Antigravity CLI, the url key in your config has to become serverUrl. Based on the official MCP docs, here are the remote and Docker setups, a small script that checks the file before you load it, where to keep the token, and the order to debug in.