Payment-Risk-Exception-AI-Agent-MCP
Allows retrieval of transaction context from Stripe, including payment details and risk signals, for use in payment decision workflows.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Payment-Risk-Exception-AI-Agent-MCPReview exception transaction TXN-12345 and approve or deny."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Payment-Risk-Exception-AI-Agent
A local application example that demonstrates a hybrid payment-decisioning workflow. A rule based deterministic decision policy first assesess transactions and automatically approves or denies. The transactions that have mismatched info but not severe enough to trigger a denial is routed to an LLM agent which reviews the transactions then approves/denies or sends for human-review.
This example uses the following:
Stripe's official Python SDK (
stripe-python)Stripe's official mock server (
stripe-mock)Rule based deterministic decision policy
Simulated Merchant Data
LLM Agent
MCP Server with discoverable tools
FastAPI REST endpoints
SQLite
Docker
Postman API testing
Analyst dashboard
The four demo transactions
Everything matches
Travel mismatch
Compounding risk
Mixed evidence
Related MCP server: Payments Agent Gateway (MCP)
LLM Agent MCP flow
For exception transactions, the model itself selects the tools:
LLM
└─ calls get_transaction_context through MCP
└─ receives Stripe + merchant context and deterministic signals
└─ then calls exactly one MCP terminal tool:
├─ record_ai_decision (approve or deny)
└─ create_human_reviewThe Python orchestrator executes the tool calls requested by the model. It does not silently replace the model with a deterministic fallback and does not choose the terminal MCP action on the model's behalf.
Setup
For testing, please create an .env file and provide the LLM key.
Run:
docker compose up --buildOpen:
Dashboard:
http://localhost:8000Health/API configuration:
http://localhost:8000/api/healthFastAPI docs:
http://localhost:8000/docsMCP endpoint:
http://localhost:8001/mcpStripe Mock:
http://localhost:12111
Important boundaries
Stripe Mock returns fixture-based Stripe objects. It does not process money, run Stripe risk models, or preserve a real payment lifecycle.
Merchant session and account data are simulated demo data.
Clean transactions stay on deterministic policy; the model is called only for exceptions.
The MCP server allows context retrieval, AI decision persistence, and human-review creation.
Human-review resolution is intentionally absent from MCP. Only the analyst REST/dashboard path can resolve it.
Screenshots:
Main Screen:

Rules Fired:

AI Explanation:

Transaction Details:

Video Preview:
https://github.com/user-attachments/assets/84ff0226-a9cb-4c60-a4f7-ed301f0b5f5d
This server cannot be deployed
Maintenance
Related MCP Connectors
MCP server for Modern Treasury — payment orders, transactions, counterparties and ledgers.
MCP server for MaxMind minFraud — score transactions for fraud risk from your AI assistant.
MCP server for secureFlows: token-free URL builders and integration-linting tools for AI agents.
MCP server for building and testing AI agents with multi-model experimentation and insights.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceMCP server for integrating manufacturing systems (MES/ERP/quality/maintenance) with LLM agents, enabling event ingestion, incident triage, approval workflows, and RAG-based knowledge retrieval.MIT
- FlicenseNot gradedqualityBmaintenanceAn MCP server that enables AI agents to safely interact with a double-entry payments ledger, enforcing idempotency, policy-based access control, and human-in-the-loop approval for high-value actions.-
- FlicenseAqualityBmaintenanceMCP server exposing a fictional payment domain as tools, resources, and prompts, enabling reasoning over transactions, payment hubs, services, and system health.8-
- FlicenseNot gradedqualityBmaintenanceMCP server for payments analytics, enabling natural language queries on transaction data, merchant summaries, and chargeback anomaly detection with grounded, auditable answers.-