CardAPI MCP server

Every planWorks on every plan; each tool returns what your plan includes.

The CardAPI MCP server lets an AI assistant look up credit cards while it answers: fees, welcome offers, reward rates by category, issuer application rules, transfer partners and point valuations. It runs on your machine, started by your MCP client (Claude Desktop, Claude Code, Cursor, VS Code and other clients that launch a command), and every tool call is one call to the CardAPI REST API on your own key, so you get the fields your plan includes and the call counts against your plan's quota.

Get a free key

A free key needs no credit card. Sign up, copy the key from the developer portal, and put it where your client starts the server, as the environment variable CARDAPI_API_KEY (the snippets below show where). The server needs Node 20 or later.

Sign up for a free key →

Claude Desktop

In Claude Desktop open Settings, then Developer, then Edit Config. That opens claude_desktop_config.json (on macOS in ~/Library/Application Support/Claude, on Windows in %APPDATA%\Claude). Add the block below, merging it into mcpServers if you already have one, save, and quit and reopen Claude Desktop.

{
  "mcpServers": {
    "cardapi": {
      "command": "npx",
      "args": ["-y", "@cardapi/mcp"],
      "env": { "CARDAPI_API_KEY": "YOUR_API_KEY" }
    }
  }
}

Claude Code

Run this in a terminal. Claude Code stores the key in its own configuration on your machine.

claude mcp add --env CARDAPI_API_KEY=YOUR_API_KEY --transport stdio cardapi -- npx -y @cardapi/mcp

Cursor

Put the block below in .cursor/mcp.json in your project, or in ~/.cursor/mcp.json to use it in every project, then restart Cursor.

{
  "mcpServers": {
    "cardapi": {
      "command": "npx",
      "args": ["-y", "@cardapi/mcp"],
      "env": { "CARDAPI_API_KEY": "YOUR_API_KEY" }
    }
  }
}

VS Code

VS Code's own MCP client reads .vscode/mcp.json. This version asks for the key the first time the server starts and keeps it out of the file.

{
  "inputs": [{ "type": "promptString", "id": "cardapi-key", "description": "CardAPI key", "password": true }],
  "servers": {
    "cardapi": {
      "command": "npx",
      "args": ["-y", "@cardapi/mcp"],
      "env": { "CARDAPI_API_KEY": "${input:cardapi-key}" }
    }
  }
}

VS Code with the Copilot harness

VS Code's documentation marks the editor-managed .vscode/mcp.json harness as deprecated. The Copilot harness reads ~/.copilot/mcp-config.json instead, which has no key prompt: it takes the key from the CARDAPI_API_KEY variable in the environment VS Code runs in.

{
  "mcpServers": {
    "cardapi": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "@cardapi/mcp"],
      "env": { "CARDAPI_API_KEY": "${CARDAPI_API_KEY}" },
      "tools": ["*"]
    }
  }
}

Any other MCP client

Any client that can start a local server over stdio takes the same four settings. To pin a version instead of taking the latest, write @cardapi/mcp@ and a version number from npm in place of @cardapi/mcp.

transport:    stdio
command:      npx
arguments:    -y @cardapi/mcp
environment:  CARDAPI_API_KEY=YOUR_API_KEY

# Windows, when the client cannot run npx directly:
command:      cmd
arguments:    /c npx -y @cardapi/mcp

Check that it works

Ask your assistant to run get_usage. It answers with your plan and how much of today's and this month's quota is used. Without a key the server still starts and lists its tools, but every call answers missing_api_key with the sign-up link.

Example prompts

  • “Which of my cards earns the most at Costco in Canada?”

    Name the cards you carry: CardAPI has no wallet of its own. The assistant looks each one up with search_cards and get_card, and can ask best_card_for_category for the rates that apply at wholesale clubs (merchant_class).

  • “What is the best no-annual-fee card for groceries in Canada?”

    list_categories for the category slug, then best_card_for_category with the country and no_annual_fee.

  • “Compare the Chase Sapphire Preferred and the Amex Gold side by side.”

    search_cards for each slug, then compare_cards.

  • “I have opened five cards in the last two years. Can I still get a Chase card?”

    get_application_rules, which holds issuer rules such as Chase 5/24.

  • “Which Aeroplan transfer bonuses are running right now?”

    get_transfer_bonuses, which needs the Pro plan.

