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
commandis launched (or the URL is contacted) - A JSON-RPC
initializeis exchanged - The server's tool list is returned to the agent
Where it stops decides where you look.
| Symptom | Stage | Look first at |
|---|---|---|
| No servers listed at all | Config loading | JSON validity of the config file |
| One server stays grey | Startup | command, PATH, Node.js version |
| Starts, but tools are empty or auth errors appear | Auth | Token scope and expiry, environment variables |
| Works at first, then times out or returns 403 | Network | Rate 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-githubTwo 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
envvalue 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_limitBehind 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: