# How to build a website with VS Code, Gemini CLI, Antigravity or any MCP client

Add PageHub to your AI tool once, then describe the site you want. Your
agent builds it, checks it with screenshots, and puts it on your domain.
You end up with a real site that anyone can edit visually, not a folder of
code you still have to host. This guide covers how to build a website with
VS Code, build a website with Gemini CLI, build a website with Antigravity,
or with any MCP client.

**What you need:** an MCP client such as VS Code with GitHub Copilot,
Gemini CLI or Antigravity, a free PageHub account, and a domain if you want
one. Without a domain, the site publishes to a pagehub.dev subdomain.

## How it works

PageHub runs an MCP server, which is a set of tools an AI agent can call.
VS Code, Gemini CLI, Antigravity and most other MCP clients support remote
MCP servers over HTTP with OAuth sign-in, so once you add PageHub, your
agent can call tools like `create_site`, `set_theme`, `screenshot_site`,
and `publish_site` for you.

The site lives in PageHub, not in your project folder. PageHub also sends
its own build rules to your agent when it connects, so you don't paste any
instructions.

## Step 1: Create a free PageHub account

Go to pagehub.dev/signin and enter your email. You'll get a magic link and
a 6-digit code. Use either one to sign in.

The free plan has no credit card and no time limit. It includes 1 published
site, 20 pages per site, and hosting with SSL, and you can connect 1 domain
you own. Connecting your MCP client works on every plan.

## Step 2: Add the PageHub MCP server to your MCP client

Every client connects to the same server, `https://pagehub.dev/api/mcp`,
and signs you in through your browser. There's no API key to paste. What
changes is where the setting goes:

| Client | Where PageHub goes | How you sign in |
|---|---|---|
| VS Code (Copilot) | `.vscode/mcp.json` or your user `mcp.json`, under `servers` with `"type": "http"` | Click **Start** above the entry |
| Gemini CLI | One command, saved to `~/.gemini/settings.json` | `/mcp auth PageHub` |
| Antigravity | `~/.gemini/config/mcp_config.json`, as `serverUrl` | `/mcp` opens the MCP Manager |
| Any other client | Its MCP settings, as a remote HTTP server | When it opens PageHub in your browser |

