AIVA Credit Card MCP Server

AIVA Credit Card MCP Server

A decoupled, stateful MCP server and HTTP REST Gateway styled as a Banking Credit Card IVR Integration, bridging core banking mainframes with conversational voice AI frameworks.

Category
访问服务器

README

AIVA Credit Card MCP Server & FastAPI Gateway

FastAPI MongoDB MCP NextGen Bank

A decoupled, stateful Model Context Protocol (MCP) server and HTTP REST Gateway styled exactly as a NextGen Bank Credit Card IVR Integration. It bridges the gap between raw backend core banking mainframes and conversational voice AI frameworks (such as Twilio Voice, Whisper, ElevenLabs, and CrewAI).


🧠 Core Philosophy: Dual-Channel Response Design

In conversational banking, there is a fundamental conflict between banking mainframes and customer experience:

  1. Core Banking Mainframes: Require detailed system audit logs ([SYSTEM_LOG]) for auditing, fraud tracking, and transactional ledgers.
  2. Customers (Voice dialogue): Cannot understand technical backend system logs. Speaking these will ruin the conversational flow.

AIVA resolves this by implementing a Dual-Channel Response Architecture:

  • 🗣️ Customer Dialogue ([AIVA IVR Dialogue]): Friendly, empathetic, and 100% natural conversational language to be spoken directly to the user (via text-to-speech). All technical jargon is completely removed.
  • ⚙️ System Audit Log ([SYSTEM_LOG]): Separated backend log structure appended at the bottom, housing the precise status details for downstream databases and engineering audits.

🔒 Implemented Core Banking & Security Safeguards

We have designed and verified five industry-grade banking workflow and security guards in the database core logic:

  1. Compromised Card Safety (Stolen/Hot-Carded)
    • Rule: Once a card is marked stolen/compromised via confirmed fraud (confirm_fraud), self-service unblocking is permanently disabled. Any unblock attempt (even with correct security answers) is rejected, and the customer is routed directly to a human representative.
  2. Duplicate Dispute Prevention (Already Disputed)
    • Rule: Blocks subsequent dispute submissions on the same transaction ID to prevent double-crediting inflation and audit duplicates.
  3. Override Blocks on Restricted Card (Blocked/Stolen Card Hold)
    • Rule: Rejects credit limit increase requests on cards that are Blocked, Locked Out, or Stolen.
  4. Fraud Clearing Validation (Transaction Not Flagged)
    • Rule: Prevents clearing fraud alerts (deny_fraud) on normal successful transactions that were never flagged as suspicious by our fraud models.
  5. 3-Strike KBA Verification Lockout (Verification Attempts Exceeded)
    • Rule: To prevent brute-forcing cardholder verification, self-service unblocking locks out after exactly 3 failed attempts, requiring human agent verification.

📊 Isolated Demo Schema (3 Profiles)

To deliver a non-contaminating, scalable and bulletproof live demonstration, the database seeds three distinct customer accounts formatted identically to real NextGen Bank Account Numbers (10 digits). Each profile isolates exactly one business flow:

graph TD
    A[MongoDB Database] --> B(nextgen-creditcards-ivr Collection)
    
    B --> C[Account 1: Failed Transaction]
    C --> C1[Vedant]
    C --> C2[Account No: 770321003]
    C --> C3[Card ending in 7003]
    C --> C4[Flow: Limit decline -> temporary limit increase to $2,000]
    
    B --> D[Account 2: Card Blocked]
    D --> D1[Maria Gonzalez]
    D --> D2[Account No: +15550102]
    D --> D3[Card ending in 8121]
    D --> D4[Flow: KBA question 'Buddy' -> unblock to Active / 3-Strike Lockout]
    
    B --> E[Account 3: Fraud Suspicion]
    E --> E1[Emily Watson]
    E --> E2[Account No: +15550104]
    E --> E3[Card ending in 5528]
    E --> E4[Flow: Confirm Fraud -> disputes txn, permanent hot-card block, Apple Pay digital wallet copy]



🛠️ Setup & Configuration

1. Prerequisites

  • Python: 3.10+
  • MongoDB: A running MongoDB instance (Local or MongoDB Atlas)

2. Environment Configuration

Create a .env file in the root directory to manage your configurations:

MONGO_URI=mongodb+srv://<username>:<password>@<cluster>.mongodb.net/?retryWrites=true&w=majority
MONGO_DB_NAME=wf-ivr
MONGO_COLLECTION_NAME=creditcards
SERVER_HOST=0.0.0.0
SERVER_PORT=8000

3. Installation

Install core requirements using pip:

pip install -r requirements.txt

🚀 Execution & Verification

1. Seeding and Auto-testing

Run the programmatic automation suite to completely reset the database, execute all 18 standard and negative test cases, and dynamically compile the beautiful visual HTML documentation:

python run_automated_tests.py

This test runner executes:

  • Vedant limit increase happy path & restricted card limit override block.
  • Maria Gonzalez unblocking happy path & sequential 3-strike brute-force lockout.
  • Emily Watson fraud disputes, duplicate disputes block, and unblocking compromised card blocks.
  • Emily Watson fraud denial clearing & non-flagged fraud clearing block.

2. Start HTTP Gateway (Postman Testing)

Start the FastAPI REST gateway to test using Postman or manual HTTP POST payloads:

python server.py
  • Endpoint: POST http://localhost:8000/api/credit-card
  • Swagger UI Docs: http://localhost:8000/docs
  • HTML Report: Open integration_docs.html in a web browser to review the visual conversation chat timeline, high-resolution visual sequence diagrams, and copy-paste actual live JSON requests/responses.

3. Start Stdio MCP Mode (CrewAI Integration)

To bind the Model Context Protocol directly to the CrewAI agent orchestrator via stdio:

python server.py --mcp

CrewAI MCP Configuration (mcp_config.json)

Configure your CrewAI orchestrator or desktop client using this block:

{
  "mcpServers": {
    "aiva-creditcard-mcp": {
      "command": "python",
      "args": ["C:/Users/bhatn/OneDrive/Documents/Projects/AntiGravity/aiva-creditcard-mcp/server.py", "--mcp"]
    }
  }
}

📂 Project Architecture

  • server.py: Houses the dual FastMCP stdio server and FastAPI REST gateway.
  • run_automated_tests.py: Executes the 18 automated test suites, capturing live JSON traces to compile the master documentation.
  • seed_db.py: Seeds MongoDB with NextGen Bank test profiles.
  • integration_docs.html: Handover reference with pixel-clean fullscreen sequence diagram modals, conversational chats, and live REST JSON traces.
  • .gitignore: Excludes credentials (.env) and python compilation directories from Git tracking.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选