How do I use FundFacts API with GitHub Copilot in VS Code?
Register the FundFacts MCP server in .vscode/mcp.json so Copilot agent mode can call get_fund and search_funds, and add copilot-instructions.md so it writes correct code against the API.Updated 12 September 2026 · by FundFacts APIShort answer
Create .vscode/mcp.json with a server entry for https://fundfactsapi.com/api/mcp (type "http") and an Authorization header read from an input prompt or environment variable; Copilot agent mode then lists get_fund, search_funds, compare_funds, analyze_portfolio, fund_overlap and get_scpi as tools. Add the API rules from AGENTS.md to .github/copilot-instructions.md so generated code caches by ISIN, uses 300-second timeouts and never exposes the key.
MCP server for agent mode
json{"inputs": [{ "id": "fundfacts-key", "type": "promptString", "description": "FundFacts API key", "password": true }],"servers": {"fundfacts": {"type": "http","url": "https://fundfactsapi.com/api/mcp","headers": { "Authorization": "Bearer ${input:fundfacts-key}" }}}}
Save as .vscode/mcp.json, start the server from the Copilot chat tools menu, and the tools appear in agent mode. The MCP server exposes six tools, each counted like the REST endpoint it wraps: get_fund (ISIN → the full factsheet payload), search_funds (name → ISINs, free), compare_funds (side-by-side table for several ISINs), analyze_portfolio (weighted look-through of a list of positions, Pro and above), fund_overlap (shared holdings between funds, Pro and above) and get_scpi (French SCPI data by name or ISIN). Authentication is the same bearer API key as the REST API, sent as an Authorization header.
Instructions for generated code
Copilot reads .github/copilot-instructions.md. A short version of the API rules keeps generated code correct:
markdown# FundFacts API- Base URL https://fundfactsapi.com/api/v1; header Authorization: Bearer $FUNDFACTS_API_KEY (from env, never in source).- GET /funds/{isin} returns { isin, name, cached, expiresAt, data }. Cache by ISIN until expiresAt.- First load of a cold ISIN can take up to 300 s: set that timeout, show a loading state.- One request per ISIN answered; read X-RateLimit-Remaining; on 429 wait Retry-After.- 404 fund_not_found = not a fund / not covered; do not retry 4xx; retry 502 at most twice.- Display data.dataAsOf next to any figure. Empty fields mean "not disclosed", not zero.- Full reference: https://fundfactsapi.com/llms-full.txt
The full AGENTS.md from the kit can sit in the repository too; Copilot picks up context from open files.
Paid plans include an AI companion kit generated from the live field reference: an AGENTS.md with every endpoint, field, rule and a reference client; a Cursor rule; a Claude Code skill; the OpenAPI spec and TypeScript types, with your key baked in or read from an environment variable. Download it from the dashboard; the public edition without a key is at /llms-full.txt.
Verify it yourself
The demo endpoint returns the live payload for a fund that is already in the store, without a key. Everything on this page can be checked against it.bashcurl -s https://fundfactsapi.com/api/v1/demo/funds/IE00B4L5Y983 | jq '{name, asOf: .data.dataAsOf, ter: .data.headlineMetrics.ter, risk: .data.riskRating, top: .data.topHoldings[:3]}'