Stripe CLI for AI Agents

Framework Integration Gradient
Stripe Logo
CLI Logo
divider

Introduction

CLIs are eating MCPs. The industry is converging on the very same idea. MCPs for all their merit can be token hungry, slow, and unreliable for complex tool chaining. However, coding agents have become incredibly good at working with CLIs, and in fact they are far more comfortable working with CLI tools than MCP.

With Composio's Universal CLI, your coding agents can talk to over 850+ SaaS applications. With Stripe, agents can create a new stripe customer with email, generate a draft invoice for recent orders, cancel an active subscription at period end, and more — all without worrying about authentication.

This guide walks you through Composio Universal CLI and explains how you can connect it with coding agents like Claude Code, Codex, OpenCode, etc, for end-to-end Stripe automation.

Also integrate Stripe with

What is Universal CLI and why use it?

The idea behind building the universal CLI is to give agents a single command interface to interact with all your external applications. Here's what you'll get with it:

  • Agent-friendly: Coding agents like Claude Code, Codex, and OpenCode can use CLI tools natively — no MCP setup required.
  • Authentication handled: Connect once via OAuth or API Key, and all CLI commands work with your credentials automatically.
  • Tool discovery: Search, inspect, and execute 20,000+ tools across 850+ apps from one interface.
  • Trigger support: Use triggers to listen for events across your apps, powered by real-time webhooks or polling under the hood.
  • Type generation: Generate typed schemas for autocomplete and type safety in your projects.

Prerequisites

Install the Composio CLI, authenticate, and initialize your project:

bash
# Install the Composio CLI
curl -fsSL https://composio.dev/install | bash

# Authenticate with Composio
composio login

During login you'll be redirected to sign in page, finish the complete flow and you're all set.

Composio CLI authentication flow

Connecting Stripe to Coding Agents via Universal CLI

Once it is installed, it's essentially done. Claude Code, Codex, OpenCode, OpenClaw, or any other agent will be able to access the CLI. A few steps to give agents access to your apps.

  1. Launch your Coding Agent — Claude Code, Codex, OpenCode, anything you prefer.
  2. Prompt it to "Authenticate with Stripe"
  3. Complete the authentication and authorization flow and your Stripe integration is all set.
  4. Start asking anything you want.

Supported Tools & Triggers

