Python and TypeScript library for integrating the Stripe API into agentic workflows (OpenAI Agent SDK, LangChain, CrewAI, Vercel AI-SDK, MCP, etc.)
Setup guide, usage examples, and detailed information
Transform your AI agents into payment processing powerhouses with Stripe's official MCP server integration.
Every developer building AI agents faces the same challenge: bridging the gap between conversational AI and real-world business operations. While your agents can discuss products, handle customer inquiries, and process orders, they hit a wall when it comes to actually executing payments, managing subscriptions, or handling refunds.
The Stripe Agent Toolkit MCP Server eliminates this friction entirely, giving your AI agents direct access to Stripe's battle-tested payment infrastructure through a secure, schema-driven interface.
Skip weeks of payment API integration work. Get your agents processing payments in minutes with pre-built MCP tools that handle authentication, error handling, and rate limiting automatically.
Built on Stripe's enterprise-grade infrastructure with automatic retries, idempotency keys, and comprehensive error handling. Your agents inherit the same reliability that powers millions of businesses worldwide.
Works seamlessly with your existing agent stack:
Access the full spectrum of payment functionality through AI-friendly tools:
// Agent creates payment links on-demand during customer conversations const toolkit = new StripeAgentToolkit({ secretKey: process.env.STRIPE_SECRET_KEY, configuration: { actions: { paymentLinks: { create: true }, products: { create: true, list: true }, customers: { create: true } } } });
Your agent can instantly create custom payment links, set up new products, and onboard customers—all within a single conversation flow.
from stripe_agent_toolkit.openai.toolkit import StripeAgentToolkit stripe_toolkit = StripeAgentToolkit( secret_key="sk_live_...", configuration={ "actions": { "subscriptions": { "list": True, "update": True, "cancel": True } } } )
Let your agents handle subscription upgrades, downgrades, and cancellations based on customer requests, automatically applying prorations and handling billing cycles.
Enable agents to provide real-time financial insights, process refunds for customer service scenarios, and handle dispute management—all while maintaining audit trails and compliance.
Get running in 30 seconds:
# One-line MCP server deployment npx -y @stripe/mcp --tools=all --api-key=YOUR_STRIPE_SECRET_KEY
Or integrate directly into your codebase:
import { StripeAgentToolkit } from "@stripe/agent-toolkit/modelcontextprotocol"; const server = new StripeAgentToolkit({ secretKey: process.env.STRIPE_SECRET_KEY, configuration: { actions: { paymentLinks: { create: true }, customers: { create: true, list: true }, subscriptions: { list: true, update: true } } } });
The toolkit seamlessly fits into modern AI development patterns:
// LangChain integration const tools = stripeAgentToolkit.getTools(); const agent = await createStructuredChatAgent({ llm, tools, prompt }); // OpenAI Agent SDK const stripeAgent = Agent({ name: "Payment Processor", instructions: "Handle all payment operations securely", tools: stripe_agent_toolkit.get_tools() }); // Vercel AI SDK with automatic billing const model = wrapLanguageModel({ model: openai("gpt-4o"), middleware: stripeAgentToolkit.middleware({ billing: { customer: "cus_123", meters: { input: "input_tokens" }} }) });
Ready to supercharge your AI agents with payment intelligence? The Stripe Agent Toolkit MCP Server is your fastest path from prototype to production-ready payment automation.
Get started: npm install @stripe/agent-toolkit
or pip install stripe-agent-toolkit
npm install @stripe/agent-toolkit # or
yarn add @stripe/agent-toolkit # or
pnpm add @stripe/agent-toolkit
export STRIPE_API_KEY=sk_test_...
import { StripeAgentToolkit } from "@stripe/agent-toolkit";
const toolkit = new StripeAgentToolkit({
apiKey: process.env.STRIPE_API_KEY,
});
pip install stripe-agent-toolkit
from stripe_agent_toolkit import StripeAgentToolkit
toolkit = StripeAgentToolkit(api_key="sk_test_...")