Ternary MCP for VS Code

This guide connects Visual Studio Code to your Ternary data. When you finish, you can ask Copilot in agent mode questions like "what did we spend on BigQuery last quarter, by project?" and it answers from your live billing data.

MCP support lives in VS Code itself, not in the Copilot extension, so these steps also apply to any other VS Code feature that consumes MCP servers.

Requirements

  • A Ternary account (the email you use to sign in to Ternary).
  • VS Code 1.106 or later. Earlier versions support MCP but not the sign-in method Ternary uses, so 1.102 to 1.105 will ask you to supply a client ID by hand. Run Code → Check for Updates if you are unsure.
  • GitHub Copilot with agent mode. On a Copilot Business or Enterprise plan, an administrator must enable the MCP servers in Copilot policy for your organization. See Troubleshooting if the server never appears.

Add the server

  1. Open the Command Palette (Ctrl+Shift+P, or Cmd+Shift+P on macOS) and run MCP: Add Server.
  2. Choose HTTP as the server type.
  3. Enter your region's server URL:
    • US: https://core-api.ternary.app/mcp
    • EU: https://core-api.eu.ternary.app/mcp
  4. Name the server ternary.
  5. Choose whether to save it for this workspace (.vscode/mcp.json, shared with anyone who opens the repo) or for your user profile (available in every workspace).

VS Code writes a file like this:

{
  "servers": {
    "ternary": {
      "type": "http",
      "url": "https://core-api.ternary.app/mcp"
    }
  }
}

You can also create that file by hand instead of using the Command Palette.

Leave out any oauth block. VS Code discovers the login configuration from the server, so there is no client ID or secret to enter.

Sign in

  1. Start the server: open the Command Palette, run MCP: List Servers, pick ternary, then Start Server. VS Code also starts it the first time an agent needs it.
  2. VS Code opens a Ternary sign-in page in your browser. Log in with your Ternary credentials and approve the access request.
  3. The browser hands the session back to VS Code. MCP: List Servers now shows ternary as running.

The sign-in is remembered, so day-to-day use does not prompt again.

Use it in Copilot Chat

  1. Open Copilot Chat and switch the mode selector to Agent.
  2. Click the tools icon above the chat box and confirm the Ternary tools are enabled.
  3. Ask a cost question, for example: "Using Ternary, which tenants can I access? Then show my top 5 services by spend for last month."
  4. The first time an agent runs a Ternary tool, VS Code asks for confirmation. All Ternary tools are read-only, so Always Allow is safe.

Good first prompts:

  • "Which Ternary tenants can I access?"
  • "Show my total cloud spend for last month, grouped by service."
  • "List my saved reports and summarize the one named Monthly Executive Summary."

Troubleshooting

❗️

Use the URL exactly as written, with no trailing slash

https://core-api.ternary.app/mcp works. https://core-api.ternary.app/mcp/ is redirected, but some clients treat the two spellings as different servers, so copy the URL exactly.

  • VS Code asks you to enter a client ID by hand — the message mentions dynamic client registration not being supported. You are on a version older than 1.106. Cancel the dialog and run Code → Check for Updates; do not enter anything.
  • MCP features are missing entirely — your organization's GitHub Copilot policy may disable them. Ask your Copilot administrator to enable MCP servers in Copilot.
  • VS Code refuses to add the server — your organization may restrict which MCP servers are allowed, through the chat.mcp.access policy or an allowlist. If that policy is set to registry, Ternary has to be published in your organization's MCP registry before VS Code will load it. Your IT team owns both settings.
  • Sign-in fails or loops — your email must belong to an existing Ternary user in that region. US and EU are separate: a US account cannot authenticate against the EU URL, and vice versa.
  • "No tenants found" — your Ternary user has no explicit role on any tenant. Ask your Ternary admin to grant you a role on the tenants you need.
  • The agent ignores Ternary — check the tools icon shows the Ternary tools enabled, make sure the mode is Agent and not Ask, and name Ternary in the question.

Did this page help you?