Gemini CLI and Antigravity Preline MCP Setup
Connect Preline UI MCP to Gemini CLI or Google Antigravity, then build with real Preline components, blocks, documentation, and framework guidance.
Setup overview
The hosted Preline UI MCP server is ready to use from Gemini CLI and Google Antigravity. It uses Streamable HTTP and requires an API key, sent as a bearer token.
- MCP endpoint
https://mpc.preline.co- Transport
- Streamable HTTP
- Authentication
Authorization: Bearer TOKEN_KEY
Once connected, either agent can discover Preline catalog items, fetch the matching source, and place HTML, CSS, scripts, and init code in the right files. For broader MCP prompting guidance, see the Preline UI MCP Server guide.
For the most up-to-date instructions for adding MCP servers, see the official Gemini CLI setup guide and the official Google Antigravity MCP guide.
Setup
Choose the Google agent surface you use. Each setup path connects to the hosted Preline MCP server.
-
Add the Preline MCP server
Add Preline as a Streamable HTTP server from your project root. Gemini CLI stores it in the project-level
.gemini/settings.jsonby default:Terminalgemini mcp add --transport http --header "Authorization: Bearer TOKEN_KEY" preline https://mpc.preline.coReplace
TOKEN_KEYwith your Preline API key. The CLI calls the option--transport http, and its documentation defines that value as Streamable HTTP. Add--scope userto save the server globally in~/.gemini/settings.jsoninstead.You can also configure the server directly in either
settings.jsonfile. For Streamable HTTP, Gemini CLI useshttpUrl, noturlorserverUrl:.gemini/settings.json{ "mcpServers": { "preline": { "httpUrl": "https://mpc.preline.co", "headers": { "Authorization": "Bearer TOKEN_KEY" } } } }Keep the token private: the configuration above contains a credential. Do not commit it to version control; use the global file or exclude the project file if it contains the real token.
-
Inspect the saved server
Confirm that Gemini CLI saved the Preline configuration:
Terminalgemini mcp list -
Verify the tools in your session
In an interactive Gemini CLI session, run
/mcp listto see connection details, discovered tools, resources, and prompts.Terminal/mcp listYou should see
prelinelisted and its tools available.
-
Add the Preline raw configuration
Antigravity uses a different configuration schema from Gemini CLI. To add a custom server from Antigravity IDE:
- Open the ... menu at the top of the editor's agent side panel and select MCP Servers.
- Select Manage MCP Servers, then View raw config.
- Add the
prelineentry below tomcp_config.json, replaceTOKEN_KEY, and save.
~/.gemini/config/mcp_config.json{ "mcpServers": { "preline": { "serverUrl": "https://mpc.preline.co", "headers": { "Authorization": "Bearer TOKEN_KEY" } } } }Do not reuse the Gemini CLI entry unchanged. Antigravity requires
serverUrlfor a remote server. Its global file is~/.gemini/config/mcp_config.json; use.agents/mcp_config.jsonin the workspace for a project-scoped setup. -
Verify and manage the server
Return to the MCP Servers screen to confirm the connection and enable, disable, refresh, or remove the server. Antigravity also provides an MCP Store for listed integrations; Preline's custom authenticated endpoint uses the raw configuration path above.
Install Preline Agent Skills
MCP gives Gemini CLI and Antigravity access to the Preline catalog. Agent Skills add Preline-specific workflow instructions, so the agent is more likely to follow the right discovery, placement, theming, and validation habits.
Install the Preline skills from your project root:
npx skills add htmlstreamofficial/preline
Choose the shared project path .agents/skills/ when prompted. Both Gemini CLI and Antigravity discover workspace skills there. Gemini CLI also supports .gemini/skills/, while Antigravity's preferred workspace path is .agents/skills/ (with legacy .agent/skills/ support).
Their global locations are different: Gemini CLI reads ~/.gemini/skills/ or ~/.agents/skills/, while Antigravity IDE uses ~/.gemini/config/skills/. Every skill is a folder containing SKILL.md. Gemini CLI can list discovered skills with gemini skills list --all or /skills list; use /skills in Antigravity. For the full Preline setup workflow, see How to set up Agent Skills.
Build with Preline
Prompt Gemini in plain language. Name Preline, describe the component or block you want, and mention the file or framework context when it matters.
Using Preline, add a pricing comparison section to app/pricing.html.
Use the default theme and keep the existing page header.
Use Preline MCP to add a modal with a form.
Wire the required scripts into the existing layout.
Keep my current Tailwind setup.
Show me the Preline dropdown JavaScript API.
Then update this dropdown to close after item selection.
Troubleshooting
Gemini CLI does not list the Preline server.
Run gemini mcp list. If you edited the configuration manually, confirm preline is under mcpServers in project .gemini/settings.json or global ~/.gemini/settings.json, and that the remote endpoint uses httpUrl.
Antigravity does not connect to the server.
Open MCP Servers from the agent panel and inspect the server status or logs. In mcp_config.json, use serverUrl; Gemini CLI's httpUrl field is not the Antigravity schema.
The server responds with "Missing API key".
The request reached the server without a valid Authorization: Bearer TOKEN_KEY header. Confirm the header is inside the preline server entry and replace TOKEN_KEY with your actual Preline API key.
The agent writes generic Tailwind CSS instead of using Preline.
Make the instruction explicit: say Use Preline MCP or Using Preline, then name the component, block, theme, and target file.
Agent Setup Guides
Switch to another coding agent setup guide.