Google Antigravity + MCP Servers: How to Connect GitHub and Push Code with Just a Prompt (Part…

Google Antigravity + MCP Servers: How to Connect GitHub and Push Code with Just a Prompt (Part 2)step by step

By Geeta Kakrani | Google Developer Experts

Missed Part 1? Read the beginner guide first 👉 Google Antigravity: Beginner Guide to the New Agentic IDE

In Part 1, we learned what Google Antigravity is, how to install it, and how an AI agent can build a full Next.js dashboard for you — step by step, all by itself.But here is a question that came to my mind right after that demo.

After the agent builds your code… what next?You still have to open GitHub manually. Create a repo. Copy the project path. Run git commands. Push the code yourself.

That completely breaks the flow.

What if the agent could push the code to GitHub too — just because you asked it to?

That is exactly what MCP Servers make possible.

What is MCP? (Simple Explanation)

MCP stands for Model Context Protocol.

Think of it like a plugin system for your AI agent.

By default, the agent inside Antigravity can write code and run terminal commands. That’s it. But with MCP, you can give the agent new abilities — like the power to talk to GitHub, read your Google Drive, interact with Firebase, query BigQuery, and much more.

MCP = a bridge between your AI agent and the outside world.

Each bridge is called an MCP Server. You connect it once, and your agent can use it forever inside any project.

What We Will Do in This Part

  • Find the MCP option inside Antigravity
  • Explore the built-in MCP Store
  • Add the GitHub MCP Server
  • Create a GitHub Personal Access Token
  • Push code to GitHub directly using a simple prompt

Step 1 — Open the Agent Panel and Find the MCP Option

Open Google Antigravity on your computer.

On the right side, you will see the Agent panel — this is where you type prompts and the agent responds.

Look at the top-right corner of the Agent panel. You will see a … button (three dots).

Click on those three dots.

A small dropdown menu will appear with two options:

  • Customization
  • MCP Servers

👉 Click on “MCP Servers”

Step 2 — The MCP Store Opens

After clicking “MCP Servers”, the right panel will change to show the MCP Store.

This is where all available MCP servers live. You can see a search bar at the top and a list of ready-to-use servers below it.

Some of the servers you will see right away:

MCP Server What It Does:

  • Cloud Run: Deploy your app to Google Cloud Run directly.
  • Google Kubernetes Engine: Interact with GKE clusters.
  • Firebase: Use Firebase tools from inside the agent.
  • BigQuery: Query your BigQuery data with natural language.
  • Dart / Flutter: Flutter and Dart development tool actions.
  • many more…

But right now, we want GitHub. So type GitHub in the search bar.

Step 3 — Create a GitHub Personal Access Token

Before we add the GitHub MCP, we need to give it permission to access our GitHub account. We do this using a Personal Access Token (PAT).

This is basically a password that you generate inside GitHub — it tells GitHub “yes, this tool is allowed to act on my behalf.”

Follow these steps carefully:

1. Go to github.com and log in to your account.

2. Click your profile picture in the top-right corner → Click Settings

3. Scroll all the way down in the left sidebar → Click Developer Settings

4. Click Personal Access Tokens → Click Tokens (classic)

5. Click Generate new token → Select Generate new token (classic)

6. Give your token a name — something like antigravity-mcp so you remember what it is for.

7. Set the expiration to 90 days (or “No expiration” if this is just for learning/testing).

8. Now select the permissions (scopes) your token needs:

  • repo — Full control of your repositories (read, write, create)
  • workflow — Needed if you want to trigger GitHub Actions later
  • read:user — So the agent can read your GitHub profile info

9. Scroll down and click the green “Generate token” button.

10. Copy the token immediately. It looks like this: ghp_xxxxxxxxxxxxxxxxxxxxxx

GitHub will never show this token again after you leave the page. If you lose it, you have to generate a new one.

Step 4 — Add GitHub MCP Server in Antigravity

Now go back to Antigravity. You should still be on the MCP Store screen.Search for “GitHub” in the search bar.You will see the GitHub MCP server appear in the results. Click on it.

A dialog box or configuration panel will open asking for your GitHub Personal Access Token.

Paste the token you copied in Step 3.

Click Connect (or Add Server — the button label may vary slightly).

You will now see a green indicator next to GitHub MCP — that means it is successfully connected!

Step 5 — Test the Connection

Before we do anything big, let’s make sure the GitHub MCP is actually working.

Go back to the Agent panel (click “Back to Agent” at the top of the MCP panel).

In the chat box, type this simple prompt:

“List all my GitHub repositories.”

If GitHub MCP is connected correctly, the agent will reply with a list of all your GitHub repos — pulled directly from your GitHub account — without you opening a browser at all.

If you see an error instead:

  • Double-check that your token has the repo scope selected
  • Make sure you pasted the full token with no extra spaces
  • Try disconnecting and reconnecting the GitHub MCP server

Step 6 — Push Code to GitHub Using Just a Prompt

Now the exciting part.

Let’s say you just built the FinancePulse dashboard from Part 1 — or any project you have open in Antigravity right now.

Instead of manually running git init, git add ., git commit, git push — just type this in the Agent panel:

“Create a new public GitHub repository called ‘finance-pulse’. Then push all the current project files to it with the commit message ‘Initial commit — FinancePulse dashboard’.”

Here is what the agent will do — completely on its own:

1. Create the repo — The agent calls GitHub MCP to create a brand new repository called finance-pulse on your GitHub account.

2. Initialize git — It opens the terminal inside Antigravity and runs git init in your project folder.

3. Stage all files — It runs git add . to prepare all files for the commit.

4. Make the commit — It runs git commit -m “Initial commit — FinancePulse dashboard”.

5. Set the remote — It sets origin to point to the new GitHub repo URL.

6. Push the code — It runs git push origin main.

You can watch every single one of these steps happening live in the terminal panel at the bottom of Antigravity.

When it finishes, open your browser and go to github.com/YOUR_USERNAME/finance-pulse — your code is already there.

Step 7 — More Things You Can Do with GitHub MCP

Now that the GitHub MCP is connected, your agent has a whole new set of abilities. Try these prompts:

Create a new branch and push changes:

“Create a new branch called ‘feature/dark-mode’, add a dark mode toggle to the dashboard, and push the branch to GitHub.”

Open a Pull Request:

“Open a Pull Request from ‘feature/dark-mode’ to ‘main’ with the title ‘Add dark mode toggle’ and a short description of what was changed.”

Read an existing repo:

“Go to my GitHub repo called ‘my-portfolio’, read the README file, and suggest 3 improvements I can make.”

Check recent commits:

“Show me the last 5 commits on my ‘finance-pulse’ repository.”

The agent handles all the GitHub API calls behind the scenes. You just give instructions in plain English.

How to Add Any Other MCP Server (General Steps)

The process we followed for GitHub works the same way for every other MCP server. Here is the general pattern:

1. Open the Agent panel → Click … → Click MCP Servers
2. Search for the server you want in the MCP Store
3. Click on it and provide the required credentials (API key, token, or OAuth login — depends on the service)
4. Click Connect
5. Test it by asking the agent a simple question that uses that service
6. Start using it in your prompts!

Each MCP server is a little different in what credentials it needs, but the steps inside Antigravity are always the same.

A Real End-to-End Workflow

Here is what a complete agentic workflow looks like when everything is connected:

Your prompt: “Build a simple todo app in React with a clean UI. Add a proper README file. Then create a public GitHub repository called ‘my-todo-app’ and push everything with the commit message ‘Initial release’.”

What the agent does:

  • Scaffolds the React project (coding)
  • Installs all dependencies (terminal)
  • Builds the UI components (coding)
  • Writes the README file (file creation)
  • Creates the GitHub repository (GitHub MCP)
  • Commits and pushes all code (GitHub MCP + terminal)

This is what “agentic development” actually feels like in practice.

Important Tips Before You Go

Keep your GitHub token safe. Never paste it inside a file that gets pushed to GitHub. Antigravity stores it locally on your machine, not in your project files.

Always review before pushing to main. The agent is fast, but you are still the engineer. Check the code before it goes to your production branch.

Test on a small project first. Get comfortable with the workflow before you use it on your main codebase.

Token expired? Just generate a new one from GitHub and reconnect the MCP server in Antigravity — takes less than 2 minutes.

Scroll down in the MCP Store. There are many more servers available than what you see at first glance. Cloud Run, Firebase, BigQuery, Kubernetes — all waiting for you.

#GoogleAntigravity #MCP #GitHub #AgenticAI #GeminiAI #WebDevelopment #DevTools #ModelContextProtocol


Google Antigravity + MCP Servers: How to Connect GitHub and Push Code with Just a Prompt (Part… was originally published in Google Developer Experts on Medium, where people are continuing the conversation by highlighting and responding to this story.

Total
0
Shares
Leave a Reply

Your email address will not be published. Required fields are marked *

Previous Post

From Inbox to Character: Building a Private, Local AI Email Agent

Next Post

Time-Series Databases vs. Relational Databases, What is the Difference

Related Posts