Have you ever tried setting up a Model Context Protocol (MCP) server via Docker, only to get slammed by a permission error—and then, right when you think you’ve fixed it, your entire IDE crashes?
If you’ve been trying to connect a containerized MCP server (like the GitHub MCP server) to Google Antigravity, you might have found yourself trapped exactly where I was: stuck between a /var/run/docker.sock permission denial and a cryptic TypeError: Cannot read properties of null (reading '__store') UI crash.
After hours of tearing my hair out, I finally figured out what was going on. Here is exactly how I fixed the permissions and bypassed the broken UI, step by step.
- Add your user to the Docker group.When my MCP server first attempted to boot, it needed to talk to the Docker daemon. I was hit with a permission denied error for
/var/run/docker.sockbecause my user account lacked the necessary rights. I fixed this by adding my user to the Docker group:Bashsudo usermod -aG docker $USER - Refresh your group assignment.Normally, you would run
newgrp dockerorsg docker -c "bash"to refresh your terminal’s group assignments. However, because I was working in a minimalist environment, my terminal rejected both with “command not found.” If you hit this wall, use one of these workarounds:- The Virtual/Cloud Session Reset: Completely close your IDE terminal or SSH connection and open a fresh one.
- The Login Shell Simulation: Force a reload of your user’s group configurations by running
su - $USERand entering your password. - The Direct Bypass: If modifying groups won’t propagate, grant your user explicit ownership of the socket file by running
sudo chown $USER /var/run/docker.sock. (Note: This is a heavy-handed bypass, but it instantly grants your active user read and write access. Never usechmod 777as an alternative!)
- Bypass the Antigravity UI crash by opening the raw config file.Once I solved the Docker permissions, I expected smooth sailing. Instead, I opened the Antigravity Settings panel and was greeted by a
TypeError: Cannot read properties of null (reading '__store')crash. This is a known UI bug in the Antigravity workspace configuration panel, not a Docker issue. To bypass the graphical interface, I edited the underlying configuration file directly:Bashnano ~/.gemini/config/mcp_config.json - Inject the Server JSON.Inside this file, you need to structure your
mcpServersblock. If your file is empty, just paste the block below. Be sure to swap out my placeholder with your actual GitHub Personal Access Token.JSON{ "mcpServers": { "github": { "command": "docker", "args": [ "run", "-i", "--rm", "-v", "/var/run/docker.sock:/var/run/docker.sock", "ghcr.io/modelcontextprotocol/servers/github" ], "env": { "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_FINE_GRAINED_GITHUB_TOKEN" } } } } - Clear the frozen UI cache.To completely unstick the Antigravity client from that null render crash, I had to purge the corrupted local app layout state before booting it back up. Run this in your terminal:Bash
rm -rf ~/.config/Antigravity/Local\ Storage - Restart and verify.Now that the cache was cleared and my configuration was hardcoded into the JSON file, I restarted Google Antigravity entirely. To test if the bridge was fully active without ever touching that broken settings UI, I opened my Agentic Panel (Ctrl + Alt + B) and issued a direct prompt:
- “Please check your connection to the GitHub MCP server and list my available repositories.”
It worked perfectly. The AI bypassed the broken UI code, executed my direct JSON container settings, read the mounted Docker socket, and hooked straight into my GitHub account.