Skip to main content
Glama
Swipe Smart MCP

Swipe Smart MCP

by afzalmukhtar

Swipe Smart MCP - AI-powered credit card rewards optimizer with futuristic digital interface showing multiple credit cards and reward tracking visualization

Swipe Smart MCP šŸ’³

An AI-powered MCP server that helps you always swipe the right card for maximum rewards.

What It Does

Swipe Smart tracks your credit cards, their reward structures, and spending caps — then tells you which card to use for any purchase to maximize your points or cashback.

Key Features

  • Smart Card Recommendations — Ask "Which card for ₹5000 on Amazon?" and get the optimal choice

  • Reward Tracking — Automatically calculates points earned on every transaction

  • Cap Awareness — Knows when you've hit monthly reward caps and suggests alternatives

  • Multi-Card Wallet — Manage unlimited cards with complex reward structures

  • Category Intelligence — Understands 22+ spending categories with proper MCC mapping

  • Web Search — Searches for card reward details when adding new cards

Related MCP server: rightcard-mcp

Quick Start

Prerequisites

  • Python 3.12+

  • uv package manager

Installation

# Clone the repository
git clone https://github.com/afzalmukhtar/swipe-smart-mcp.git
cd swipe-smart-mcp

# Install dependencies
uv sync

# Initialize the database
uv run python scripts/init_db.py

# (Optional) Seed with sample data
uv run python scripts/seed.py

Running the Server

# Direct run
uv run server.py

# Or use the script
./run_mcp.sh

Connecting to Claude Desktop

Add to your Claude Desktop config (~/.config/claude/claude_desktop_config.json):

Method 1: Using the shell script

{
  "mcpServers": {
    "swipe-smart": {
      "command": "/path/to/swipe-smart-mcp/run_mcp.sh"
    }
  }
}

Method 2: Using uv directly with bash

{
  "mcpServers": {
    "swipe-smart": {
      "command": "bash",
      "args": ["-c", "cd /path/to/swipe-smart-mcp && uv run server.py"]
    }
  }
}

Usage Examples

Ask for Card Recommendations

"Which card should I use for a ₹3000 Swiggy order?"

Log Transactions

"I spent ₹1500 at Amazon using my HDFC Regalia"

Check Rewards

"How many points do I have on my Infinia card?"

Add a New Card

"Add my new SBI Cashback card"

Analyze Spending

"Show me my spending breakdown for this month"

Available Tools

Tool

Description

get_best_card_for_purchase

Recommends optimal card for a purchase

add_transaction

Logs an expense and calculates rewards

get_my_cards

Lists all cards in your wallet

get_card_rules

Shows reward rules for a card

get_reward_balance

Checks points balance

analyze_expenses

Spending analysis and insights

search_card_info

Web search for card reward details

add_credit_card

Adds a new card to wallet

Project Structure

swipe-smart-mcp/
ā”œā”€ā”€ server.py           # MCP server with all tools
ā”œā”€ā”€ src/
│   ā”œā”€ā”€ models.py       # Database models (Card, Expense, Rules)
│   ā”œā”€ā”€ db.py           # Database connection
│   └── logic/
│       ā”œā”€ā”€ rewards.py      # Reward calculation engine
│       └── recommender.py  # Card recommendation logic
ā”œā”€ā”€ data/
│   ā”œā”€ā”€ categories.json     # Expense categories & MCC codes
│   └── bank_domains.json   # Bank website mappings
└── scripts/
    ā”œā”€ā”€ init_db.py      # Database initialization
    └── seed.py         # Sample data seeder

Supported Categories

Dining, Groceries, Fuel, Travel (Flights, Hotels, Rail), Shopping, Entertainment, Utilities, Telecom, Healthcare, Education, and more.

Contributing

Contributions are welcome! Please read CONTRIBUTING.md before submitting a pull request.

Note: By contributing, you agree to assign copyright to the project owner (see CLA in CONTRIBUTING.md).

āš–ļø License & Commercial Use

This project is licensed under the PolyForm Noncommercial License 1.0.0.

āœ… Permitted Uses (Free)

  • Personal Use: Use this for your own hobbies, private study, or personal credit card optimization

  • Education: Universities and schools can use this for teaching and research

  • Noncommercial Organizations: Charities, educational institutions, and government organizations

āŒ Commercial Use is Prohibited

You may NOT use this software for any business purpose, including but not limited to:

  • Internal business tools or employee use

  • Hosting it as a service (SaaS) for customers

  • Bundling it in a commercial product

  • Any activity that provides commercial advantage or monetary compensation

šŸ’¼ Need a Commercial License?

If you are a company and want to use Swipe Smart MCP for your business, please contact me:

šŸ’” Important: Please mention "Swipe Smart MCP Commercial License" as the subject of your email. If you don't receive a reply within 24 hours, please reach out via LinkedIn DM.

