Skip to content

External Providers, MCP & Vercel

Raw Markdown Source.md
---
title: External Providers, MCP & Vercel
description: Model routing in agy, Model Context Protocol, and seamless Vercel integration.
sidebar:
  order: 9
---

Connect external developer tools and cloud infrastructure to Antigravity CLI using the Model Context Protocol (MCP).

---

## Third-Party Models in `agy` (No OpenRouter Needed)

While `agy` does not support swapping in arbitrary OpenAI-compatible base URLs for its core loop, Google natively bundles top frontier models into your subscription:

* **`claude-sonnet-4-6`**: Claude Sonnet 4.6 (Thinking)
* **`claude-opus-4-6-thinking`**: Claude Opus 4.6
* **`gpt-oss-120b-medium`**: GPT-OSS 120B
* **Gemini 3.x Flash & Pro**

You can assign these directly to any subagent (e.g. `model: claude-sonnet-4-6`) without paying per-token API charges.

---

## What is MCP? (The "USB Port" for AI)

**Model Context Protocol (MCP)** is an open standard that lets AI agents connect to external developer tools, databases, and cloud platforms through a single universal protocol.

---

## Connecting Vercel MCP to `agy`

Vercel provides an official remote MCP server at `https://mcp.vercel.com`.

### Recommended Command (Using `mcp-remote` Bridge)
```bash
agy mcp add vercel npx -y mcp-remote https://mcp.vercel.com
```

### The 401 Unauthorized Caveat:
If you attempt to add `https://mcp.vercel.com` as a raw HTTP URL without the `mcp-remote` bridge, the server rejects unauthenticated handshakes with `401 Unauthorized`. 

Using `mcp-remote` spins up a local listener (`localhost:23098`), handles the browser OAuth login, and stores your session token permanently in `~/.mcp-auth/`.

---

## Headless Server & Remote VPS Setup (No Browser)

When running `agy` or Vercel MCP on a remote VPS (e.g. Debian on Vultr) without a graphical desktop:

### Method A: The Credential Sync (Fastest)
Authenticate once on your local machine with a browser, then copy your cached tokens to the remote VPS:
```bash
# Sync Vercel MCP OAuth tokens:
scp -r ~/.mcp-auth user@vps_ip:~/

# Sync Antigravity user session & settings:
scp -r ~/.gemini/antigravity-cli user@vps_ip:~/.gemini/
```
The VPS now has valid credentials and runs with zero browser prompts.

### Method B: SSH Port-Forwarding
Tunnel the OAuth callback port (`23098`) over SSH so your local laptop's browser can route the redirect back to the VPS listener:
```bash
ssh -L 23098:localhost:23098 user@vps_ip
```
Run `npx -y mcp-remote https://mcp.vercel.com` on the VPS, open the printed link in your laptop browser, and the SSH tunnel routes the OAuth callback back to the VPS!

### Method C: Personal Access Tokens
Bypass OAuth completely by creating a Personal Access Token in your Vercel dashboard:
```bash
agy mcp add --header "Authorization: Bearer YOUR_VERCEL_TOKEN" vercel https://mcp.vercel.com
```
And for `agy` headlessly:
```bash
export GEMINI_API_KEY="your-gemini-api-key"
```

Connect external developer tools and cloud infrastructure to Antigravity CLI using the Model Context Protocol (MCP).


Third-Party Models in agy (No OpenRouter Needed)

Section titled “Third-Party Models in agy (No OpenRouter Needed)”

While agy does not support swapping in arbitrary OpenAI-compatible base URLs for its core loop, Google natively bundles top frontier models into your subscription:

  • claude-sonnet-4-6: Claude Sonnet 4.6 (Thinking)
  • claude-opus-4-6-thinking: Claude Opus 4.6
  • gpt-oss-120b-medium: GPT-OSS 120B
  • Gemini 3.x Flash & Pro

You can assign these directly to any subagent (e.g. model: claude-sonnet-4-6) without paying per-token API charges.


Model Context Protocol (MCP) is an open standard that lets AI agents connect to external developer tools, databases, and cloud platforms through a single universal protocol.


Vercel provides an official remote MCP server at https://mcp.vercel.com.

Section titled “Recommended Command (Using mcp-remote Bridge)”
Terminal window
agy mcp add vercel npx -y mcp-remote https://mcp.vercel.com

If you attempt to add https://mcp.vercel.com as a raw HTTP URL without the mcp-remote bridge, the server rejects unauthenticated handshakes with 401 Unauthorized.

Using mcp-remote spins up a local listener (localhost:23098), handles the browser OAuth login, and stores your session token permanently in ~/.mcp-auth/.


Headless Server & Remote VPS Setup (No Browser)

Section titled “Headless Server & Remote VPS Setup (No Browser)”

When running agy or Vercel MCP on a remote VPS (e.g. Debian on Vultr) without a graphical desktop:

Authenticate once on your local machine with a browser, then copy your cached tokens to the remote VPS:

Terminal window
# Sync Vercel MCP OAuth tokens:
scp -r ~/.mcp-auth user@vps_ip:~/
# Sync Antigravity user session & settings:
scp -r ~/.gemini/antigravity-cli user@vps_ip:~/.gemini/

The VPS now has valid credentials and runs with zero browser prompts.

Tunnel the OAuth callback port (23098) over SSH so your local laptop’s browser can route the redirect back to the VPS listener:

Terminal window
ssh -L 23098:localhost:23098 user@vps_ip

Run npx -y mcp-remote https://mcp.vercel.com on the VPS, open the printed link in your laptop browser, and the SSH tunnel routes the OAuth callback back to the VPS!

Bypass OAuth completely by creating a Personal Access Token in your Vercel dashboard:

Terminal window
agy mcp add --header "Authorization: Bearer YOUR_VERCEL_TOKEN" vercel https://mcp.vercel.com

And for agy headlessly:

Terminal window
export GEMINI_API_KEY="your-gemini-api-key"