Give GitHub Copilot economic data
GitHub Copilot can call Narwhal through MCP in VS Code or Copilot CLI, with read-only tools and one shared REST and MCP quota. VS Code can prompt for your key and store it securely. Copilot CLI writes the key into its configuration file, so keep that file private.
Quick start
- Get a free Narwhal key from https://narwhalapi.com/signup and keep it out of prompts and URLs.
- On Business or Enterprise, have an admin enable the MCP servers in Copilot policy before connecting.
- For VS Code, use version 1.99 or later and add the server configuration to
.vscode/mcp.json. - Start Narwhal through
MCP: List Serversand enter your key in the password prompt. - For Copilot CLI, use the separate add command and check the entry with
/mcp show narwhal.
MCP configuration
The VS Code configuration uses a servers object with an HTTP entry and a password input for the header. The separate CLI command registers the same hosted endpoint in Copilot CLI.
{
"inputs": [
{
"type": "promptString",
"id": "NARWHAL_API_KEY",
"description": "Narwhal API Bearer key",
"password": true
}
],
"servers": {
"narwhal": {
"type": "http",
"url": "https://api.narwhalapi.com/mcp",
"headers": {
"Authorization": "Bearer ${input:NARWHAL_API_KEY}"
}
}
}
}copilot mcp add --transport http \
--header "Authorization: Bearer YOUR_NARWHAL_API_KEY" \
narwhal https://api.narwhalapi.com/mcpVS Code asks for the key when the server first starts and stores it securely. The CLI writes the key to ~/.copilot/mcp-config.json; keep that file private and out of version control.
Tools you get
GitHub Copilot gets every read-only tool group through one Narwhal connection. Initialization and discovery use no quota, while each successful tool call uses one request from the allowance shared with REST.
| Group | What you can ask for | Tools |
|---|---|---|
| Economic indicators | Ask for CPI, inflation, unemployment, labour force participation, GDP, GDP growth and trade by country; coverage differs by indicator. | economics_get_cpi economics_get_inflation economics_get_unemployment economics_get_labour_force_participation economics_get_gdp economics_get_gdp_growth economics_get_trade economics_get_cpi_history economics_get_inflation_history economics_get_unemployment_history economics_get_labour_force_participation_history economics_get_gdp_history economics_get_gdp_growth_history economics_get_trade_history economics_read_series_observations |
| Currency rates | Ask for current exchange rates, historical rates, currency conversions and rate bars for a currency pair. | fx_get_rates fx_get_rate_history fx_convert_currency fx_get_rate_bars |
| Commodity prices | Ask for spot prices for gold, silver, platinum, palladium, copper, WTI crude oil, and Brent crude oil, their price history, and physical palm oil prices (crude palm oil and fresh fruit bunches). | commodities_get_spot_price commodities_get_price_history commodities_list_palmoil_physical_series commodities_get_palmoil_physical_price commodities_get_palmoil_physical_observations commodities_list_physical_series commodities_get_physical_series commodities_get_physical_latest commodities_get_physical_observations |
| Releases and events | Ask for official economic release dates and event details before you plan a country briefing. | economics_list_releases economics_get_release events_list events_get |
| Public holidays | Ask for public holidays by country, holidays on a particular date or the next holiday. | calendars_list_holidays calendars_get_holidays_on_date calendars_get_next_holiday |
| Prediction market odds | Ask for prediction market topics and events with scalar, extreme, timing and binary outcomes, their history, and policy paths by authority. | predictions_list_topics predictions_get_topic predictions_list_events predictions_get_scalar predictions_get_extreme predictions_get_timing predictions_get_binary predictions_get_scalar_history predictions_get_extreme_history predictions_get_timing_history predictions_get_binary_history predictions_get_policy_path predictions_get_policy_path_history |
| Government bond yields | Ask for government bond yield curves for the US, the UK, Germany, Japan, and Canada through the same Narwhal connection. | economics_get_yield_curve economics_get_yield_curve_history |
Example prompts
- Get the latest unemployment value for Germany.
- Show the available GBP/USD rate history.
- Get the available palm oil price history.
- Find the next public holiday in the United Kingdom.
- Get the latest GDP growth value for the United States.
Common workflows
Check Germany's latest GDP observation
For Germany's latest GDP observation, call the economics tool economics_get_gdp with Germany selected.
Review rates for a currency pair
GBP/USD history comes from fx_get_rate_history with GBP as the base and ["USD"] as the quote currencies list. Set start_date to 2026-09-08 and end_date to 2026-09-14.
Inspect palm oil data in Copilot
Which fresh fruit bunch series do you need? Select one through commodities_list_palmoil_physical_series, then supply its series ID to commodities_get_palmoil_physical_observations for prices by native period.
Plan around a UK public holiday
Supply the United Kingdom and a starting date to calendars_get_next_holiday to find the next published holiday on or after that date.
Tips
- Use an input of type
promptStringwith"password": truein VS Code and reference it as${input:NARWHAL_API_KEY}in the Authorization header. - Open
MCP: List Serversfrom the Command Palette to start, stop or restart Narwhal and inspect its output. - Check the CLI entry with
copilot mcp get narwhalif you need to inspect the registered server outside a session. - The Business and Enterprise MCP policy is off by default; Copilot Free, Pro, Pro+ and Max are not governed by it.
FAQ
How do I add Narwhal to GitHub Copilot in VS Code?
Create .vscode/mcp.json with an HTTP server entry, the Narwhal URL and an Authorization header backed by a password input. Start the server from MCP: List Servers and supply your key when VS Code asks.
Where does Copilot CLI store my Narwhal key?
Copilot CLI stores the key in ~/.copilot/mcp-config.json after the add command. Keep that file private and out of version control, and never paste the key into a prompt or URL.
Does Copilot need an admin to enable MCP?
Business and Enterprise require an admin to enable the MCP servers in Copilot policy. The policy is off by default and does not govern Copilot Free, Pro, Pro+ or Max.
Troubleshooting
| Symptom | Check |
|---|---|
| Narwhal does not show in VS Code | Check .vscode/mcp.json has a servers object and an entry with "type": "http", then open MCP: List Servers. |
A call returns 401 invalid_api_key | Check that the supplied key is active and the Authorization value includes Bearer followed by a space and the key. |
| MCP is blocked for a Business or Enterprise account | Have an admin check the MCP servers in Copilot policy and enable it for your account. |
| The CLI entry is missing or uses the wrong URL | Inspect it with copilot mcp get narwhal and use exactly https://api.narwhalapi.com/mcp without a trailing slash. |
Docs