Browse all documentation

Use Narwhal with Gemini tools

Antigravity CLI can connect to Narwhal through Streamable HTTP with an Authorization Bearer header. Individual users have moved from Gemini CLI to Antigravity CLI, whose command is `agy`. Gemini CLI can also connect where it remains available, using its own configuration format.

Quick start

  1. Get a free Narwhal key from https://narwhalapi.com/signup and keep it out of prompts and URLs.
  2. For Antigravity CLI, open ~/.gemini/config/mcp_config.json or the workspace file .agents/mcp_config.json.
  3. Add the remote entry with serverUrl and the Authorization Bearer header, then keep the file private.
  4. Verify the Antigravity connection with /mcp.
  5. Where Gemini CLI is available, run its add command with -s user to keep the key in your user settings.

MCP configuration

Antigravity CLI uses serverUrl for Streamable HTTP and a headers object. The Gemini CLI add command uses -s user, HTTP transport and an Authorization Bearer header.

~/.gemini/config/mcp_config.json
{
  "mcpServers": {
    "narwhal": {
      "serverUrl": "https://api.narwhalapi.com/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_NARWHAL_API_KEY"
      }
    }
  }
}
Gemini CLI
gemini mcp add -s user --transport http \
  --header "Authorization: Bearer YOUR_NARWHAL_API_KEY" \
  narwhal https://api.narwhalapi.com/mcp

Antigravity CLI documentation does not describe environment variable expansion in headers, so its configuration file stores the key value. Keep the file private and out of version control, whether it lives in your user configuration or the workspace.

Tools you get

Either supported CLI gets all these read-only groups through one Narwhal connection. Initialization and tool discovery are free; each successful call uses one request from the quota shared with REST.

GroupWhat you can ask forTools
Economic indicatorsAsk for CPI, inflation, unemployment, labour force participation, GDP, GDP growth and trade by country; coverage differs by indicator.economics_get_cpi economics_get_inflation economics_get_unemployment economics_get_labour_force_participation economics_get_gdp economics_get_gdp_growth economics_get_trade economics_get_cpi_history economics_get_inflation_history economics_get_unemployment_history economics_get_labour_force_participation_history economics_get_gdp_history economics_get_gdp_growth_history economics_get_trade_history economics_read_series_observations
Currency ratesAsk for current exchange rates, historical rates, currency conversions and rate bars for a currency pair.fx_get_rates fx_get_rate_history fx_convert_currency fx_get_rate_bars
Commodity pricesAsk for spot prices for gold, silver, platinum, palladium, copper, WTI crude oil, and Brent crude oil, their price history, and physical palm oil prices (crude palm oil and fresh fruit bunches).commodities_get_spot_price commodities_get_price_history commodities_list_palmoil_physical_series commodities_get_palmoil_physical_price commodities_get_palmoil_physical_observations commodities_list_physical_series commodities_get_physical_series commodities_get_physical_latest commodities_get_physical_observations
Releases and eventsAsk for official economic release dates and event details before you plan a country briefing.economics_list_releases economics_get_release events_list events_get
Public holidaysAsk for public holidays by country, holidays on a particular date or the next holiday.calendars_list_holidays calendars_get_holidays_on_date calendars_get_next_holiday
Prediction market oddsAsk for prediction market topics and events with scalar, extreme, timing and binary outcomes, their history, and policy paths by authority.predictions_list_topics predictions_get_topic predictions_list_events predictions_get_scalar predictions_get_extreme predictions_get_timing predictions_get_binary predictions_get_scalar_history predictions_get_extreme_history predictions_get_timing_history predictions_get_binary_history predictions_get_policy_path predictions_get_policy_path_history
Government bond yieldsAsk for government bond yield curves for the US, the UK, Germany, Japan, and Canada through the same Narwhal connection.economics_get_yield_curve economics_get_yield_curve_history

Example prompts

  • Get the latest inflation value for Japan.
  • Show the current USD/IDR exchange rate.
  • Get the current gold spot price.
  • Find the next official CPI release date for the United States.
  • List the public holidays in Indonesia for the current year.

Common workflows

Prepare a Japan inflation briefing

Japanese inflation is available through economics_get_inflation in either CLI. Select Japan for the latest reported percentage changes.

Check a rate before converting currency

Check USD/IDR with fx_get_rates, using USD as the base and IDR as the quote currency for the current indicative rate.

Review commodity prices for your analysis

commodities_get_spot_price accepts copper and a quote currency. The result is the current indicative spot price.

Check timing for the next CPI release

Include the United States and a date window of up to 366 days in an economics_list_releases request to locate the next official CPI release.

Tips

  • Use serverUrl in Antigravity CLI; httpUrl and the old SSE transport are unsupported there.
  • For Gemini CLI, -s user keeps the key in ~/.gemini/settings.json; the default project scope writes it to the repository's .gemini/settings.json.
  • Gemini CLI settings use an entry under mcpServers with httpUrl and headers.

FAQ

Can individual Gemini users still use Gemini CLI?

Individual users have moved from Gemini CLI to Antigravity CLI, whose command is agy. Gemini CLI has a separate configuration format where it remains available.

Which URL field does Antigravity CLI use for Narwhal?

Antigravity CLI uses serverUrl with the Streamable HTTP endpoint https://api.narwhalapi.com/mcp. Add the Authorization Bearer header in headers and verify the connection with /mcp.

Can Antigravity read the key from an environment reference?

The docs do not describe environment variable expansion in headers, so the file stores the key value. Keep the user or workspace configuration file private and out of version control.

Troubleshooting

SymptomCheck
Narwhal does not appear in Antigravity CLICheck the user or workspace mcp_config.json entry, confirm it uses serverUrl and inspect /mcp.
The server returns 401 invalid_api_keyCheck that the header contains Bearer followed by a space and an active key, rather than an unexpanded environment reference.
An Antigravity connection using httpUrl failsChange the remote entry to serverUrl and Streamable HTTP; Antigravity does not support httpUrl or the old SSE transport.
Gemini CLI no longer serves the account tierUse Antigravity CLI for individual accounts and follow its configuration format instead of the Gemini CLI settings format.