How to connect Gemini to a server
Gemini talks to a server through MCP. You can run your own MCP server on a VPS and add it to the Gemini app as a custom app, or connect a service whose MCP server already exists. Here is what each way takes, and who can use it today.
Try it on your own project
Choose AI Claude CodeCodexGoogle AntigravityCursorVS CodeAnother AI
Claude Code can add BitHut by itself. Paste this into it:
Add the BitHut MCP server for me: run “claude mcp add --transport http bithut https://api.bithut.app/mcp”.
Then restart Claude Code, type /mcp, pick bithut and sign in: sign in to BitHut in your browser and press Allow.
Ask it: “Show my BitHut projects.” If it answers, you are connected.
Or run the command yourself
Run this command in a terminal.
claude mcp add --transport http bithut https://api.bithut.app/mcp
Start Claude Code, type /mcp, pick bithut and sign in. Sign in to BitHut in your browser and press Allow.
Already added BitHut in Claude, and you sign in to Claude Code with the same Claude account? Then BitHut is already in Claude Code.
Codex can connect BitHut by itself. Paste this into it:
Connect the BitHut MCP server for me: run “codex mcp add bithut --url https://api.bithut.app/mcp”, then “codex mcp login bithut”. The address must be exactly https://api.bithut.app/mcp: if a backslash got into it when pasting, remove it before adding.
A page opens in your browser: sign in to BitHut and press Allow.
Ask it: “Show my BitHut projects.” If it answers, you are connected.
Or run the commands yourself
Run these two commands.
codex mcp add bithut --url https://api.bithut.app/mcp codex mcp login bithut
The second one opens a page in your browser. Sign in to BitHut and press Allow.
Antigravity can add BitHut by itself. Paste this into its agent:
Add the BitHut MCP server for me: in ~/.gemini/config/mcp_config.json, under “mcpServers”, add "bithut": {"serverUrl": "https://api.bithut.app/mcp"}.
When Antigravity asks, sign in to BitHut and press Allow.
Ask it: “Show my BitHut projects.” If it answers, you are connected.
Or add it yourself
In the Antigravity editor, click … at the top of the agent panel, then MCP Servers, Manage MCP Servers, View raw config.
Under “mcpServers”, add this line and save the file.
"bithut": {"serverUrl": "https://api.bithut.app/mcp"}
When Antigravity asks, sign in to BitHut and press Allow.
Cursor can add BitHut by itself. Paste this into its chat:
Add the BitHut MCP server to Cursor for me: in ~/.cursor/mcp.json, under “mcpServers”, add "bithut": {"url": "https://api.bithut.app/mcp"}.
Then open Cursor Settings, find BitHut among the MCP servers, sign in and press Allow.
Ask it: “Show my BitHut projects.” If it answers, you are connected.
Or add it yourself
In ~/.cursor/mcp.json, under “mcpServers”, add this line and save the file.
"bithut": {"url": "https://api.bithut.app/mcp"}
Open Cursor Settings, find BitHut among the MCP servers, sign in and press Allow.
Open the Command Palette (Ctrl+Shift+P, on a Mac ⇧⌘P) and run “MCP: Add Server”.
Choose HTTP, paste this address and name the server bithut.
https://api.bithut.app/mcp
When VS Code asks, sign in to BitHut and press Allow.
Ask it: “Show my BitHut projects.” If it answers, you are connected.
Find where your AI app adds MCP servers. It may be called MCP servers, connectors or tools.
Add a remote (HTTP) server with this address.
https://api.bithut.app/mcp
If it asks how to sign in, choose OAuth. Sign in to BitHut and press Allow.
Ask it: “Show my BitHut projects.” If it answers, you are connected.
Can’t find the setting? Ask your AI: “How do I add a remote MCP server here?”
Copy the prompt into it: Show my BitHut projects
The short answer
Gemini doesn’t log in to a server the way a person does. It uses MCP (Model Context Protocol), an open standard: a program called an MCP server offers Gemini a set of tools, such as “list files” or “restart the app”, and Gemini calls them during a chat.
There are two places where you can plug an MCP server into Gemini:
- The Gemini app (gemini.google.com and the phone app). You add the server’s address as a custom app in Connected Apps.
- The terminal. Gemini CLI reads MCP servers from its settings file. For most personal accounts Google has replaced it with Antigravity CLI, which has its own MCP file. Both are covered below.
And there are two kinds of server to plug in:
- Your own MCP server on your VPS. You install it, give it a public HTTPS address, protect it with a sign-in and add that address to Gemini.
- A service that already runs an MCP server. You add its address and sign in. BitHut works this way: there is nothing to install, and Gemini puts your projects online through it.
Everything below about Gemini’s menus, limits and commands comes from Google’s own documentation, checked 23 November 2026.
What a custom app is
A custom app is a remote MCP server: a program on the internet that Gemini reaches by its address. You add it once, and Gemini can then call its tools. Google says the server “must follow the standard MCP specifications” (Gemini Apps Help). For a remote server that means the Streamable HTTP transport (MCP specification).
Two things to know before you start:
- You add it on the web only. Adding a custom app works only at gemini.google.com on a computer. After that the app works in the Gemini phone app too (Gemini Apps Help).
- Not everyone can add one yet. The requirements are below, and the country rule rules out most people outside the US.
Your own MCP server on a VPS
What you need
- An MCP server program. Either one a service publishes, or one you (or your AI) write for your own tasks.
- A public HTTPS address, for example
https://mcp.example.com/mcp. That means a domain, a certificate and a web server or proxy in front of the program. The Gemini app isn’t running on your computer, so an address that only opens inside your home or office network won’t do. - A sign-in. The Gemini app expects your server to support OAuth with Dynamic Client Registration, where Gemini registers itself on your server automatically. If your server can’t do that, you open Advanced features → Show more when adding the app and enter credentials by hand (Gemini Apps Help). Google doesn’t list the exact fields there. OAuth is the part that takes the most work to build.
- Upkeep. The program has to run day and night, restart after a crash or a reboot, and get updates. If the VPS is down, Gemini simply loses the tools.
- A firewall that leaves HTTPS open and closes everything you don’t need.
Who can add a custom app
According to Google, to connect a custom app you must (Gemini Apps Help):
- be 18 or over and in the US;
- sign in with a personal Google account; work and school accounts can’t do it “for now”;
- have the History setting on, otherwise custom apps are unavailable;
- use Gemini in English: custom apps are available only in English, in the phone app and at gemini.google.com.
Add it in the Gemini app
- On a computer, go to gemini.google.com.
- At the bottom, click Settings → Connected Apps.
- Under Custom apps, click Add a custom app (if you have none yet, the field says “Add a custom app link to get started”).
- Enter the server’s MCP address.
- If the server doesn’t support Dynamic Client Registration, open Advanced features → Show more and enter your credentials.
- Click Next and follow the on-screen steps, including the sign-in.
In a chat, type @ and pick the app to make sure Gemini uses it for that prompt. To switch it off, turn it off under Custom apps; to remove it, open More details → Remove app (Gemini Apps Help).
Add it in the terminal
Gemini CLI. One command adds a remote server (Gemini CLI docs):
gemini mcp add --transport http my-server https://mcp.example.com/mcp
By default it goes into the project’s .gemini/settings.json; add --scope user to put it in ~/.gemini/settings.json for all projects. In the file it is an entry under mcpServers with httpUrl. If the server supports OAuth discovery, the CLI finds the sign-in on its own and can register itself; run /mcp auth my-server to sign in, and /mcp to see whether the server is connected and which tools it offers.
Two catches from the same page. First, the OAuth sign-in needs a browser on the machine where the CLI runs: it won’t work over plain SSH on a VPS or in a container without a browser. Second, a banner there says that for unpaid and Google One users Gemini CLI was replaced by Antigravity CLI on 18 June 2026. Google’s announcement says Gemini CLI stays available with paid Gemini API keys and Gemini Code Assist Standard or Enterprise licenses (Google for Developers blog).
Antigravity CLI. It keeps MCP support but reads servers from ~/.gemini/config/mcp_config.json (or .agents/mcp_config.json in a project). A remote server is an entry under mcpServers with serverUrl, and it must use Streamable HTTP. For servers with Dynamic Client Registration, Antigravity handles OAuth itself (Antigravity docs). Moving from Gemini CLI by hand means renaming httpUrl to serverUrl (migration guide).
Gemini Enterprise is a separate path: there an administrator adds a custom MCP server for the whole organization in Google Cloud (Google Cloud docs).
Keep it safe
Google says it does not control, monitor or secure third-party MCP servers, and that you are responsible for supervising them. Gemini asks for your confirmation before any write action, but it can make mistakes, and it may share information from your chat with the server (Gemini Apps Help). For your own VPS, our advice:
- Never give an AI the root password or a tool that runs any command as root. Give the MCP server its own user with access only to what it needs.
- Keep keys apart from the code, in environment variables or a secret store, not in the repository.
- Offer only the tools you need. Every extra tool is one more thing Gemini can get wrong.
- Read what Gemini is about to do before you confirm a call that changes or deletes something.
The BitHut way: nothing to host
If what you want from “Gemini on a server” is to put a site, a bot or a script online, you don’t need a VPS of your own. BitHut already runs an MCP server at https://api.bithut.app/mcp, with the automatic client registration the Gemini app expects. You add it as a custom app and sign in. The steps are in the docs. For Antigravity, see the Connect page.
Then you just talk to Gemini:
- “Put this project online on BitHut”: it uploads the code, BitHut builds and checks it, and Gemini gets the address.
- “Why did my bot stop?”: Gemini reads the logs and the error and suggests a fix.
- “Roll back to yesterday’s version”: Gemini asks you to confirm, then does it.
Keys are stored apart from the code, sites start private behind a password page, and the price is fixed for the account: from $5 a month, see pricing. There is no free plan.
To be clear: we have not yet run BitHut with Gemini end to end ourselves. The Google requirements above apply as well, so outside the US the Gemini app won’t let you add BitHut yet. Other AIs and their steps are on the same Connect page.
When something doesn’t work
- There is no Custom apps section. Check that you are in the US, signed in with a personal account (not work or school), using Gemini in English, and that History is on (Gemini Apps Help).
- I can’t add it on my phone. Custom apps are added only at gemini.google.com on a computer; after that they work in the phone app.
- Gemini can’t reach my server. Check that the address opens from outside your network over HTTPS and that the server speaks Streamable HTTP.
- The sign-in fails. If your server has no Dynamic Client Registration, enter its credentials under Advanced features → Show more.
- Gemini doesn’t use the app. Type @ in the chat and pick the app, and check it is turned on under Custom apps.
- Gemini CLI sign-in won’t open on my VPS. The OAuth sign-in needs a browser on the same machine; run the CLI on your computer instead (Gemini CLI docs).
- Gemini CLI stopped answering. For unpaid and Google One users it was replaced by Antigravity CLI on 18 June 2026; move your servers to
mcp_config.json. - BitHut is connected but Gemini doesn’t answer about projects. Ask it: “Show my BitHut projects.” If it lists them, the connection works.
Read next
Put it online today
Tell your AI “put it on BitHut”, then open the address it gives you.