|
| 1 | +# Installing GitHub MCP Server in Antigravity |
| 2 | + |
| 3 | +This guide covers setting up the GitHub MCP Server in Google's Antigravity IDE. |
| 4 | + |
| 5 | +## Prerequisites |
| 6 | + |
| 7 | +- Antigravity IDE installed (latest version) |
| 8 | +- GitHub Personal Access Token with appropriate scopes |
| 9 | + |
| 10 | +## Installation Methods |
| 11 | + |
| 12 | +### Option 1: Remote Server (Recommended) |
| 13 | + |
| 14 | +Uses GitHub's hosted server at `https://api.githubcopilot.com/mcp/`. |
| 15 | + |
| 16 | +> [!NOTE] |
| 17 | +> We recommend this manual configuration method because the "official" installation via the Antigravity MCP Store currently has known issues (often resulting in Docker errors). This direct remote connection is more reliable. |
| 18 | +
|
| 19 | +#### Step 1: Access MCP Configuration |
| 20 | + |
| 21 | +1. Open Antigravity |
| 22 | +2. Click the "..." (Additional Options) menu in the Agent panel |
| 23 | +3. Select "MCP Servers" |
| 24 | +4. Click "Manage MCP Servers" |
| 25 | +5. Click "View raw config" |
| 26 | + |
| 27 | +This will open your `mcp_config.json` file at: |
| 28 | +- **Windows**: `C:\Users\<USERNAME>\.gemini\antigravity\mcp_config.json` |
| 29 | +- **macOS/Linux**: `~/.gemini/antigravity/mcp_config.json` |
| 30 | + |
| 31 | +#### Step 2: Add Configuration |
| 32 | + |
| 33 | +Add the following to your `mcp_config.json`: |
| 34 | + |
| 35 | +```json |
| 36 | +{ |
| 37 | + "mcpServers": { |
| 38 | + "github": { |
| 39 | + "serverUrl": "https://api.githubcopilot.com/mcp/", |
| 40 | + "headers": { |
| 41 | + "Authorization": "Bearer YOUR_GITHUB_PAT" |
| 42 | + } |
| 43 | + } |
| 44 | + } |
| 45 | +} |
| 46 | +``` |
| 47 | + |
| 48 | +**Important**: Note that Antigravity uses `serverUrl` instead of `url` for HTTP-based MCP servers. |
| 49 | + |
| 50 | +#### Step 3: Configure Your Token |
| 51 | + |
| 52 | +Replace `YOUR_GITHUB_PAT` with your actual GitHub Personal Access Token. |
| 53 | + |
| 54 | +Create a token here: https://github.com/settings/tokens |
| 55 | + |
| 56 | +Recommended scopes: |
| 57 | +- `repo` - Full control of private repositories |
| 58 | +- `read:org` - Read org and team membership |
| 59 | +- `read:user` - Read user profile data |
| 60 | + |
| 61 | +#### Step 4: Restart Antigravity |
| 62 | + |
| 63 | +Close and reopen Antigravity for the changes to take effect. |
| 64 | + |
| 65 | +#### Step 5: Verify Installation |
| 66 | + |
| 67 | +1. Open the MCP Servers panel (... menu → MCP Servers) |
| 68 | +2. You should see "github" with a list of available tools |
| 69 | +3. You can now use GitHub tools in your conversations |
| 70 | + |
| 71 | +> [!NOTE] |
| 72 | +> The status indicator in the MCP Servers panel might not immediately turn green in some versions, but the tools will still function if configured correctly. |
| 73 | +
|
| 74 | +### Option 2: Local Docker Server |
| 75 | + |
| 76 | +If you prefer running the server locally with Docker: |
| 77 | + |
| 78 | +```json |
| 79 | +{ |
| 80 | + "mcpServers": { |
| 81 | + "github": { |
| 82 | + "command": "docker", |
| 83 | + "args": [ |
| 84 | + "run", |
| 85 | + "-i", |
| 86 | + "--rm", |
| 87 | + "-e", |
| 88 | + "GITHUB_PERSONAL_ACCESS_TOKEN", |
| 89 | + "ghcr.io/github/github-mcp-server" |
| 90 | + ], |
| 91 | + "env": { |
| 92 | + "GITHUB_PERSONAL_ACCESS_TOKEN": "YOUR_GITHUB_PAT" |
| 93 | + } |
| 94 | + } |
| 95 | + } |
| 96 | +} |
| 97 | +``` |
| 98 | + |
| 99 | +**Requirements**: |
| 100 | +- Docker Desktop installed and running |
| 101 | +- Docker must be in your system PATH |
| 102 | + |
| 103 | +## Troubleshooting |
| 104 | + |
| 105 | +### "Error: serverUrl or command must be specified" |
| 106 | + |
| 107 | +Make sure you're using `serverUrl` (not `url`) for the remote server configuration. Antigravity requires `serverUrl` for HTTP-based MCP servers. |
| 108 | + |
| 109 | +### Server not appearing in MCP list |
| 110 | + |
| 111 | +- Verify JSON syntax in your config file |
| 112 | +- Check that your PAT hasn't expired |
| 113 | +- Restart Antigravity completely |
| 114 | + |
| 115 | +### Tools not working |
| 116 | + |
| 117 | +- Ensure your PAT has the correct scopes |
| 118 | +- Check the MCP Servers panel for error messages |
| 119 | +- Verify internet connection for remote server |
| 120 | + |
| 121 | +## Available Tools |
| 122 | + |
| 123 | +Once installed, you'll have access to tools like: |
| 124 | +- `create_repository` - Create new GitHub repositories |
| 125 | +- `push_files` - Push files to repositories |
| 126 | +- `search_repositories` - Search for repositories |
| 127 | +- `create_or_update_file` - Manage file content |
| 128 | +- `get_file_contents` - Read file content |
| 129 | +- And many more... |
| 130 | + |
| 131 | +For a complete list of available tools and features, see the [main README](../../README.md). |
| 132 | + |
| 133 | +## Differences from Other IDEs |
| 134 | + |
| 135 | +- **Configuration key**: Antigravity uses `serverUrl` instead of `url` for HTTP servers |
| 136 | +- **Config location**: `.gemini/antigravity/mcp_config.json` instead of `.cursor/mcp.json` |
| 137 | +- **Tool limits**: Antigravity recommends keeping total enabled tools under 50 for optimal performance |
| 138 | + |
| 139 | +## Next Steps |
| 140 | + |
| 141 | +- Explore the [Server Configuration Guide](../server-configuration.md) for advanced options |
| 142 | +- Check out [toolsets documentation](../../README.md#available-toolsets) to customize available tools |
| 143 | +- See the [Remote Server Documentation](../remote-server.md) for more details |
0 commit comments