AI assistants

Gemini CLI

Connect Gemini CLI to the hosted Costfluent MCP server with gemini mcp add and sign in with /mcp auth or send an API token, or run the server on your machine with the Costfluent extension.

Gemini CLI connects to the hosted Costfluent MCP server at https://mcp.costfluent.com from an httpUrl entry in its settings.json, and you sign in or send an API token. The Costfluent extension of costfluent/agent-skills connects the same hosted server and adds the cost skills; to run the server on your machine instead, see Run it on your machine.

Before you start

  • To sign in, a Costfluent account in the organization Gemini CLI should read. To send a token, or to run the server on your machine, an API token from the Read only preset; see Create a token.
  • To run the server on your machine, costfluent-mcp on your PATH; see Install the server.

Connect and sign in

  1. Run gemini mcp add --transport http costfluent https://mcp.costfluent.com. It adds the server to .gemini/settings.json in the current project.
  2. Start Gemini CLI and run /mcp auth costfluent. Costfluent opens in your browser: sign in, choose the organization Gemini CLI may read and select Allow.
  3. Ask a question, such as "What did we spend on AWS last month, by service?".

Connect with an API token

For the write tools, send a token instead of signing in. Add the entry to ~/.gemini/settings.json, or to .gemini/settings.json in a project; Gemini CLI replaces ${COSTFLUENT_API_TOKEN} with the variable from its environment, so the file holds no token:

JSONCode
{ "mcpServers": { "costfluent": { "httpUrl": "https://mcp.costfluent.com", "headers": { "Authorization": "Bearer ${COSTFLUENT_API_TOKEN}" } } } }

Add the skills with the extension

  1. Run gemini extensions install https://github.com/costfluent/agent-skills. The extension connects the hosted server; run /mcp auth costfluent to sign in.
  2. Start Gemini CLI and ask a question, such as "What did we spend on AWS last month, by service?".

How it behaves

  • httpUrl is Gemini CLI's key for a Streamable HTTP server; its url key is for the older SSE transport, so the entry takes httpUrl.
  • Signed in, Gemini CLI gets the read tools alone, and never more than you may read yourself in that organization. It is listed under Settings, Connected apps in Costfluent, where Revoke disconnects it.
  • The extension holds no token: it connects the hosted server and signs in, so Gemini CLI needs no COSTFLUENT_API_TOKEN in your environment.