Antigravity CLI + Scrapeless: Add a Remote MCP Server
Expert Network Defense Engineer
TL;DR:
- Antigravity CLI connects to Scrapeless as a remote MCP server. One entry with a
serverUrland anx-api-tokenheader, added withagy mcp addor written by hand, is the whole setup. - Write the key itself into the header. A
${SCRAPELESS_API_KEY}reference is sent as literal text, and every tool call then fails with a 401 inside a run that still reports success. agy mcp listshows configuration, not a working connection. A server readsenabledwhether or not its key is valid.- Headless runs need an allow rule. MCP tools start in Ask mode, and
agy -pcannot ask, so it denies the call.mcp(scrapeless/scrape_markdown)inpermissions.allowlets that one tool run. - The header name is
x-api-token. Scrapeless answers a request without it with401 Unauthorized: Missing x-api-token header. - Get a key on the Scrapeless free plan and connect it in a few minutes.
Antigravity CLI, the agy command, runs Google's Antigravity agent from a terminal, and it is where Google now sends people who used Gemini CLI with a personal account. The agent can read files, run commands and search the web. The Scrapeless MCP server adds pages rendered in a cloud browser and returned as Markdown, a browser session the agent can drive step by step, background crawls and Google results data.
This guide adds the hosted server to Antigravity CLI and runs one tool call from a script. The configuration is short. Three details decide whether it works: how the key is written, which status line to trust, and the permission rule a headless run needs.
What Scrapeless Adds to Antigravity CLI
The server exposes 25 tools, grouped by job:
scrape_markdown,scrape_htmlandscrape_screenshotreturn a rendered page as Markdown, raw HTML or an image in one call.- Sixteen
browser_*tools, frombrowser_createandbrowser_gototobrowser_click,browser_typeandbrowser_snapshot, drive a cloud browser session step by step. crawl_start,crawl_resultandcrawl_cancelrun a crawl in the background and collect it later.google_searchandgoogle_trendsreturn search results and trend data, andai_scrapercaptures answers from AI assistants such as ChatGPT, Gemini and Perplexity.
Antigravity CLI keeps a copy of each tool's schema under ~/.gemini/antigravity-cli/mcp/scrapeless/, one JSON file per tool, and in testing the agent read the scrape_markdown schema before it called the tool.
If you use the Antigravity desktop app instead, our Antigravity IDE guide covers that setup.
Where Antigravity CLI Reads MCP Servers
Google's MCP documentation for Antigravity puts the configuration in ~/.gemini/config/mcp_config.json, with a workspace file at .agents/mcp_config.json as the local alternative. This guide uses the global file, the one the tests below read. A remote server takes two properties:
serverUrl, the URL of a remote Streamable HTTP or SSE server.headers, custom HTTP headers sent to that server.
Scrapeless is a Streamable HTTP endpoint at https://api.scrapeless.com/mcp, so no transport setting is needed.
Prerequisites
- Antigravity CLI, signed in with a Google account. This guide used
agy1.2.2 on Linux with a personal Google account. - A Scrapeless API key from the Scrapeless dashboard.
Step 1: Add the Server
agy mcp add writes the entry for you. Flags go before the server name, and an https URL is detected as an HTTP server:
bash
agy mcp add -H "x-api-token: YOUR_SCRAPELESS_API_KEY" scrapeless https://api.scrapeless.com/mcp
It answers:
text
Added MCP server "scrapeless" (http)
and writes this entry to ~/.gemini/config/mcp_config.json:
json
{
"mcpServers": {
"scrapeless": {
"disabled": false,
"headers": {
"x-api-token": "YOUR_SCRAPELESS_API_KEY"
},
"serverUrl": "https://api.scrapeless.com/mcp"
}
}
}
The command puts the key in your shell history. To avoid that, write the same entry into the file with an editor, then restrict the file to your user with chmod 600 ~/.gemini/config/mcp_config.json.
Setting this up now? The Scrapeless free plan covers the connection and your first tool calls.
Step 2: Put the Key Itself in the Header
Several MCP clients expand environment variables inside a config file, and it is tempting to write "x-api-token": "${SCRAPELESS_API_KEY}" here too. Antigravity CLI does not expand it. With that value in the file and the variable exported, a run that asked for scrape_markdown returned this as its answer:
text
Failed to fetch data. Error: [Scrapeless]: Request POST https://api.scrapeless.com/api/v1/unlocker/request failed with status 401
The run itself still reported "status": "SUCCESS". Scrapeless received the literal text ${SCRAPELESS_API_KEY}, accepted the connection as it does for any header value, and rejected the tool call. Write the key itself into the header, and protect the file instead.
Step 3: Check the Server List
List what the CLI will load:
bash
agy mcp list
text
NAME TYPE STATUS COMMAND/URL
scrapeless http enabled https://api.scrapeless.com/mcp
enabled means the entry is present and not switched off. The command returned in a fraction of a second and did not prove the key, so the check that counts is the tool call in Step 5.
Step 4: Allow the Tool Before a Headless Run
Antigravity asks before it runs an MCP tool it has no rule for. Antigravity's permissions reference lists MCP tools under Ask by default and matches them with mcp(server/tool), mcp(server/*) or mcp(*). In an interactive session that means an approval prompt. A print-mode run has nobody to ask, so it denies the call and prints:
text
jetski: no output produced — a tool required the "mcp" permission that headless mode cannot prompt for, so it was auto-denied. Add an allow-rule under permissions.allow in settings.json (e.g. mcp(<target>)). Alternatively, re-run with --dangerously-skip-permissions to auto-approve all tools.
Its JSON output lists the call under denied_actions as CallMcpTool. Add a rule for the one tool your script needs to ~/.gemini/antigravity-cli/settings.json, next to any rules already there:
json
{
"permissions": {
"allow": ["mcp(scrapeless/scrape_markdown)"]
}
}
Prefer a rule like this to --dangerously-skip-permissions, which approves every tool, file and command action for the run. mcp(scrapeless/*) allows all 25 Scrapeless tools. An open report on the CLI's repository, Antigravity CLI issue 548, describes print mode ignoring permissions.allow. With agy 1.2.2 the rule above was loaded and applied: the CLI log listed it at startup, and the call went through.
Step 5: Run One Tool Call
Ask for a small, checkable job in print mode:
bash
agy -p "Call the scrapeless MCP server's scrape_markdown tool with url https://example.com and reply with the first Markdown heading, verbatim." --output-format json
The JSON output carries the answer in response:
text
"status": "SUCCESS"
"response": "# Example Domain\n"
Antigravity's conversation record shows how the agent got there: it read the cached scrape_markdown schema, then called scrape_markdown on https://example.com. The runs took a little over two minutes each, and in the one timed step by step the tool call itself took about five seconds.
Read the response text, not status. A wrong key, a wrong header name or an unexpanded variable still produces SUCCESS, and the text starts with Failed to fetch data.
Fix the Common Problems
| What you see | Cause | Fix |
|---|---|---|
response starts with Failed to fetch data … 401 |
The key is wrong, or the header holds ${SCRAPELESS_API_KEY} |
Write the key itself into headers |
Empty response and denied_actions lists CallMcpTool |
No allow rule for the tool in a headless run | Add mcp(scrapeless/scrape_markdown) to permissions.allow |
| The agent answers without calling Scrapeless | It used a built-in web tool instead | Name the server and the tool in the prompt |
agy mcp add rejects the header flag |
The flag came after the server name | Put -H before scrapeless |
For more on the server itself, read the Scrapeless MCP server announcement. The Browser MCP documentation carries the configuration reference, the Scraping API page covers the actors behind the tools, and pricing lists what a call costs.
Conclusion
Adding Scrapeless to Antigravity CLI takes one entry in ~/.gemini/config/mcp_config.json: serverUrl set to https://api.scrapeless.com/mcp and an x-api-token header that holds the key itself. agy mcp add -H writes it in one line, and a scripted run needs one allow rule per tool.
Two outcomes look fine and are not. enabled in the server list says nothing about the key, and a run with a bad key or an unexpanded variable still reports success. Read the tool's answer, and the setup is proven.
Ready to give Antigravity's agent a live view of the web? Start with the Scrapeless free plan and add the server.
FAQ
Q: How do I add a remote MCP server with an API key header to Antigravity CLI?
Run agy mcp add -H "x-api-token: YOUR_KEY" scrapeless https://api.scrapeless.com/mcp, or add an entry with serverUrl and a headers object to ~/.gemini/config/mcp_config.json. Flags must come before the server name.
Q: Does Antigravity CLI expand environment variables in MCP headers?
Not in this setup. A header value of ${SCRAPELESS_API_KEY} was sent as literal text, and the tool call failed with a 401 while the run reported success. Put the key in the file and restrict the file's permissions.
Q: Why does agy deny my MCP tool call in print mode?
MCP tools run in Ask mode by default, and print mode cannot show a prompt, so the call is auto-denied and listed under denied_actions. Add mcp(server/tool) to permissions.allow in ~/.gemini/antigravity-cli/settings.json.
Q: Does enabled in agy mcp list mean the connection works?
No. It means the entry exists and is not disabled. A tool call that returns page content is the check.
Q: Can I use Gemini CLI for this instead?
Gemini CLI no longer serves personal Google accounts, which Google now directs to Antigravity. Antigravity CLI reads MCP servers from ~/.gemini/config/mcp_config.json.
Q: How many tools does Scrapeless add to Antigravity CLI?
25: three scrape_* tools, sixteen browser_* tools, three crawl_* tools, plus google_search, google_trends and ai_scraper.
At Scrapeless, we only access publicly available data while strictly complying with applicable laws, regulations, and website privacy policies. The content in this blog is for demonstration purposes only and does not involve any illegal or infringing activities. We make no guarantees and disclaim all liability for the use of information from this blog or third-party links. Before engaging in any scraping activities, consult your legal advisor and review the target website's terms of service or obtain the necessary permissions.