Tools
Triggers
Cancel subscriptionCancels a customer's active stripe subscription at the end of the current billing period, with options to invoice immediately for metered usage and prorate charges for unused time.
Confirm payment intentConfirms a stripe paymentintent to finalize a payment; a `return url` is necessary if the payment method requires customer redirection.
Create CustomerCreates a new customer in stripe, required for creating charges or subscriptions; an email is highly recommended for customer communications.
Create an invoiceCreates a new draft stripe invoice for a customer; use to revise an existing invoice, bill for a specific subscription (which must belong to the customer), or apply detailed customizations.
Create payment intentCreates a stripe paymentintent to initiate and process a customer's payment; using `application fee amount` for a connected account requires the `stripe-account` header.
Create a priceCreates a new stripe price for a product, defining its charges (one-time or recurring) and billing scheme; requires either an existing `product` id or `product data`.
Create productCreates a new product in stripe, encoding the request as `application/x-www-form-urlencoded` by flattening nested structures.
Create RefundCreates a full or partial refund in stripe, targeting either a specific charge id or a payment intent id.
Create subscriptionCreates a new, highly configurable subscription for an existing stripe customer, supporting multiple items, trials, discounts, and various billing/payment options.
Delete customerPermanently deletes an existing stripe customer; this irreversible action also cancels their active subscriptions and removes all associated data.
List ChargesRetrieves a list of stripe charges with filtering and pagination; use valid cursor ids from previous responses for pagination, and note that charges are typically returned in reverse chronological order.
List Stripe couponsRetrieves a list of discount coupons from a stripe account, supporting pagination via `limit`, `starting after`, and `ending before`.
List customer payment methodsRetrieves a list of payment methods for a given customer, supporting type filtering and pagination.
List customersRetrieves a list of stripe customers, with options to filter by email, creation date, or test clock, and support for pagination.
List InvoicesRetrieves a list of stripe invoices, filterable by various criteria and paginatable using invoice id cursors obtained from previous responses.
List payment intentsRetrieves a list of stripe paymentintents, optionally filtered and paginated using paymentintent ids as cursors.
List payment linksRetrieves a list of payment links from stripe, sorted by creation date in descending order by default.
List productsRetrieves a list of stripe products, with optional filtering and pagination; `starting after`/`ending before` cursors must be valid product ids from a previous response.
List RefundsLists stripe refunds, sorted by creation date descending (newest first), with optional filtering by charge or payment intent and pagination support.
List Stripe shipping ratesRetrieves a list of stripe shipping rates, filterable by active status, creation date, and currency; useful for managing or displaying shipping options.
List subscriptionsRetrieves a list of stripe subscriptions, optionally filtered by various criteria such as customer, price, status, collection method, and date ranges, with support for pagination.
List tax codesRetrieves a paginated list of globally available, predefined stripe tax codes used for classifying products and services in stripe tax.
List tax ratesRetrieves a list of tax rates, which are returned sorted by creation date in descending order.
Retrieve BalanceRetrieves the complete current balance details for the connected stripe account.
Retrieve Charge DetailsRetrieves full details for an existing stripe charge using its unique id.
Retrieve customerRetrieves detailed information for an existing stripe customer using their unique customer id.
Retrieve payment intentRetrieves a paymentintent by its id; `client secret` is required if a publishable api key is used.
Retrieve a refundRetrieves details for an existing stripe refund using its unique `refund id`.
Retrieve subscriptionRetrieves detailed information for an existing stripe subscription using its unique id.
Search Stripe customersRetrieves a list of stripe customers matching a search query that adheres to stripe's search query language.
Update CustomerUpdates an existing stripe customer, identified by customer id, with only the provided details; unspecified fields remain unchanged.
Update Payment IntentUpdates a stripe paymentintent with new values for specified parameters; note that if `currency` is updated, `amount` might also be required, and certain updates (e.
Update SubscriptionUpdates an existing, non-canceled stripe subscription by its id, ensuring all referenced entity ids (e.

Universal CLI Commands for Stripe

You can also manually execute CLI commands to interact with your Stripe.

Connect your Stripe account

Link your Stripe account and verify the connection:

bash
# Connect your Stripe account (opens OAuth flow)
composio connected-accounts link stripe

# Verify the connection
composio connected-accounts list --toolkits stripe

Discover Stripe tools

Search and inspect available Stripe tools:

bash
# List all available Stripe tools
composio tools list --toolkit stripe

# Search for Stripe tools by action
composio tools search "stripe"

# Inspect a tool's input schema
composio tools info STRIPE_CANCEL_SUBSCRIPTION

Common Stripe Actions

Cancel subscriptionCancels a customer's active stripe subscription at the end of the current billing period, with options to invoice immediately for metered usage and prorate charges for unused time

bash
composio tools execute STRIPE_CANCEL_SUBSCRIPTION \
  --subscription_id "sub_1OXR5YLkZnJ0gJgX8XjYq7Z7"

Confirm payment intentConfirms a stripe paymentintent to finalize a payment; a `return url` is necessary if the payment method requires customer redirection

bash
composio tools execute STRIPE_CONFIRM_PAYMENT_INTENT \
  --payment_intent_id "pi_1234567890abcdefghijklmn"

Create CustomerCreates a new customer in stripe, required for creating charges or subscriptions; an email is highly recommended for customer communications

bash
composio tools execute STRIPE_CREATE_CUSTOMER \
  --name "Jane Doe" \
  --email "jane.doe@example.com" \
  --phone "+15551234567" \
  --address "{"line1": "123 Main St", "city": "San Francisco", "state": "CA", "postal_code": "94105", "country": "US"}"

Create an invoiceCreates a new draft stripe invoice for a customer; use to revise an existing invoice, bill for a specific subscription (which must belong to the customer), or apply detailed customizations

bash
composio tools execute STRIPE_CREATE_INVOICE \
  --customer "cus_12345ABCDEFGH"

Set up Stripe Triggers

Listen for events in real time using triggers:

Charge Failed TriggerTriggered when a direct charge fails in Stripe's legacy Charges API

bash
# Find your connected account ID
composio connected-accounts list --toolkits stripe

# Create a trigger
composio triggers create STRIPE_CHARGE_FAILED_TRIGGER \
  --connected-account-id <your-connected-account-id> \
  --trigger-config '{}'

# Listen for trigger events in real time
composio triggers listen --toolkits stripe --table

Checkout Session Completed TriggerTriggered when a checkout session is completed in Stripe

bash
# Find your connected account ID
composio connected-accounts list --toolkits stripe

# Create a trigger
composio triggers create STRIPE_CHECKOUT_SESSION_COMPLETED_TRIGGER \
  --connected-account-id <your-connected-account-id> \
  --trigger-config '{}'

# Listen for trigger events in real time
composio triggers listen --toolkits stripe --table

Invoice Payment Succeeded TriggerTriggered when an invoice payment is successful in Stripe

bash
# Find your connected account ID
composio connected-accounts list --toolkits stripe

# Create a trigger
composio triggers create STRIPE_INVOICE_PAYMENT_SUCCEEDED_TRIGGER \
  --connected-account-id <your-connected-account-id> \
  --trigger-config '{}'

# Listen for trigger events in real time
composio triggers listen --toolkits stripe --table

Generate Type Definitions

Generate typed schemas for Stripe tools to get autocomplete and type safety in your project:

bash
# Auto-detect language
composio generate --toolkits stripe

# TypeScript
composio ts generate --toolkits stripe

# Python
composio py generate --toolkits stripe

Tips & Tricks

  • Always inspect a tool's input schema before executing: composio tools info <TOOL_NAME>
  • Pipe output with jq for better readability: composio tools execute TOOL_NAME -d '{}' | jq
  • Set COMPOSIO_API_KEY as an environment variable for CI/CD pipelines
  • Use composio dev logs tools to inspect execution logs and debug issues

Next Steps

  • Try asking your coding agent to perform various Stripe operations
  • Explore cross-app workflows by connecting more toolkits
  • Set up triggers for real-time automation
  • Use composio generate for typed schemas in your projects

How to build Stripe MCP Agent with another framework

FAQ

What is the Composio Universal CLI?

The Composio Universal CLI is a single command-line interface that lets coding agents and developers interact with 850+ SaaS applications. It handles authentication, tool discovery, action execution, and trigger setup — all from the terminal, without needing to configure MCP servers.

Which coding agents work with the Composio CLI?

Any coding agent that can run shell commands works with the Composio CLI — including Claude Code, Codex, OpenCode, OpenClaw, and others. Once the CLI is installed, agents automatically discover and use the composio commands to interact with Stripe and other connected apps.

How is the CLI different from using an MCP server for Stripe?

MCP servers require configuration and can be token-heavy for complex workflows. The CLI gives agents a direct, lightweight interface — no server setup needed. Agents simply call composio commands like any other shell tool. It's faster to set up, more reliable for multi-step tool chaining, and works natively with how coding agents already operate.

How safe is my Stripe data when using the Composio CLI?

All sensitive data such as tokens, keys, and configuration is fully encrypted at rest and in transit. Composio is SOC 2 Type 2 compliant and follows strict security practices so your Stripe data and credentials are handled as safely as possible. You can also bring your own OAuth credentials for full control.

Used by agents from

Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai
Context
Letta
glean
HubSpot
Agent.ai
Altera
DataStax
Entelligence
Rolai

Never worry about agent reliability

We handle tool reliability, observability, and security so you never have to second-guess an agent action.