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-mcpon yourPATH; see Install the server.
Connect and sign in
- Run
gemini mcp add --transport http costfluent https://mcp.costfluent.com. It adds the server to.gemini/settings.jsonin the current project. - 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. - 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:
Code
Add the skills with the extension
- Run
gemini extensions install https://github.com/costfluent/agent-skills. The extension connects the hosted server; run/mcp auth costfluentto sign in. - Start Gemini CLI and ask a question, such as "What did we spend on AWS last month, by service?".
How it behaves
httpUrlis Gemini CLI's key for a Streamable HTTP server; itsurlkey is for the older SSE transport, so the entry takeshttpUrl.- 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_TOKENin your environment.
Related
- MCP server: the token, the tools and how the server behaves
- Ask good questions and Troubleshooting: asking for the right figures, and what each error means