VS Code with GitHub Copilot
VS Code with GitHub Copilot Integration Guide
This guide explains how to configure VS Code and GitHub Copilot to use the TomTom Traffic Analytics MCP Server for traffic analysis queries.
Prerequisites
- VS Code installed with the GitHub Copilot extension
- Node.js 22.9.0 or higher and TomTom API keys. See Quick Setup for details
Setup
-
Create or edit the file
.vscode/mcp.jsonin your workspace:1{2 "servers": {3 "tomtom-traffic-analytics": {4 "type": "stdio",5 "command": "npx",6 "args": ["-y", "@tomtom-org/tomtom-traffic-analytics-mcp@latest"],7 "env": {8 "TOMTOM_MOVE_PORTAL_KEY": "your_move_portal_key",9 "TOMTOM_API_KEY": "your_tomtom_developer_key"10 }11 }12 }13}Replace the API key values with your actual keys. Omit
TOMTOM_API_KEYif you only need junction, route, and area analytics tools.If you want to connect to a separately-running HTTP instance (see HTTP Transport), use this shape instead:
1{2 "servers": {3 "tomtom-traffic-analytics": {4 "type": "http",5 "url": "http://localhost:3000/mcp"6 }7 }8} -
Restart VS Code or reload the window (
Ctrl+Shift+P→ "Developer: Reload Window"). -
You can see the TomTom Traffic Analytics tools in the GitHub Copilot tools menu.
Test the Integration
Ask GitHub Copilot a traffic analytics question to verify the setup:
Which of my monitored routes have the highest delay percentage right now?
If configured correctly, Copilot will use the tomtom-route-search tool with a SQL query to calculate and rank route delays.
What to Try Next
Once the connection is working, try these prompts to explore what's possible:
Show me all active junctions and their countries
Analyze morning rush hour congestion in central Amsterdam over the past two weeks
Compare traffic incidents between downtown Amsterdam and Schiphol Airport area
For more workflows with full prompts and expected responses, see the Example Use Cases.
Using Environment Variables
To avoid hardcoding API keys in your workspace configuration, you can reference environment variables. Set them in your shell profile:
macOS / Linux:
export TOMTOM_MOVE_PORTAL_KEY="your_move_portal_key"export TOMTOM_API_KEY="your_tomtom_developer_key"
Windows (PowerShell):
$env:TOMTOM_MOVE_PORTAL_KEY="your_move_portal_key"$env:TOMTOM_API_KEY="your_tomtom_developer_key"
Then reference them in your mcp.json:
1{2 "servers": {3 "tomtom-traffic-analytics": {4 "type": "stdio",5 "command": "npx",6 "args": ["-y", "@tomtom-org/tomtom-traffic-analytics-mcp@latest"],7 "env": {8 "TOMTOM_MOVE_PORTAL_KEY": "${env:TOMTOM_MOVE_PORTAL_KEY}",9 "TOMTOM_API_KEY": "${env:TOMTOM_API_KEY}"10 }11 }12 }13}
Troubleshooting
| Problem | Possible Fix |
|---|---|
| Tools not appearing | Reload the VS Code window after saving mcp.json |
| Connection errors | Check the VS Code Output panel (select "MCP" from the dropdown) for detailed logs |
For other common issues, see Quick Setup > Common Issues.
Next Steps
- Example Use Cases: Full workflows with prompts and AI responses
- Which API key do I need?: Breakdown of which key each tool requires
- SQL Filtering: How the SQL-driven approach works under the hood