AI agents & LLMs

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.Published September 12, 2026 · Updated October 13, 2026 · by FundFacts API

Short 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 seven 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, Starter and above), fund_overlap (shared holdings between funds, Starter and above), get_scpi (French SCPI data by name or ISIN) and search_scpi (SCPI name → matches, free), plus a tour prompt that explains the service on the example fund IE00B4L5Y983, which is not counted. Every tool only reads data. Authentication is either your FundFacts account (OAuth 2.1 with PKCE, the sign-in the claude.ai, Claude Desktop and ChatGPT connectors run) or the same bearer API key as the REST API, sent as an Authorization header by editors, CLIs and frameworks. The MCP server guide has the full tool reference, setup for every client and troubleshooting.

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 fund found; 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.
bash
curl -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]}'

Frequently asked questions

Do I need a credit card to try it?

No. The Free plan is 5 lookups per month with no card; sign up with an e-mail address or Google and the key is shown in the dashboard.

Which ISINs work?

Any share class of a UCITS fund, ETF, money-market fund or open-end fund whose management company publishes a product page, factsheet and KID. Each share class has its own ISIN and is looked up on its own. Stocks, bonds and indices are not funds and return 404 fund_not_found.

Try it on your own ISINs

One request returns key facts, holdings, risk and performance as JSON. Free plan, no card.