AI assistants

Cursor

Connect Cursor to the hosted Costfluent MCP server with a url entry in mcp.json and sign in or send an API token, or run the server on your machine with costfluent mcp install.

Cursor connects to the hosted Costfluent MCP server at https://mcp.costfluent.com from an entry in its mcp.json, and you sign in or send an API token. To run the server on your machine instead, costfluent mcp install adds an entry that starts it, reading the token from COSTFLUENT_API_TOKEN in Cursor's environment rather than writing it into the file.

Before you start

  • To sign in, a Costfluent account in the organization Cursor 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 and the command line, costfluent, on your PATH; both come in the same release archive.

Connect and sign in

  1. Add the server to ~/.cursor/mcp.json, or to .cursor/mcp.json in a project to reach it from that project alone:

    JSONCode
    { "mcpServers": { "costfluent": { "url": "https://mcp.costfluent.com" } } }
  2. Cursor asks you to sign in to the server. Costfluent opens in your browser: sign in, choose the organization Cursor may read and select Allow.

  3. Ask Cursor's agent 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. The entry reads it from COSTFLUENT_API_TOKEN in Cursor's environment, so the file holds no token:

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

Run it on your machine

  1. Run costfluent mcp install --client cursor --write. It adds the server to ~/.cursor/mcp.json; with --project it writes .cursor/mcp.json in the current directory instead.
  2. Set COSTFLUENT_API_TOKEN to the token in your shell, and start Cursor from that shell.
  3. Ask Cursor's agent a question, such as "What did we spend on AWS last month, by service?".

Instead of step 1, you can add Costfluent to Cursor in one click. The link adds an entry like the installer's, with the same reference to COSTFLUENT_API_TOKEN, but names costfluent-mcp without the full path the installer writes, so costfluent-mcp must be on the PATH Cursor sees, and step 2 still applies.

How it behaves

  • Signed in, Cursor 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.
  • Cursor started from the Dock does not see your shell's variables: start it from a shell, or point the entry's envFile at a file that sets the variable.
  • costfluent mcp install --client cursor --write --embed-token writes the token itself into the entry, for a Cursor started where the variable is not set, and makes the file readable by you alone; see Command line.