> ## Documentation Index
> Fetch the complete documentation index at: https://praison.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 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`) |

> [!WARNING]
>
> **Start in Stripe Test Mode / Sandboxes first.** Never grant autonomous write/refund permissions on a live Stripe account without scoping tools via `--allow` and setting `approval="always"`.

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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 ok
```

***

## How 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`.

```mermaid theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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 summary
```

***

## Step-by-Step Setup

**1. 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](https://dashboard.stripe.com/apikeys)

**2. Install PraisonAI with MCP support**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
pip install "praisonai[mcp]"
```

**3. Add and authenticate Stripe**

> [tab] CLI (Interactive OAuth)
>
> ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
> praisonai connectors add stripe --auth
> ```
>
> Select your Stripe Sandbox or account in the browser consent screen.

> [tab] Headless / SSH (--manual)
>
> ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
> praisonai connectors add stripe --auth --manual
> ```

> [tab] Restricted API Key (CI / Read-Only)
>
> ```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
> 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"
> ```

> [tab] PraisonAI Dashboard
>
> Enable catalog connectors in your PraisonAIUI `config.yaml`:
>
> ```yaml theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
> mcp:
>   enabled: true
>   allow:
>     catalog: true
> ```
>
> Run `praisonai dashboard`, open **Connectors / MCP**, and click **Connect** on **Stripe**.

**4. Verify and list discovered tools**

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# For OAuth 2.1 connections:
praisonai mcp sync stripe

# For Restricted API Key (-H) connections:
praisonai connectors test stripe
```

**5. Run a safe billing agent**

```python theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
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:

```bash theme={"theme":{"light":"vitesse-light","dark":"vitesse-dark"}}
# 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 \
  --auth
```

***

## Common 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

> [accordion] 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.

> [accordion] 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.

> [accordion] 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")`.

***

## Related

> [card] [List of Connectors](https://praison.ai/docs/features/connectors-list.md)
>
> Browse all popular connectors and step-by-step guides

> [card] [Remote MCP Connectors](https://praison.ai/docs/features/connectors.md)
>
> CLI commands, --manual sign-in, and Dashboard setup

> [card] [Human Approval](https://praison.ai/docs/features/approval.md)
>
> Require human confirmation before sensitive tool calls

> [card] [MCP OAuth Authentication](https://praison.ai/docs/mcp/mcp-oauth.md)
>
> OAuth 2.1 PKCE flow and token storage


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.