Full License: See LICENSE file for complete terms.

Available Tools

20 tools
add_cap_bucketsA
Adds cap buckets (spending limits) to an existing credit card.
Call this BEFORE add_reward_rules if rules need to reference caps.

Args:
    card_id: The ID of the card (returned by add_credit_card).
    buckets: List of bucket dictionaries. Each bucket should have:
        - name (str): Descriptive name (e.g., "SmartBuy Monthly Cap", "Dining Quarterly Cap")
        - max_points (float): Maximum points that can be earned in this bucket
        - period (str): Reset period. Options: "daily", "statement_month", "quarter", "statement_year". Default "statement_month".
        - scope (str): What the cap applies to. Options: "category", "global". Default "category".

Returns:
    dict with status and list of created bucket IDs.

Example:
    add_cap_buckets(card_id=1, buckets=[
        {"name": "SmartBuy Monthly Cap", "max_points": 5000, "period": "statement_month"},
        {"name": "Total Monthly Cap", "max_points": 15000, "period": "statement_month", "scope": "global"},
    ])

Inputs: buckets (required), card_id (required).

add_credit_cardA
Registers a new credit card in the database with basic user-provided info.

This is STEP 1 of adding a card. After this, call:
- add_reward_rules() to add reward rules
- add_cap_buckets() to add spending caps
- add_redemption_partners() to add transfer partners

Args:
    name: Full card name (e.g., "HDFC Regalia Gold", "SBI Cashback").
    bank: Issuing bank (e.g., "HDFC", "SBI", "ICICI").
    monthly_limit: Credit limit in INR.
    billing_cycle_start: Day of month when bill generates (1-31).
    network: Card network. Default "Visa". Options: Visa, Mastercard, RuPay, Amex, Diners.
    rewards_currency: Type of rewards. Default "Reward Points". Options: Reward Points, Cashback, Miles, etc.
    base_point_value: Value per point in INR. Default 0.25. (e.g., 0.25 means 1 point = ₹0.25).
    description: Card benefits summary (from online search). Helps LLM understand card features.
    tier_status: Membership tiers as dict (e.g., {"membership": "prime"} for Amazon ICICI Prime).

Returns:
    dict with status, card_id (needed for adding rules), and card details.

Inputs: bank (required), name (required), monthly_limit (required), billing_cycle_start (required), +5 more.

add_redemption_partnersA
Adds redemption/transfer partners to an existing credit card.
These are airlines, hotels, or other programs where points can be transferred.

Args:
    card_id: The ID of the card (returned by add_credit_card).
    partners: List of partner dictionaries. Each should have:
        - partner_name (str): Name of the partner (e.g., "Singapore Airlines", "Marriott")
        - transfer_ratio (float): Points needed per 1 partner point (e.g., 2.0 means 2 card points = 1 mile)
        - estimated_value (float): Estimated value per partner point in INR (e.g., 1.5 for airline miles)

Returns:
    dict with status and list of created partner IDs.

Example:
    add_redemption_partners(card_id=1, partners=[
        {"partner_name": "Singapore Airlines", "transfer_ratio": 1.0, "estimated_value": 1.50},
        {"partner_name": "Marriott Bonvoy", "transfer_ratio": 2.0, "estimated_value": 0.80},
    ])

Inputs: card_id (required), partners (required).

add_reward_rulesA
Adds reward rules to an existing credit card. Call this AFTER add_credit_card.

Each rule defines how points are earned for a specific category/merchant/platform.

Args:
    card_id: The ID of the card (returned by add_credit_card).
    rules: List of rule dictionaries. Each rule should have:
        - category (str): Category name, merchant, or platform (e.g., "Dining", "Amazon", "SmartBuy")
        - base_multiplier (float): Base reward rate (e.g., 0.02 for 2%)
        - bonus_multiplier (float): Additional bonus rate (e.g., 0.03 for 3% extra). Default 0.
        - min_spend (float): Minimum spend to trigger rule. Default 0.
        - match_conditions (dict): Tier conditions (e.g., {"membership": "prime"}). Default None.
        - cap_bucket_name (str): Name of cap bucket to link. Default None.

Returns:
    dict with status and list of created rule IDs.

Example:
    add_reward_rules(card_id=1, rules=[
        {"category": "Dining", "base_multiplier": 0.04, "bonus_multiplier": 0.01},
        {"category": "All Spends", "base_multiplier": 0.02, "bonus_multiplier": 0},
        {"category": "SmartBuy", "base_multiplier": 0.10, "cap_bucket_name": "SmartBuy Monthly Cap"},
    ])

Inputs: rules (required), card_id (required).

add_transactionA
Logs a new expense (transaction) to the database.

