AI assistants

VS Code

Connect VS Code's agent sessions to the hosted Costfluent MCP server with an http entry and sign in or send an API token, or run the server on your machine with costfluent mcp install.

New agent sessions in VS Code run on its Copilot harness, which reads the same configuration file as GitHub Copilot CLI. A "type": "http" entry there connects to the hosted Costfluent MCP server at https://mcp.costfluent.com, 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 rather than writing it into the file.

Before you start

  • To sign in, a Costfluent account in the organization VS Code 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 ~/.copilot/mcp-config.json, or to mcp-config.json in COPILOT_HOME when that is set. If costfluent mcp install wrote a costfluent entry there before, replace it:

    JSONCode
    { "mcpServers": { "costfluent": { "type": "http", "url": "https://mcp.costfluent.com" } } }
  2. Start a new agent session. When VS Code offers Authenticate among the session's server actions, select it. Costfluent opens in your browser: sign in, choose the organization VS Code may read and select Allow.

  3. Ask a question, such as "What did we spend on AWS last month, by service?". Expand the tool call to see that the costfluent server answered.

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 VS Code's environment, so the file holds no token:

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

Run it on your machine

  1. Run costfluent mcp install --client copilot --write. It adds the server to ~/.copilot/mcp-config.json, or to mcp-config.json in COPILOT_HOME when that is set, the file VS Code reads for a server used across your workspaces.
  2. Set COSTFLUENT_API_TOKEN to the token in the environment VS Code starts from, and restart VS Code so it takes the variable up. Or set no variable and run costfluent login once: the server then uses that sign-in.
  3. Start a new agent session and ask a question, such as "What did we spend on AWS last month, by service?". Expand the tool call to see that the costfluent server answered.

How it behaves

  • The entry is yours rather than a project's: it reaches every workspace on this machine, and Copilot CLI reads the same one, connecting with the API token entry.
  • Signed in, VS Code gets the read tools alone. It is listed under Settings, Connected apps in Costfluent, where Revoke disconnects it.
  • The file holds no token. VS Code started from the Dock or the Start menu does not see your shell's variables: start it from a shell where the variable is set, or use the sign-in of costfluent login, which reads the one organization you approved and never offers the write tools.

costfluent mcp install --client vscode writes a project's .vscode/mcp.json with a token prompt instead. Only sessions on VS Code's Local harness receive that entry: the Copilot harness does not take a server that asks for its token. VS Code has deprecated the Local harness and removes it in February 2027.