rightcard-mcp 0.1.25 → 0.1.26

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,11 +1,13 @@
1
1
  # RightCard MCP
2
2
 
3
- [![npm](https://img.shields.io/npm/v/rightcard-mcp)](https://www.npmjs.com/package/rightcard-mcp)
3
+ [![npm](https://img.shields.io/npm/v/rightcard-mcp)](https://www.npmjs.com/package/rightcard-mcp) [![rightcard/rightcard-mcp MCP server](https://glama.ai/mcp/servers/rightcard/rightcard-mcp/badges/score.svg)](https://glama.ai/mcp/servers/rightcard/rightcard-mcp)
4
4
 
5
5
  The card-selection oracle for agents: **which of your credit cards should pay here?**
6
6
  Answers come from RightCard's bank-published, two-source-verified reward data — the same
7
7
  data the [RightCard iOS app](https://apps.apple.com/app/id6756834989) uses.
8
8
 
9
+ Website and setup guide: [rightcard.ai/mcp](https://rightcard.ai/mcp). How each point program is valued, with the sources: [rightcard.ai/point-values](https://rightcard.ai/point-values).
10
+
9
11
  - **No bank login. No account. Nothing stored.** You pass card ids and a store name; you get an answer.
10
12
  - Honest by construction: merchant-code caveats (Costco is a warehouse club, so the grocery bonus
11
13
  won't post), rotating quarters with activation flags, ties named, points valued per program.
@@ -20,7 +20,8 @@ export const CONFIGURABLE_SPECS = [
20
20
  // Nov 16 2026: Amex took airfare off the 4X list and added transit (mirrors Swift).
21
21
  eligible: ["dining", "gas", "transit"],
22
22
  note: "4× on the 2 categories your business spends the most on each billing cycle (restaurants, gas, transit, wireless phone service, advertising and select electronics and software), on your first $150,000 of purchases a year (1× after). Amex picks them from your spending. So RightCard can show the bonus, pick the up-to-2 you expect: restaurants, gas, or transit.",
23
- matchNeedles: ["businessgold"], multiCardMax: 1,
23
+ // US card only: the UK and Canadian Business Gold cards have no top-2 picker.
24
+ matchNeedles: [], exactIDs: ["american_express_american_express_business_gold_card"], multiCardMax: 1,
24
25
  },
25
26
  {
26
27
  key: "bofa_business_customized", displayName: "BofA Business Advantage Customized Cash", bonusRate: 3, slots: 1,
package/dist/matching.js CHANGED
@@ -126,5 +126,20 @@ export function merchantMatchesCoBrandBenefit(benefit, query) {
126
126
  return false;
127
127
  if (![...b].some((x) => q.has(x) && !COBRAND_PLACE_WORDS.has(x)))
128
128
  return false;
129
- return isSubset(q, b);
129
+ if (!isSubset(q, b))
130
+ return false;
131
+ // Nov 26 2026 (mirrors Swift): a store covering only part of the benefit's name
132
+ // that adds a short word of its own is a different business ("United Way" is
133
+ // not United Airlines, "ABF Freight" is not Harbor Freight, "At Home" is not
134
+ // Home Depot).
135
+ if (q.size < b.size) {
136
+ const short = (s) => new Set(s.toLowerCase().split(/[^\p{L}\p{N}]+/u)
137
+ .filter((t) => t.length > 0 && t.length <= 3 && /^\p{L}+$/u.test(t)));
138
+ const bs = short(benefit);
139
+ for (const w of short(query))
140
+ if (!bs.has(w) && !COBRAND_FILLER.has(w))
141
+ return false;
142
+ }
143
+ return true;
130
144
  }
145
+ const COBRAND_FILLER = new Set(["the", "by", "and", "of", "a", "an", "de", "du", "la", "le", "el", "los", "las", "y", "e", "n"]);
package/dist/model.js CHANGED
@@ -128,6 +128,9 @@ export function standingCaps(cardId) {
128
128
  return [{ id: "grocery", categories: ["grocery"], limit: 6000, period: "calendarYear", after: 1 },
129
129
  { id: "online", categories: ["online"], limit: 6000, period: "calendarYear", after: 1 },
130
130
  { id: "gas", categories: ["gas"], limit: 6000, period: "calendarYear", after: 1 }];
131
+ case "usaa_usaa_cashback_rewards_plus_american_express_card":
132
+ return [{ id: "gas", categories: ["gas"], limit: 3000, period: "calendarYear", after: 1 },
133
+ { id: "grocery", categories: ["grocery"], limit: 3000, period: "calendarYear", after: 1 }];
131
134
  case "amex_blue_cash_preferred":
132
135
  return [{ id: "grocery", categories: ["grocery"], limit: 6000, period: "calendarYear", after: 1 }];
133
136
  case "american_express_blue_business_cash_card_from_american_express":
@@ -141,6 +144,9 @@ export function standingCaps(cardId) {
141
144
  case "citi_costco_anywhere":
142
145
  case "citi_costco_anywhere_visa_business_card_by_citi":
143
146
  return [{ id: "gas", categories: ["gas"], limit: 7000, period: "calendarYear", after: 1 }];
147
+ case "chase_marriott_bonvoy_bountiful_credit_card":
148
+ case "american_express_marriott_bonvoy_bevy_american_express_card":
149
+ return [{ id: "combined", categories: ["grocery", "dining"], limit: 15000, period: "calendarYear", after: 2 }];
144
150
  case "marriott_boundless":
145
151
  return [{ id: "combined", categories: ["grocery", "gas", "dining"], limit: 6000, period: "cardYear", after: 2 }];
146
152
  case "southwest_plus":
package/dist/search.d.ts CHANGED
@@ -10,10 +10,13 @@ export interface SearchForms {
10
10
  norm: string;
11
11
  compact: string;
12
12
  body: string;
13
+ bodyWords: string[];
13
14
  }
14
15
  /** Merchant.droppingWebEnding: "emirates.com" → "emirates". Anything with a space comes back unchanged. */
15
16
  export declare function droppingWebEnding(raw: string): string;
16
17
  export declare const searchForms: (raw: string) => SearchForms;
18
+ /** Merchant.endsAGluedWord(_:body:words:) */
19
+ export declare function endsAGluedWord(q: string, body: string, words: string[]): boolean;
17
20
  /** Merchant.matchScore(queryNorm:queryCompact:rawQuery:candidates:) */
18
21
  export declare function matchScore(q: string, qc: string, rawQuery: string, candidates: SearchForms[]): number | null;
19
22
  export interface IndexEntry {
package/dist/search.js CHANGED
@@ -82,8 +82,28 @@ export function droppingWebEnding(raw) {
82
82
  }
83
83
  export const searchForms = (raw) => {
84
84
  const norm = searchNormalized(raw);
85
- return { raw, norm, compact: compactForm(norm), body: searchNormalized(droppingWebEnding(raw)) };
85
+ const host = droppingWebEnding(raw);
86
+ const body = searchNormalized(host);
87
+ // Each part of a dotted web address is a word too ("itunes.apple.com"):
88
+ // normalizing glues the dots away. Mirrors SearchForms.bodyWords.
89
+ const words = body.split(" ").filter((w) => w.length > 0);
90
+ if (!host.includes(" ") && host.includes(".")) {
91
+ for (const p of host.split(".")) {
92
+ const w = searchNormalized(p);
93
+ if (w.length > 0)
94
+ words.push(w);
95
+ }
96
+ }
97
+ return { raw, norm, compact: compactForm(norm), body, bodyWords: words };
86
98
  };
99
+ /** Merchant.endsAGluedWord(_:body:words:) */
100
+ export function endsAGluedWord(q, body, words) {
101
+ if (q.includes(" "))
102
+ return body.includes(q);
103
+ const ql = [...q].length;
104
+ return words.some((w) => w.endsWith(q)
105
+ || ([...w].length > ql && w.endsWith("s") && w.slice(0, -1).endsWith(q)));
106
+ }
87
107
  /** Merchant.matchScore(queryNorm:queryCompact:rawQuery:candidates:) */
88
108
  export function matchScore(q, qc, rawQuery, candidates) {
89
109
  if ([...q].length < 2)
@@ -114,7 +134,10 @@ export function matchScore(q, qc, rawQuery, candidates) {
114
134
  // (user report, Sep 17 2026). Mirrors Merchant.matchScore in the app.
115
135
  // The mid-word tier reads the name without its web ending, so "tesco"
116
136
  // can't match inside "emiratesCOm" (Oct 26 2026).
117
- if ([...q].length >= 4 && c.body.includes(q))
137
+ // Inside a word, a single-word query must END that word (plural "s"
138
+ // allowed): a glued name's last part ("disney" in "shopdisney"). "amaz"
139
+ // listed "Mamazzita Ecuadorian Cuisine" among the Amazon rows (Nov 25 2026).
140
+ if ([...q].length >= 4 && endsAGluedWord(q, c.body, c.bodyWords))
118
141
  best = Math.max(best, 55);
119
142
  if (best < 45 && merchantMatches(c.raw, rawQuery))
120
143
  best = Math.max(best, 45);
package/dist/tools.js CHANGED
@@ -63,6 +63,12 @@ function shapeAnswer(r, merchant, mode, unverified) {
63
63
  subcategory_split: r.subcategoryBreakdown, caveats, privacy: PRIVACY,
64
64
  };
65
65
  }
66
+ // Every tool only reads RightCard's public card catalog: nothing is written,
67
+ // nothing depends on the caller's accounts, and the same question gives the
68
+ // same answer. Directories (Claude's included) require these hints.
69
+ const READ_ONLY = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
70
+ // The directory reads the human name from annotations.title, so each tool repeats its title there.
71
+ const readOnly = (title) => ({ ...READ_ONLY, title });
66
72
  export function buildServer(getCatalog) {
67
73
  const server = new McpServer({ name: "rightcard", version: "0.1.0" }, {
68
74
  instructions: "RightCard answers 'which of these credit cards should pay here?' from bank-published, two-source-verified reward data. " +
@@ -71,6 +77,7 @@ export function buildServer(getCatalog) {
71
77
  });
72
78
  server.registerTool("best_card", {
73
79
  title: "Best card for a store or category",
80
+ annotations: readOnly("Best card for a store or category"),
74
81
  description: "Which of the given cards earns the most at a store (merchant) or for a spend category, today. Returns the card, the honest rate, why, and caveats (merchant-code traps, activation, ties). Base rates + rotating bonuses + built-in card benefits only; a user's personal bank offers live on their phone and are not consulted here.",
75
82
  inputSchema: {
76
83
  wallet: z.array(z.string()).min(1).describe("Card ids the person holds (from search_cards)."),
@@ -115,6 +122,7 @@ export function buildServer(getCatalog) {
115
122
  });
116
123
  server.registerTool("lookup_merchant", {
117
124
  title: "How a store is coded",
125
+ annotations: readOnly("How a store is coded"),
118
126
  description: "The store's reward category as RightCard's directory files it, its merchant type, and the merchant-code caveat when a category bonus usually will not post there (superstores like Walmart/Target, warehouse clubs like Costco/Sam's). Same ranking the app uses.",
119
127
  inputSchema: { name: z.string().min(2) },
120
128
  }, async ({ name }) => {
@@ -131,6 +139,7 @@ export function buildServer(getCatalog) {
131
139
  });
132
140
  server.registerTool("search_cards", {
133
141
  title: "Find card ids",
142
+ annotations: readOnly("Find card ids"),
134
143
  description: "Search RightCard's catalog by card or issuer name to get the ids to pass into best_card. Verified cards first; unverified cards are flagged, never hidden.",
135
144
  inputSchema: { query: z.string().min(2), issuer: z.string().optional(), limit: z.number().int().min(1).max(50).default(12) },
136
145
  }, async ({ query, issuer, limit }) => {
@@ -149,6 +158,7 @@ export function buildServer(getCatalog) {
149
158
  });
150
159
  server.registerTool("card", {
151
160
  title: "A card's verified rates",
161
+ annotations: readOnly("A card's verified rates"),
152
162
  description: "Everything RightCard knows about one card: rates by category, base rate, currency, annual fee, verification status, live rotating windows, and the choose-your-category spec if it has one.",
153
163
  inputSchema: { id: z.string() },
154
164
  }, async ({ id }) => {
@@ -179,6 +189,7 @@ export function buildServer(getCatalog) {
179
189
  });
180
190
  server.registerTool("rotating_calendar", {
181
191
  title: "Rotating 5% windows",
192
+ annotations: readOnly("Rotating 5% windows"),
182
193
  description: "Live and upcoming rotating-category windows (Freedom Flex, Discover it, Citi Dividend…) and permanent merchant benefits, from the same verified data as the app. Optionally filter by card id.",
183
194
  inputSchema: { card_id: z.string().optional() },
184
195
  }, async ({ card_id }) => {
@@ -197,7 +208,7 @@ export function buildServer(getCatalog) {
197
208
  return { contents: [{ uri: uri.href, mimeType: "application/json", text: JSON.stringify(catalog.cards.map(cardSummary)) }] };
198
209
  });
199
210
  server.registerResource("valuation", "rightcard://valuation", { title: "How points are valued", mimeType: "application/json" }, async (uri) => ({
200
- contents: [{ uri: uri.href, mimeType: "application/json", text: JSON.stringify({ mode_cash: "each point = min(1¢, its points value)", mode_points_travel_cents_per_point: TRAVEL_CPP, source: "Conservative blended baselines (The Points Guy, Bankrate, Frequent Miler), Q2 2026." }) }],
211
+ contents: [{ uri: uri.href, mimeType: "application/json", text: JSON.stringify({ mode_cash: "each point = min(1¢, its points value)", mode_points_travel_cents_per_point: TRAVEL_CPP, source: "The middle of four published values (The Points Guy, Frequent Miler, Upgraded Points, One Mile at a Time), rounded down. Sources and dates: https://rightcard.ai/point-values" }) }],
201
212
  }));
202
213
  server.registerPrompt("which-card", {
203
214
  title: "Which card should I use here?",
@@ -1,6 +1,6 @@
1
1
  import type { CreditCard } from "./model.js";
2
2
  export type ValuationMode = "cash" | "smart";
3
- export type RewardProgram = "cash" | "amexMR" | "chaseUR" | "capOneMiles" | "citiTYP" | "wellsFargo" | "bilt" | "tdRewards" | "scenePlus" | "rbcAvion" | "bmoRewards" | "hyatt" | "marriott" | "ihg" | "choice" | "wyndham" | "hilton" | "delta" | "united" | "american" | "southwest" | "jetBlue" | "alaska" | "avios" | "aeroplan" | "fixedValue" | "genericPoints" | "genericMiles";
3
+ export type RewardProgram = "cash" | "amexMR" | "chaseUR" | "capOneMiles" | "citiTYP" | "wellsFargo" | "bilt" | "tdRewards" | "scenePlus" | "rbcAvion" | "bmoRewards" | "hyatt" | "marriott" | "ihg" | "choice" | "wyndham" | "hilton" | "delta" | "united" | "american" | "southwest" | "jetBlue" | "alaska" | "avios" | "aeroplan" | "flyingBlue" | "lufthansa" | "cathay" | "koreanAir" | "lifemiles" | "turkish" | "virginRed" | "frontier" | "bestWestern" | "fixedValue" | "genericPoints" | "genericMiles";
4
4
  export declare const PROGRAM_DISPLAY: Record<RewardProgram, string>;
5
5
  export declare const TRAVEL_CPP: Record<RewardProgram, number>;
6
6
  /** RewardProgram.cashOutCPP */
package/dist/valuation.js CHANGED
@@ -6,6 +6,9 @@ export const PROGRAM_DISPLAY = {
6
6
  hilton: "Hilton Honors", delta: "Delta SkyMiles", united: "United MileagePlus",
7
7
  american: "American AAdvantage", southwest: "Southwest Rapid Rewards", jetBlue: "JetBlue TrueBlue",
8
8
  alaska: "Atmos Rewards", avios: "British Airways Avios", aeroplan: "Air Canada Aeroplan",
9
+ flyingBlue: "Air France-KLM Flying Blue", lufthansa: "Lufthansa Miles & More", cathay: "Cathay Asia Miles",
10
+ koreanAir: "Korean Air SKYPASS", lifemiles: "Avianca LifeMiles", turkish: "Turkish Airlines Miles&Smiles",
11
+ virginRed: "Virgin Points", frontier: "Frontier Miles", bestWestern: "Best Western Rewards",
9
12
  fixedValue: "Fixed-value miles", genericPoints: "Points", genericMiles: "Miles",
10
13
  };
11
14
  export const TRAVEL_CPP = {
@@ -15,6 +18,9 @@ export const TRAVEL_CPP = {
15
18
  tdRewards: 0.5, scenePlus: 1.0, rbcAvion: 1.8, bmoRewards: 0.6, // Oct 2026 CA medians (the MCP serves US cards only)
16
19
  hyatt: 1.4, marriott: 0.7, ihg: 0.5, choice: 0.6, wyndham: 0.5, hilton: 0.4, // wyndham: Nov 11 2026 median 0.585
17
20
  delta: 1.1, united: 1.2, american: 1.4, southwest: 1.2, jetBlue: 1.3, alaska: 1.4, avios: 1.2, aeroplan: 1.3,
21
+ // Nov 27 2026 medians, rounded down (mirrors Swift; the receipt holds the four readings).
22
+ flyingBlue: 1.3, lufthansa: 1.3, cathay: 1.2, koreanAir: 1.3, lifemiles: 1.3, turkish: 1.2, virginRed: 1.4,
23
+ frontier: 1.1, bestWestern: 0.6,
18
24
  fixedValue: 1.0, genericPoints: 2.0, genericMiles: 1.5,
19
25
  };
20
26
  /** RewardProgram.cashOutCPP */
@@ -70,6 +76,29 @@ export function inferProgram(issuer, id, currency) {
70
76
  return "aeroplan";
71
77
  if (has("british airways", "avios"))
72
78
  return "avios";
79
+ // Nov 27 2026 coverage pass (mirrors Swift). Qatar, Iberia and Aer Lingus earn Avios.
80
+ if (has("qatar", "iberia", "aer_lingus", "aer lingus"))
81
+ return "avios";
82
+ if (has("air_france", "air france", "klm", "flying blue"))
83
+ return "flyingBlue";
84
+ if (has("lufthansa", "miles_more", "miles & more"))
85
+ return "lufthansa";
86
+ if (has("cathay", "asia miles"))
87
+ return "cathay";
88
+ if (has("korean", "skypass"))
89
+ return "koreanAir";
90
+ if (has("avianca", "lifemiles"))
91
+ return "lifemiles";
92
+ if (has("turkish", "miles_smiles"))
93
+ return "turkish";
94
+ if (has("virgin"))
95
+ return "virginRed";
96
+ if (has("frontier"))
97
+ return "frontier";
98
+ if (has("best_western", "best western"))
99
+ return "bestWestern";
100
+ if (has("breeze", "sun_country", "allegiant", "latam", "caesars", "mgm"))
101
+ return "fixedValue";
73
102
  if (has("bilt"))
74
103
  return "bilt";
75
104
  if (has("scotia"))
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "rightcard-mcp",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "mcpName": "ai.rightcard/mcp",
5
+ "homepage": "https://rightcard.ai/mcp",
5
6
  "description": "RightCard MCP — the card-selection oracle for agents. Which of your credit cards to use at any store, from verified data. No bank login.",
6
7
  "type": "module",
7
8
  "license": "MIT",