Stripe Payments MCP Server
MCP server giving AI agents full Stripe integration — create checkout sessions, manage subscriptions, issue refunds, and query payment data.
Code is provided "as is". Review and test before production use. Terms
Built by AgentBay Official
@agentbay-official
MCP server providing 12 Stripe tools: create_checkout_session, create_subscription, cancel_subscription, create_refund, get_payment, list_payments, create_customer, get_customer, create_price, create_product, get_balance, list_disputes. Handles webhook verification and idempotency keys automatically.
- Add one-time payment checkout to a web app
- Set up recurring subscription billing
- Build a billing dashboard with payment history
- Process refunds programmatically
- Create and manage Stripe products and prices
Step 1: Add STRIPE_SECRET_KEY and STRIPE_WEBHOOK_SECRET to your environment variables
File: .env
Step 2: Add the MCP server to your agent config
File: mcp.json
{
"mcpServers": {
"stripe": {
"command": "node",
"args": ["./node_modules/@agentbay/stripe-mcp/dist/index.js"],
"env": { "STRIPE_SECRET_KEY": "${STRIPE_SECRET_KEY}" }
}
}
}Step 3: Set up the webhook endpoint in your app to handle Stripe events
File: src/routes/webhooks.ts
app.post("/webhooks/stripe", express.raw({type: "application/json"}), handleStripeWebhook)create_checkout_session(priceId: string, successUrl: string, cancelUrl: string) => SessionCreates a Stripe Checkout session
create_checkout_session("price_xxx", "/success", "/cancel")create_subscription(customerId: string, priceId: string) => SubscriptionCreates a recurring subscription
create_subscription("cus_xxx", "price_xxx")- Do not store raw Stripe secret keys in client-side code
- Do not skip webhook signature verification in production
- Do not create duplicate customers — always check by email first
- Requires Stripe account with API keys
- Connect/marketplace payouts not included — use the Stripe Connect module instead
- Currency limited to what your Stripe account supports
STRIPE_SECRET_KEYRequiredSensitiveYour Stripe secret API keySTRIPE_WEBHOOK_SECRETRequiredSensitiveWebhook signing secret from Stripe dashboardFindings (12)
- -Documentation claims 12 tools but code implements only 8 tools. Missing: create_refund, get_payment, list_payments, create_price, create_product, get_balance, list_disputes
- -Documentation claims tool 'create_checkout_session' signature is (priceId, successUrl, cancelUrl) but actual implementation requires additional parameters: quantity, customer_email. Documentation example is incomplete.
- -Documentation states 'Handles webhook verification and idempotency keys automatically' but code contains no webhook verification or idempotency key handling.
- -Documentation claims tool 'create_payment_intent' but README only lists 'stripe_create_payment_intent' with underscore prefix. Tool naming convention inconsistency not documented.
- -Documentation lists 'get_payment' and 'list_payments' as available tools but code implements 'stripe_get_payment_intent' which only retrieves PaymentIntent, not generic payments.
- +7 more findings
Suggestions (8)
- -Update summary to accurately reflect 8 implemented tools, not 12. Remove claims about webhook verification and idempotency keys if not implementing them.
- -Correct API reference examples for create_checkout_session to show all 5 parameters with proper descriptions.
- -Add try-catch error handling to all tool implementations to gracefully handle Stripe API errors and invalid inputs.
- +5 more suggestions