Tools on every plan

  • search_cards

    Find credit cards by card or issuer name (US and Canada). Returns compact rows with each card's slug; results have no reward rates. Call get_card with a slug for fees, rates and benefits. Use list_cards to filter by issuer, fee or network instead of by name.

  • get_card

    Get one credit card by slug (for example american-express-gold-card): annual fee, welcome offer, reward rates and the other fields your CardAPI plan includes. Fields above your plan are left out, and `note` says which. An unknown slug returns an error with suggested slugs.

  • list_cards

    List credit cards that match filters: country, issuer slug (from list_issuers), network, card type, maximum annual fee, no annual fee, credit score. Compact rows; call get_card for detail. Narrow with filters instead of paging; at most 50 per call.

  • best_card_for_category

    Rank credit cards by reward rate for one spending category (for example groceries, dining, gas, travel; slugs from list_categories). Each result has the matching rate, and any cap, in category_rate. Rates limited to one merchant, to the issuer's travel portal, to a pick-your-category choice, or to a time window (an introductory or welcome-offer rate, a rate ending within 12 months) are left out unless include_restricted is true. Only the current quarter's rotating rates count.

  • compare_cards

    Compare 2 to 5 credit cards side by side, in the order given, using their slugs. Returns each card with the fields your plan includes. An unknown slug returns an error that names it.

  • list_categories

    List the spending category slugs that best_card_for_category accepts, with their parent categories. Call this when unsure which slug to use.

  • list_issuers

    List card issuers (banks) with their slugs and card counts, optionally for one country, or get one issuer by slug. Use the slug in list_cards, get_application_rules and get_product_changes.

  • get_application_rules

    Get issuer application rules, such as Chase 5/24 or Amex once-per-lifetime welcome offers, for one issuer or all of them. Use before recommending a card the user may not be approved for or eligible to earn a bonus on.

  • get_reward_valuations

    Get cents-per-point valuations for reward currencies (cash, travel portal, transfer, recommended). Use to compare points cards with cash-back cards. Optionally filter by currency name or code.

  • get_product_changes

    Get known product-change (upgrade/downgrade) paths between cards of one issuer. Coverage is limited: a path appears only when the issuer's page names it, so an empty result does not mean no change is possible.

  • get_usage

    Get this CardAPI key's plan and how many API calls the account has used today and this month against its limits. Every other tool uses one call (get_card_benefits uses two).

Starter plan and above

  • get_card_benefits

    Get a card's statement credits and companion perks (Starter plan or higher). Makes two API calls. Lower plans get an error with an upgrade link.

Pro plan and above

  • get_transfer_partners

    Get airline and hotel transfer partners and ratios for a points program (currency code such as MR, UR, TYP, C1) or for one card (card_slug). Pro plan or higher.

  • get_transfer_bonuses

    Get confirmed transfer bonuses: the ones running now by default, or upcoming, ended or all with status. Each row names the program, the partner, the bonus, when it starts and ends, and whether only some members get it. Filter by program (currency), partner or country. Pro plan or higher. An empty list means no confirmed bonus matches, not that none exists: bonuses are confirmed by hand.

  • get_offer_changes

    Get recent notable welcome-offer and annual-fee changes across cards (optionally for one country), or the offer history of one card (card_slug). Pro plan or higher.

  • get_card_history

    Get the change history of one card's tracked fields, newest first. Pro plan or higher.

Prompts

  • recommend_card

    Recommend the best credit card for a spending profile, using live CardAPI data. Takes spending and country (optional: max_annual_fee).

  • compare_my_cards

    Look up credit cards by name and compare them side by side. Takes cards.

Plans and limits

The server has no plan of its own: your key's plan decides which fields a card has and which tools work. A tool for a higher plan answers with an error that names the plan it needs and links to /pricing, and nothing else is tried in its place. Each tool call uses one API call from your daily and monthly quota (get_card_benefits uses two), and one question can lead to several tool calls, so keep an eye on get_usage on a Free key.

Plans and the fields each returns →

Calls per plan

PlanDailyMonthly
Free100 calls/day3,000 calls/month
Starter500 calls/day15,000 calls/month
Pro2,000 calls/day50,000 calls/month
Enterprise20,000 calls/day500,000 calls/month

Your key and your data

The server runs on your machine, started by your MCP client, and your key stays there. It is read from CARDAPI_API_KEY and sent only to api.cardapi.dev, in the Authorization header of each request. The server never logs the key, writes nothing to disk and caches nothing. CARDAPI_BASE_URL, which must be https or on localhost, exists only to point the server at a local API.

CardAPI sees what any API call shows: the request your assistant makes (a card slug, a category, a filter), plus a User-Agent and an X-CardAPI-Client header naming the server and its version. Errors use the API's own codes: see /docs/errors.

Pass the key through your client's environment or secret store, and don't commit a config that contains it. If a key leaks, revoke it and make a new one in the developer portal at /portal.

Errors →Developer portal →

If it does not start

Check that node --version prints 20 or later, then run npx -y @cardapi/mcp --version in a terminal: it prints the version. Restart the client after changing its configuration. A client that cannot find npx (common on Windows) needs the cmd form shown under Any other MCP client. If a tool answers missing_api_key, the client did not pass CARDAPI_API_KEY to the server.

Related

Re-checked against issuer sites every Friday · last change Dec 6