# AI agents & MCP

The MCP server, llms.txt, the OpenAPI spec and the AI companion kit for Cursor, Claude Code and Codex: how AI agents and coding assistants read fund data.

HTML version: https://fundfactsapi.com/docs/ai-agents · Updated 2026-10-25

## MCP server

The complete MCP guide (every tool with its inputs and cost, the cards, setup for each client, sign-in, billing, privacy and troubleshooting) is at https://fundfactsapi.com/docs/mcp. The essentials:

FundFacts runs a remote Model Context Protocol server over Streamable HTTP at `https://fundfactsapi.com/api/mcp`. It exposes ten tools: the seven tools `get_fund`, `search_funds`, `compare_funds`, `analyze_portfolio`, `fund_overlap`, `get_scpi`, `search_scpi` read data and behave exactly like the REST endpoints and count the same requests; `watch_fund`, `unwatch_fund`, `my_watched_funds` keep the account's watchlist (webhooks and the change feed cover it on Starter and Pro), not counted. Each fund's `data.documents` gives the issuer's own KID, factsheet and page links; quote them as the source of a figure. Authentication is your API key as an `Authorization: Bearer` header, or, for connectors without a header field, a sign-in with your FundFacts account (OAuth 2.1, PKCE). Any MCP client that supports remote servers can use it: Claude Code, Cursor, VS Code, claude.ai and Claude Desktop, ChatGPT in developer mode, or your own agent. New users can ask what FundFacts does, or pick the server's `tour` prompt, for a short explanation and a live example: `get_fund` on the example fund `IE00B4L5Y983` (iShares Core MSCI World UCITS ETF), which is not counted as a request.

Claude Code:

```bash
claude mcp add --transport http fundfacts https://fundfactsapi.com/api/mcp
```

Then run `/mcp` in a Claude Code session and sign in with your FundFacts account. To use an API key instead, add `--header "Authorization: Bearer ffk_your_api_key"` to the command, or use the `.mcp.json` entry below.

Or install the FundFacts plugin, which adds the server together with skills that tell Claude Code how to read the fund data: `/plugin marketplace add fundfactsapi/fundfacts-plugin`, then `/plugin install fundfacts@fundfacts`, then `/mcp` to sign in.

Cursor / VS Code / Claude Code (`.mcp.json`; Windsurf uses the same shape with `serverUrl` instead of `url`):

```json
{
  "mcpServers": {
    "fundfacts": {
      "url": "https://fundfactsapi.com/api/mcp",
      "headers": {
        "Authorization": "Bearer ffk_your_api_key"
      }
    }
  }
}
```

- claude.ai and Claude Desktop: Customize → Connectors → Add custom connector (Team and Enterprise: an Owner adds it under Organization settings → Connectors; the Free plan allows one custom connector). Remote MCP server URL `https://fundfactsapi.com/api/mcp`; leave the advanced OAuth client fields empty (the client registers itself), click Connect and sign in with your FundFacts account when the consent screen opens.
- ChatGPT, in developer mode (Plus, Pro, Business, Enterprise and Edu, on the web): Settings → Security and login → turn Developer mode on, then Plugins (chatgpt.com/plugins) → +, enter a name and the same URL, `https://fundfactsapi.com/api/mcp`, with Authentication set to OAuth, click Create and sign in. ChatGPT cannot send an API key, so it signs in the same way.
- In ChatGPT and in Claude on the web and desktop, tool results also render as cards (fund, comparison, portfolio look-through, overlap, SCPI) next to the answer. Each connection shows up in the dashboard (https://fundfactsapi.com/dashboard) under its app name, uses the same plan and quota as an API key and can be disconnected there; header auth stays the recommended form for code and CLIs. OAuth tokens only work on the MCP server, never on the REST API.
- Clients that only speak stdio can bridge with `npx -y mcp-remote https://fundfactsapi.com/api/mcp --header "Authorization: Bearer ffk_..."`.

## Machine-readable entry points

| URL | What it is |
|---|---|
| [/openapi.json](https://fundfactsapi.com/openapi.json) | OpenAPI 3.1 for every endpoint, with the full FundData schema. Also /openapi.yaml. |
| [/llms.txt](https://fundfactsapi.com/llms.txt) | Index of the documentation and content pages, in the llms.txt format read by answer engines. |
| [/llms-full.txt](https://fundfactsapi.com/llms-full.txt) | The whole reference in one Markdown file: endpoints, quota, every field, the rules for agents, recipes, plans, MCP and the glossary. |
| [/api/v1/demo/funds/{isin}](https://fundfactsapi.com/api/v1/demo/funds/IE00B4L5Y983) | A real payload without a key, for an agent to verify the shape. |

## AI companion kit

Every paid plan (from Starter at $9.99) includes a kit generated from the field reference on every download from the AI tab of your dashboard (https://fundfactsapi.com/dashboard?tab=ai), with your plan and — optionally — a dedicated key baked in. Drop the files at the root of the project your coding agent works in and ask for the tool you want; the agent reads them before it writes code.

- `AGENTS.md`: the endpoints, envelope and every field with its meaning, your plan's request allowance and the quota headers, freshness and timeout rules, error handling, a reference client in TypeScript and Python, and recipes (comparison table, portfolio look-through, screener, factsheet page, change monitor, export). Read by Cursor, Claude Code, Codex, Copilot and Windsurf.
- `.cursor/rules/fundfacts-api.mdc` and `.claude/skills/fundfacts-api/SKILL.md`: the same rules in the native Cursor and Claude Code formats, attached whenever an ISIN, fund or factsheet comes up.
- `openapi.yaml` and `fundfacts.d.ts` with typed `FundResponse`, `FundData`, `BatchResponse`, `PortfolioResponse` and `OverlapResponse` declarations.

The public edition of `AGENTS.md` — without a key or plan — is https://fundfactsapi.com/llms-full.txt.

Full reference: https://fundfactsapi.com/llms-full.txt