**IMPORTANT: Call `get_expense_logging_rules` first to learn the rules for parsing user input.**

Args:
    amount: The value of the transaction (must be positive).
    merchant: The name of the place/service (e.g., "Swiggy", "Amazon").
    category: The expense category. Must be a valid category from get_expense_logging_rules.
    card_name: The name of the credit card used.
    platform: How the payment was made (e.g., "Direct", "SmartBuy").
    date: Optional date in 'YYYY-MM-DD' format. Defaults to today.
    is_online: Explicit flag if known (True=Online, False=Offline). If None, system infers.

Returns:
    dict: Confirmation details including Transaction ID and status.

Inputs: amount (required), category (required), merchant (required), card_name (required), +3 more.

adjust_reward_pointsA
Adjusts the point balance for a card. Use for redemptions, bonuses, or corrections.

Args:
    card_name: The card to adjust.
    points: Points to add (+ve) or remove (-ve). Use negative for redemptions.
    reason: Description (e.g., "Redeemed for Amazon voucher", "Welcome bonus").
    adjustment_type: One of: redemption, signup_bonus, referral, promo, correction, expiration.
    reference: Optional reference (order ID, promo code).

Returns:
    Dictionary with adjustment details and new balance.

Inputs: points (required), reason (required), card_name (required), reference, +1 more.

analyze_expensesA
Analyzes spending patterns and reward earnings for a given period.

Call this tool when user asks:
- "How did I spend this month?"
- "Show me my spending summary"
- "What's my reward rate?"
- "Where is my money going?"

Args:
    period: Time period to analyze. Options: "week", "month", "quarter", "year"
            Ignored if start_date/end_date provided.
    start_date: Custom start date (YYYY-MM-DD). Optional.
    end_date: Custom end date (YYYY-MM-DD). Optional.

Returns:
    dict with spending summary, category breakdown, card usage, and insights.

Inputs: period, end_date, start_date.

delete_credit_cardA
Permanently deletes a credit card and ALL its associated rules, limits, and history.

āš ļø WARNING: This action cannot be undone. It removes:
- The Card entry
- All Reward Rules for this card
- All Cap Buckets for this card
- All Redemption Partners for this card
- (Expenses might remain as orphans depending on DB settings, but are usually unlinked)

Args:
    card_id (int): The unique numeric ID of the card (found via 'get_my_cards').

Returns:
    str: Success or error message.

Inputs: card_id (required). Returns: result

delete_transactionB
Permanently removes a specific transaction record from the database.

Args:
    transaction_id (int): The unique numeric ID of the transaction (found via 'get_recent_transactions').

Returns:
    str: Success or error message.

Inputs: transaction_id (required). Returns: result

get_best_card_for_purchaseA
Finds the BEST credit card to use for a specific purchase.

Call this tool when user asks:
- "Which card should I use for X?"
- "What's the best card for this purchase?"
- "How can I maximize rewards on X?"

Args:
    amount: Purchase amount in INR (e.g., 5000)
    merchant: Where the purchase is being made (e.g., "Amazon", "Swiggy", "MakeMyTrip")
    category: Purchase category. Use valid categories from get_expense_logging_rules.
    platform: Payment platform (Default: "Direct"). Options: Direct, SmartBuy, Amazon Pay, CRED

Returns:
    dict containing recommendations and guidelines for interpreting/presenting results.

Inputs: amount (required), category (required), merchant (required), platform.

get_card_addition_guidelinesA
**IMPORTANT: Call this tool BEFORE adding any credit card.**

Returns guidelines for adding a new credit card, including:
- What information to collect from the user (REQUIRED - only user knows)
- What information to search online (reward rules, caps, etc.)
- The workflow for adding a card step by step

You MUST read these guidelines before starting the card addition workflow.

Inputs: no named parameters.

get_card_descriptionB
Retrieves the description and key details of a credit card.
Useful for understanding card benefits before making a purchase decision.

Args:
    card_id: The ID of the credit card.

Returns:
    Dictionary with card name, description, tier status, and reward info.

Inputs: card_id (required).

get_card_rulesA
Retrieves the detailed reward logic (multipliers, caps, and limits) for specific credit cards.

Args:
    card_identifier (str): The search term. Can be:
        - A specific numeric Card ID (e.g., "1") for a precise lookup.
        - A partial Card Name (e.g., "HDFC") to find all matching cards.

Returns:
    dict: A structured JSON object containing:
        - 'status': 'success' or 'error'
        - 'match_count': Number of cards found.
        - 'cards': A list of matching card details, where each entry includes:
            - 'rules': List of categories (e.g., 'Dining'), multipliers (Base + Bonus), and any 'capped_by' limits.

Example:
    get_card_rules("1") -> Returns rules strictly for Card ID 1.
    get_card_rules("Regalia") -> Returns rules for all cards containing 'Regalia'.