In each case the browser sign-in is the same: sign in with your email, then
click **Approve** on the Authorize PageHub screen. Using Claude Code or
Cursor? They have their own guides:
[Claude Code](https://pagehub.dev/build-website-with-claude-code) and
[Cursor](https://pagehub.dev/build-website-with-cursor).

### VS Code and Copilot

The quick way: click the Install in VS Code button on this page. Your
browser hands off to VS Code, which asks you to install PageHub.

To add it by hand, run **MCP: Add Server** from the Command Palette, or put
this in `.vscode/mcp.json` (one project) or your user `mcp.json` (every
project; run **MCP: Open User Configuration**):

```json
{
  "servers": {
    "PageHub": {
      "type": "http",
      "url": "https://pagehub.dev/api/mcp"
    }
  }
}
```

VS Code's file uses `servers` and `"type": "http"`, not the `mcpServers`
shape other apps use. Save it, click **Start** above the PageHub entry,
trust the server, and sign in. To check it worked, open Copilot Chat,
switch to **Agent** mode, and click **Configure Tools**. PageHub's tools
should be listed. On a Copilot Business or Enterprise plan, your admin may
need to allow MCP servers first.

### Gemini CLI

**Signed in with a Google account?** Since June 18, 2026, Gemini CLI no
longer works with a free, Google AI Pro, or Ultra sign-in. Google moved
those users to Antigravity, so follow the Antigravity steps. With a paid
Gemini API key or a company Gemini Code Assist license, run this in your
terminal:

```text
gemini mcp add --transport http --scope user PageHub https://pagehub.dev/api/mcp
```

`--scope user` saves PageHub to `~/.gemini/settings.json`, so it's there in
every folder. Without it, Gemini CLI saves it to `.gemini/settings.json` in
the current folder only. Then start `gemini` and type `/mcp auth PageHub`
to sign in. Type `/mcp` to check: PageHub should say **CONNECTED**. Gemini
CLI asks before each PageHub tool unless you choose to always allow the
server.

### Antigravity

Open `~/.gemini/config/mcp_config.json`, or create it, and add PageHub:

```json
{
  "mcpServers": {
    "PageHub": {
      "serverUrl": "https://pagehub.dev/api/mcp"
    }
  }
}
```

Use `serverUrl` exactly. Antigravity doesn't accept `url` or `httpUrl`
here. If the file already lists other servers, add the `PageHub` entry
inside the `mcpServers` object you have. For one project only, put the same
entry in `.agents/mcp_config.json` in that project. Then start `agy` (or
open the app) and type `/mcp`. The MCP Manager asks you to sign in, and
PageHub shows as active once you have.

### Any other MCP client

Add PageHub as a remote server (often called HTTP or Streamable HTTP) with
the URL `https://pagehub.dev/api/mcp`, then sign in when it opens PageHub
in your browser. The MCP server docs at pagehub.dev/developers/mcp have the
config for more clients.

Whichever client you use, check it worked by asking: "List my PageHub
sites."

## Step 3: Prompt your agent to build the site

Open your agent's chat (Copilot Chat in Agent mode, gemini or agy in a
terminal) and describe the site. Say who it's for, which pages you want,
and what visitors should do. Real details (hours, prices, your email) beat
placeholders. Swap the bracketed parts in these prompts for your own.

A local business site:

```text
Use PageHub to build a website for [business name], a [type of business] in [city].
Pages: Home, Services (with prices), and Contact.
Hours: [days and times]. Address: [address]. Phone: [phone].
Add a contact form that asks for name, email, and what they need.
Keep the look [warm and simple / bold / minimal].
Screenshot it on desktop and mobile before you tell me it's done. Don't publish yet.
```

A portfolio:

```text
Use PageHub to create a portfolio site for me. I'm a [job title] in [city].
Home page: a short intro, then a grid of 6 projects, each with a title, a one-line summary, and an image.
Add an About page and a contact section with my email, [you@example.com].
Clean layout with lots of white space. Use stock photos for now and I'll swap in my own.
Show me screenshots before publishing.
```

A landing page for a side project:

```text
Use PageHub to make a one-page site for my side project, [name]: [one sentence on what it does].
Sections: a hero with an email sign-up form, 3 features, a short FAQ, and a footer.
Suggest 3 color palettes and let me pick one before you build.
When it's built, run an SEO check and fix what it finds. Don't publish until I say so.
```

From there, your agent looks up PageHub's templates and section blocks,
creates the site with `create_site`, sets colors and fonts with
`set_theme`, adds sections, and finds stock photos with `find_image`. Then
it checks its work with `screenshot_site`.

## Step 4: Review the draft and edit it yourself

Everything your agent builds lands in a draft. Nobody else sees it until
you publish.

Ask for screenshots at any point. `screenshot_site` takes a real browser
screenshot of the draft, one section at a time if you like, and at phone
width (390 pixels). Your agent reads the screenshots and fixes what it
sees. VS Code also shows them in the chat. To look for yourself, open the
site in your PageHub dashboard.

To edit by hand, open your PageHub dashboard, pick the site, and click
**Design**. That opens the visual editor. Drag sections around, change
colors and fonts, and rewrite text. Your agent reads the same draft, so it
sees your edits the next time you ask for changes.

Before you publish, ask your agent to run `audit_seo` and
`audit_accessibility` and fix what they find.

## Step 5: Publish and connect your domain

Ask your agent: "Connect [example.com] to this site and tell me the DNS
records to add." It calls `set_domain`, which attaches the domain and
returns the records. Add them where you bought the domain:

- The bare domain (example.com) gets an **A** record at `@`.
- A subdomain such as `www` gets a **CNAME** record.
- Sometimes there's also a **TXT** record, to prove you own the domain.

Copy each value exactly as your agent gives it to you. The values are
specific to your site, so a value from another guide won't work.

PageHub sets up both example.com and www.example.com, and by default sends
www visitors to the bare domain. SSL certificates are issued automatically
and can take a few minutes once DNS is in place.

Then ask: "Is my domain working yet?" Your agent checks with
`get_domain_status`. Connecting a domain doesn't publish the site, so
finish with: "Publish the site." That calls `publish_site`, and the site is
live.

Rather click? The Domains page for your site in the PageHub dashboard shows
the same records.

## Step 6: Make changes later

You have two ways in, and both edit the same draft.

- **From your agent:** ask, for example, "In my PageHub site [name], add a
  reviews section under Services." Check the screenshot, then say
  "publish."
- **From the editor:** open the site, click **Design**, make your changes,
  and publish.

If a change goes wrong, the site's History page lets you restore an earlier
version of the whole site or one page. The free plan keeps 15 versions.

## Other ways to ship from your MCP client

PageHub is one way to publish a website from your MCP client. You can also
have your agent write the site as code in your project, then deploy the
code yourself.

- **Vercel or Netlify:** connect your Git repository, and each push builds
  and deploys the site. You add your domain in their dashboard and set DNS
  at your registrar. A good fit when the site is really an app with its own
  code.
- **GitHub Pages:** serves static files straight from a repository. A good
  fit for simple static sites and project docs.

The tradeoff: you own every line and can build anything. You also handle
Git, builds, and DNS yourself, and every text change is a code change.
PageHub fits when you want a site that people can edit visually. It isn't
the right tool for custom app logic.

## Troubleshooting

### PageHub doesn't connect

- **VS Code:** run **MCP: List Servers**, pick PageHub, and choose **Start
  Server**, or **Show Output** to see why it failed. Not listed? Check the
  file uses `servers`, not `mcpServers`. A missing comma or bracket breaks
  the whole file.
- **Gemini CLI:** type `/mcp`. If it asks you to sign in, run
  `/mcp auth PageHub`. If it says DISCONNECTED, run `gemini mcp list` and
  check the URL. Not listed? You probably added it without `--scope user`
  in another folder.
- **Antigravity:** type `/mcp` for each server's status and log. Check the
  file is valid JSON at `~/.gemini/config/mcp_config.json` and uses
  `serverUrl`, then reload from the MCP Manager.

### Sign-in doesn't finish

In the browser window, sign in with the email link or the 6-digit code,
then click **Approve**. If the code has expired, request a new one. Gemini
CLI and Antigravity sign you in through a browser on the same computer, so
that won't work over SSH or in a remote container.

If the browser sign-in still won't complete, use an API key instead. Create
one at pagehub.dev/dashboard/api-key and use your client's config below.

VS Code asks for the key once and stores it, so it never sits in the file:

```json
{
  "inputs": [
    {
      "type": "promptString",
      "id": "pagehub-key",
      "description": "PageHub API key",
      "password": true
    }
  ],
  "servers": {
    "PageHub": {
      "type": "http",
      "url": "https://pagehub.dev/api/mcp",
      "headers": {
        "Authorization": "Bearer ${input:pagehub-key}"
      }
    }
  }
}
```

Gemini CLI reads it from `PAGEHUB_API_KEY` in your shell profile. Change
PageHub's entry in `~/.gemini/settings.json` to:

```json
{
  "mcpServers": {
    "PageHub": {
      "httpUrl": "https://pagehub.dev/api/mcp",
      "headers": {
        "Authorization": "Bearer $PAGEHUB_API_KEY"
      }
    }
  }
}
```

Antigravity takes the key in the entry, in place of `ph_your_key_here`:

```json
{
  "mcpServers": {
    "PageHub": {
      "serverUrl": "https://pagehub.dev/api/mcp",
      "headers": {
        "Authorization": "Bearer ph_your_key_here"
      }
    }
  }
}
```

### The agent doesn't use the PageHub tools

- **VS Code:** check the chat is in **Agent** mode, then click **Configure
  Tools** and make sure PageHub's tools are on.
- **Gemini CLI:** servers load when it starts. If you added PageHub while
  it was running, quit and start it again.
- **Antigravity:** if you edited the file while it was running, reload from
  the MCP Manager.

If you see a rate-limit error, wait a minute. The server allows 120
requests per minute for each sign-in.

### The domain isn't working

- Compare each record at your registrar with what your agent gave you,
  character for character. A wrong value fails the same way slow DNS does.
- The bare domain needs an A record. It can't be a CNAME.
- If your agent gave you a TXT record, add it as well as the others.
- DNS changes can take a while to spread. Ask your agent to check the
  domain again later.
- If the domain is already attached to another Vercel project, remove it
  there first, then ask your agent to try again.
- Each site takes 1 domain, plus its www version.

Want the full tool list and other clients? See the MCP server docs at
pagehub.dev/developers/mcp, or compare plans at pagehub.dev/pricing.

## FAQ

### Can VS Code, Gemini CLI or Antigravity host a website?

No. They write and run code, so the site has to be hosted somewhere else.
In this guide PageHub hosts it, with SSL included. If you have your agent
write the site as code instead, you deploy that code to a host such as
Vercel, Netlify, or GitHub Pages.

### I used Gemini CLI with my Google account. Which steps do I follow?

The Antigravity steps. Google stopped serving free, Google AI Pro and Ultra
sign-ins in Gemini CLI on June 18, 2026 and moved them to Antigravity. With
a paid Gemini API key or a company Gemini Code Assist license, the Gemini
CLI steps still work.

### Is it free?

PageHub's free plan costs $0 with no credit card and no time limit. It
includes 1 published site, 20 pages per site, and hosting with SSL, and you
can connect 1 domain you own. Pro is $7 a month per site ($5 billed
annually) and raises the limit to 300 pages. You buy the domain itself from
a registrar. Copilot is a separate GitHub subscription.

### Do I need to know how to code?

No. You describe the site in plain words, and your agent calls PageHub's
tools to build it. No code files are written to your project. The technical
steps are adding PageHub to your client and adding DNS records at your
domain registrar, and your agent tells you exactly which records to add.

### Does this put any files in my project?

Only a config file, and only if you choose a project-level one:
.vscode/mcp.json in VS Code, .gemini/settings.json when you leave off
--scope user in Gemini CLI, or .agents/mcp_config.json in Antigravity. The
user-level config keeps your project untouched. The site itself is stored
in PageHub, and you can export it as static HTML on any plan.

### Can someone who doesn't use my MCP client edit the site?

Yes. Every PageHub site opens in a visual editor where you drag sections,
change colors and fonts, and rewrite text. Your agent reads the same draft,
so it sees those edits the next time you ask for changes. You can invite 1
teammate per site on Free, and unlimited on Pro and up.

### Can I use Claude Code or Cursor instead?

Yes. It's the same server at the same URL, and there are step-by-step
guides for both. A site you start in one, you can keep editing in another.

### Is it safe to let my agent edit my site?

Every change goes to a private draft, and visitors keep seeing the
published version until someone publishes. Copilot, Gemini CLI and
Antigravity ask before they run a PageHub tool unless you allow the server.
If a change goes wrong, restore an earlier version from the site's History
page.

### Are sites built this way good for SEO?

PageHub renders pages to HTML on the server, and each custom domain gets
its own sitemap.xml and robots.txt. Ask your agent to run audit_seo, which
checks titles, descriptions, headings, image alt text, and link text, then
fix what it finds.

---

Visual Studio Code and GitHub Copilot are trademarks of Microsoft
Corporation and GitHub, Inc. Gemini and Google Antigravity are trademarks of
Google LLC. PageHub isn't affiliated with or endorsed by them.
