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-mcpand the command line,costfluent, on yourPATH; both come in the same release archive.
Connect and sign in
-
Add the server to
~/.cursor/mcp.json, or to.cursor/mcp.jsonin a project to reach it from that project alone:Code -
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.
-
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:
Code
Run it on your machine
- Run
costfluent mcp install --client cursor --write. It adds the server to~/.cursor/mcp.json; with--projectit writes.cursor/mcp.jsonin the current directory instead. - Set
COSTFLUENT_API_TOKENto the token in your shell, and start Cursor from that shell. - 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
envFileat a file that sets the variable. costfluent mcp install --client cursor --write --embed-tokenwrites 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.
Related
- MCP server: the token, the tools and how the server behaves
- Command line: every client
costfluent mcp installwrites for - costfluent/agent-skills: the cost skills for Cursor's agent
- Ask good questions and Troubleshooting: asking for the right figures, and what each error means