Inputs: card_identifier (required).

get_expense_logging_rulesA
**IMPORTANT: Call this tool BEFORE adding any expense.**

Returns the guidelines and rules for logging expenses, including:
- Required fields and their formats
- Valid categories
- Smart inference rules
- How to handle missing information

You MUST read these guidelines before calling `add_transaction`.

Inputs: no named parameters.

get_my_cardsA
Retrieves a summary of all credit cards currently stored in the wallet database.

Use this tool to:
1. Find the specific unique 'ID' of a card (required for other tools).
2. Check credit limits, remaining limits, and billing cycle dates.
3. See the 'Base Value' (floor price) of points for each card.

Returns:
    dict: A dictionary of cards, including their ID, Name, Bank, Limit, and Billing Cycle.

Inputs: no named parameters.

get_points_historyA
Shows unified points history: both earned (from transactions) and adjustments (redemptions, bonuses).

This gives a complete timeline of all points activity across all cards.

Args:
    limit: Maximum number of entries to return (default: 20).

Returns:
    dict: History entries with date, card, amount, type (earned/redemption/bonus/etc), and description.

Inputs: limit.

get_reward_balanceA
Checks the current accumulated reward points for a specific card.

Args:
    card_name: The name of the card to check.

Returns:
    Dictionary with total points, period breakdown, and card details.

Inputs: card_name (required).

get_transactionsA
Retrieves transactions based on flexible filters.

Logic:
- Multiple values within a filter are treated as OR (e.g., category=['Dining', 'Food'] -> Dining OR Food).
- Different filters are treated as AND (e.g., category='Dining' AND card='HDFC').

Args:
    limit (int): Max number of records to return (default: 5).
    start_date (str): Filter for transactions ON or AFTER this date (Format: YYYY-MM-DD).
    end_date (str): Filter for transactions ON or BEFORE this date (Format: YYYY-MM-DD).
    category (list[str]): List of categories to match (e.g., ["Dining", "Groceries"]).
    merchant (list[str]): List of merchants to match (e.g., ["Amazon", "Flipkart"]).
    card_name (list[str]): List of card names to match (e.g., ["HDFC", "Amex"]).
    platform (list[str]): List of platforms (e.g., ["Swiggy", "Zomato"]).
    bank (list[str]): List of banks (e.g., ["HDFC", "SBI"]).

Returns:
    dict: A structured list of matching transactions and a summary count.

Inputs: bank, limit, category, end_date, +4 more.

search_card_infoA
Searches the web for credit card reward information using targeted DuckDuckGo queries.
Focuses on official docs (MITC/KFS/T&Cs), reviewers, and community sources.

Args:
    card_name: The name of the credit card (e.g., "HDFC Regalia Gold", "SBI Cashback").
    bank: Optional bank name for targeted site: searches (e.g., "HDFC", "ICICI", "Axis").
    max_results: Maximum total results to return. Default 15.

Returns:
    dict with categorized search results (official_docs, rewards_math, caps, reviews, community).
    Use this information to extract reward rules for add_reward_rules().

Inputs: card_name (required), bank, max_results.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 20 tools

    Disambiguation4/5

    Most tools have clearly distinct purposes, especially around transaction logging, card additions, rewards, and analytics. A few overlaps exist between read tools like get_my_cards, get_card_rules, and get_card_description, and between search_card_info and custom_web_search, but descriptions generally clarify the boundaries.

    Naming Consistency4/5

    The tool set is overwhelmingly consistent snake_case with verb_noun patterns such as get_my_cards, add_transaction, and delete_credit_card. The main deviation is custom_web_search, which is adjective_noun rather than verb-first, but the overall convention remains predictable.

    Tool Count3/5

    Twenty tools is on the heavy side for a single MCP server, crossing into the 16–25 borderline range. The domain is complex enough to justify many operations, but some guidance and search tools could potentially be consolidated.

    Completeness3/5

    The server covers card creation, transaction logging, reward rules, caps, redemption partners, analytics, and points history. However, there is no update path for credit cards or transactions, and reward rules, cap buckets, and redemption partners can only be added, not read individually, updated, or deleted, creating notable lifecycle gaps.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      C
      maintenance
      Enables agents to recommend the best credit card for a given store or category, look up merchant coding, search cards, and inspect rotating bonus calendars using verified reward data.
      5
      708 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables AI agents to choose the best card for a purchase with reasons, identify merchants, inspect wallet caps and bonus progress, compare public welcome offers, and record purchases against caps and bonuses.
      651 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables an AI assistant to compare U.S. credit cards and recommend which card to use or get based on spending, including annual fees, spending caps, credits, and card terms. It runs locally without network requests and requires only card names and rough monthly spending by category.
      61 npm
      MIT