# VS Code (GitHub Copilot)

> Enable Trading Economics in GitHub Copilot's Agent mode in VS Code to query live economic data — indicators, markets, forecasts, and more — directly in your chat.

Source: https://docs.tradingeconomics.com/mcp/vscode/

Connect [GitHub Copilot's agent mode](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode) in VS Code to the hosted Trading Economics MCP server at `mcp.tradingeconomics.com`. VS Code authenticates via an OAuth 2.1 browser flow - you enter your API key once and VS Code caches the token automatically across sessions.

> **Agent mode required:** MCP tools are only available in **Agent** mode. Make sure to select it in the Copilot Chat input before querying.

### Requirements

- **VS Code 1.99+** - check at **Help > About**
- **GitHub Copilot extension** with an active subscription
- A **Trading Economics API key**. [Get a key here](https://tradingeconomics.com/api/pricing.aspx?source=mcp).

### Step 1 — Add the server to <code>.vscode/mcp.json</code>

Open (or create) `.vscode/mcp.json` in your workspace root and add the Trading Economics HTTP server entry:

```jsonc
{
  "servers": {
    "tradingeconomics": {
      "type": "http",
      "url": "https://mcp.tradingeconomics.com",
    },
  },
}
```

Save the file. VS Code detects the change and shows a **Start** button directly in the editor.

![VS Code showing the mcp.json file with the tradingeconomics HTTP server entry and a Start button](../stdio/vscode_copilot/flow_a/sc_001_http.png)

### Step 2 — Authorize via browser

Click the **Start** button in the editor (or open the Command Palette with `Ctrl+Shift+P` / `Cmd+Shift+P` and run **MCP: List Servers**, then click the start icon next to `tradingeconomics`).

VS Code shows a permission dialog asking to start the authentication flow - click **Allow**.

![VS Code dialog asking permission to start the MCP authentication flow](../stdio/vscode_copilot/flow_a/sc_002_a_http.png)

A second dialog asks permission to open the authorization page in your browser - click **Open**.

![VS Code dialog asking to open the Trading Economics authorization site in the browser](../stdio/vscode_copilot/flow_a/sc_002_b_http.png)

Your browser opens the Trading Economics authorization page. Enter your API key and click **Authorize**.

![Trading Economics authorization page in the browser asking for the API key](../stdio/vscode_copilot/flow_a/sc_002_c_http.png)

After authorizing, the browser shows a confirmation and asks permission to return to VS Code - click **Open Visual Studio Code** (or equivalent).

![Browser confirmation page asking to redirect back to VS Code after successful authorization](../stdio/vscode_copilot/flow_a/sc_002_d_http.png)

> **Note:** Your token is stored securely in VS Code's secret storage and reused across sessions - you won't need to repeat this step.

### Step 3 — Open Copilot Chat in Agent mode

Open Copilot Chat with `Ctrl+Alt+I` (Windows/Linux) or `Cmd+Alt+I` (macOS). At the bottom of the chat input, click the mode selector and choose **Agent**.

![Copilot Chat panel with the Agent mode selected in the mode selector](../stdio/vscode_copilot/flow_a/sc_003.png)

### Step 4 — Verify the server is active

Click the tools icon in the Copilot Chat toolbar to open the tools panel.

![Copilot Chat toolbar with the tools icon highlighted](../stdio/vscode_copilot/flow_a/sc_004.png)

In the tools panel, locate **tradingeconomics** and make sure its checkbox is checked. Click **OK** to confirm.

![Tools panel showing the tradingeconomics MCP server with its checkbox enabled](../stdio/vscode_copilot/flow_a/sc_005.png)

### Step 5 — Ask a question

Type a question in the chat. The first time a tool is invoked, Copilot will ask for permission to call the MCP server - click **Allow** (or **Always Allow** to skip future prompts).

![Copilot Chat asking for permission to call the tradingeconomics MCP tool](../stdio/vscode_copilot/flow_a/sc_006.png)

Copilot fetches the data from the Trading Economics API and renders the answer directly in the chat.

![Copilot Chat showing the final answer from the Trading Economics MCP server](../stdio/vscode_copilot/flow_a/sc_007.png)

Try these example prompts:

```text
What is the current inflation rate in the United States?
```

```text
Compare GDP growth between Brazil, China, and Germany.
```

```text
What economic events are scheduled for this week?
```

