Stripe Connector
Connect PraisonAI agents to Stripe for customers, invoices, subscriptions, and payment lookups with OAuth 2.1 or restricted API keys
Connect your PraisonAI agents to Stripe to look up customers, inspect invoices, check subscription statuses, and debug payment events using Stripe’s official remote MCP server.
| Setting | Value |
|---|---|
| Catalog ID | stripe |
| Endpoint | https://mcp.stripe.com |
| Transport | Streamable HTTP (Remote) |
| Authentication | OAuth 2.1 (interactive) or Restricted API Key header (Authorization: Bearer) |
from praisonaiagents import Agent, MCP
agent = Agent(
name="Billing Assistant",
instructions="Answer billing and invoice questions accurately without issuing charges or refunds.",
tools=MCP(
"https://mcp.stripe.com",
oauth=True,
server_name="stripe",
approval="always",
),
)
agent.start("List the 5 most recent unpaid invoices and summarize total balance due")The user asks for unpaid invoices; PraisonAI authenticates with Stripe, requests approval before executing each call, and returns a clean billing summary.
graph LR
User["👤 User"] --> Agent["🤖 PraisonAI Agent"]
Agent --> Guard["🛡️ approval=always"]
Guard --> Auth["🔐 Stripe OAuth 2.1"]
Auth --> Stripe["💳 Stripe Remote MCP<br/>mcp.stripe.com"]
Stripe --> Result["✅ Customers & Invoices"]
classDef input fill:#6366F1,stroke:#7C90A0,color:#fff
classDef agent fill:#8B0000,stroke:#7C90A0,color:#fff
classDef warn fill:#F59E0B,stroke:#7C90A0,color:#fff
classDef ok fill:#10B981,stroke:#7C90A0,color:#fff
class User input
class Agent agent
class Guard,Auth warn
class Stripe,Result okHow It Works
PraisonAI connects to Stripe’s hosted MCP server (https://mcp.stripe.com) over Streamable HTTP with OAuth 2.1 PKCE (or a read-only Restricted API Key header in CI) and saves OAuth tokens locally at 0600 in ~/.praisonai/mcp-auth.json.
sequenceDiagram
participant User
participant CLI as praisonai CLI
participant StAuth as Stripe OAuth 2.1
participant Store as mcp-auth.json
participant StMCP as Stripe MCP Server
participant Agent as PraisonAI Agent
User->>CLI: praisonai connectors add stripe --auth
CLI->>StAuth: Start OAuth 2.1 PKCE consent
StAuth-->>User: Choose Stripe account or Sandbox and approve
StAuth-->>Store: Save OAuth token (0600)
User->>Agent: Query invoices or subscriptions
Agent->>Store: Load cached token
Agent->>StMCP: Call read-only Stripe MCP tools
StMCP-->>Agent: Invoice and customer records
Agent-->>User: Formatted billing summaryStep-by-Step Setup
- Prerequisites
- A Stripe account (start with a Stripe Sandbox / Test Mode account before connecting Live Mode)
- For headless/CI read-only access: a Restricted API Key (
rk_test_...) created in Stripe Dashboard → Developers → API Keys
- Install PraisonAI with MCP support
bash pip install "praisonai[mcp]" - Add and authenticate Stripe
CLI (Interactive OAuth)
bash praisonai connectors add stripe --authSelect your Stripe Sandbox or account in the browser consent screen.
Headless / SSH (–manual)
bash praisonai connectors add stripe --auth --manualRestricted API Key (CI / Read-Only)
bash export STRIPE_RESTRICTED_KEY="${STRIPE_RESTRICTED_KEY:?Set STRIPE_RESTRICTED_KEY in your shell}" praisonai connectors add stripe \ --url https://mcp.stripe.com \ -H "Authorization=Bearer $STRIPE_RESTRICTED_KEY"PraisonAI Dashboard
Enable catalog connectors in your PraisonAIUI
config.yaml:yaml mcp: enabled: true allow: catalog: trueRun
praisonai dashboard, open Connectors / MCP, and click Connect on Stripe. - Verify and list discovered tools
bash # For OAuth 2.1 connections: praisonai mcp sync stripe # For Restricted API Key (-H) connections: praisonai connectors test stripe - Run a safe billing agent
python from praisonaiagents import Agent, MCP agent = Agent( name="Stripe Analyst", instructions="Inspect Stripe invoices and subscriptions concisely.", tools=MCP( "https://mcp.stripe.com", oauth=True, server_name="stripe", approval="always", ), ) agent.start("Show active subscriptions created this week")
Scope Tools for Safety
Always pair read-only Restricted Keys (or --allow) with approval="always" for payment systems:
# Inspect exact tool names first:
praisonai mcp sync stripe
# Restrict to read-only lookups:
praisonai connectors add stripe \
--allow list_customers,list_invoices,list_subscriptions \
--authCommon Workflows
- Failed Payment Triage:
"List invoices from the last 7 days with failed payment attempts and summarize failure reasons." - Customer Support Lookup:
"Look up subscription status and next renewal date for customer email alice@example.com."
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
401 Unauthorized on praisonai connectors test stripe | connectors test does not attach stored OAuth tokens | Verify with praisonai mcp sync stripe |
| Permission denied on a Stripe action | Restricted Key or OAuth consent lacks that resource scope | Grant only the needed read scope on your Restricted Key or re-authorize |
| Connected to Live Mode by mistake | Selected live account during OAuth | Run praisonai connectors logout stripe --yes and re-authenticate against a Sandbox account |
Best Practices
Use Stripe Sandboxes for development and testing
Build and test all billing agents against a Stripe Sandbox / Test Mode account before ever touching production billing data.
Use read-only Restricted API Keys for automated reporting
In scheduled reports or CI, create a Stripe Restricted API Key (rk_...) with Read permissions only on Customers, Invoices, and Subscriptions.
Always enable approval='always' for write tools
Any agent permitted to issue refunds, cancel subscriptions, or create payment links should require explicit human approval via MCP(..., approval="always").