How to Set Up and Use the Stripe MCP Server — Complete Guide
Step-by-step guide to the Stripe MCP server. Create products, manage subscriptions, handle invoices, and debug payments from your AI coding assistant.
The Stripe MCP server connects your AI assistant directly to the Stripe API -- products, prices, customers, subscriptions, charges, refunds, and payment links -- all from a single conversation. It is built by the Stripe team and exposes 15 tools covering the full payment lifecycle.
TL;DR: Use a test mode key (
sk_test_), never a live key. Install withnpx -y @stripe/mcp --tools=all. Your assistant can create products, set up subscriptions with trials, debug failed payments, and generate payment links without the Stripe dashboard.
Stripe MCP | npm | Tools: 15 | ~7,725 tokens
graph LR
A[Your Editor] --> B[AI Assistant]
B --> C[Stripe MCP Server]
C --> D[Stripe API]
D --> E[Products / Subscriptions / Charges]
Security: Test Mode vs Live Mode
Use test mode keys (sk_test_) for MCP. Always.
- MCP servers run as local processes -- your secret key is passed as an environment variable to a process on your machine
- AI assistants make mistakes -- they might create unintended products, modify prices, or issue refunds during exploration
- Tool calls are not always predictable -- asking "show recent charges" may also pull customer details and payment methods
- Conversation logs may persist -- test data leaking is irrelevant, customer payment data leaking is a compliance problem
The rule: configure Stripe MCP with sk_test_ keys only. For live data, use the Stripe dashboard or CLI with appropriate access controls. If you absolutely must use a live key for a specific task, create a restricted key with minimum permissions and revoke it immediately after.
For a broader security checklist, see how to secure your MCP server setup.
What the Server Exposes
- Products and pricing: Create products, create prices (one-time or recurring), list and retrieve
- Customers: Create, list, search, retrieve details including payment methods
- Subscriptions: Create, update (plan changes, trials, cancellations), list, retrieve statuses
- Payments and invoices: Create payment links, list charges, retrieve invoices, issue refunds
- Account: Check balance, retrieve account details
Prerequisites
Get a test mode secret key from dashboard.stripe.com/apikeys. It starts with sk_test_.
Setup by Client
Claude Code
{
"mcpServers": {
"stripe": {
"command": "npx",
"args": ["-y", "@stripe/mcp", "--tools=all"],
"env": {
"STRIPE_SECRET_KEY": "sk_test_your_test_key_here"
}
}
}
}
See the full Claude Code setup guide.
Cursor
Create .cursor/mcp.json:
{
"mcpServers": {
"stripe": {
"command": "npx",
"args": ["-y", "@stripe/mcp", "--tools=all"],
"env": {
"STRIPE_SECRET_KEY": "sk_test_your_test_key_here"
}
}
}
}
See the Cursor setup guide.
VS Code (Copilot)
{
"mcp": {
"servers": {
"stripe": {
"command": "npx",
"args": ["-y", "@stripe/mcp", "--tools=all"],
"env": {
"STRIPE_SECRET_KEY": "sk_test_your_test_key_here"
}
}
}
}
}
The --tools=all flag enables the full 15-tool set. Without it, the server starts with a reduced set. Do not commit your Stripe key to version control.
Workflows
Create a SaaS pricing structure
"Create a product called 'Acme Pro' with Starter at $9/month, Growth at $29/month, and Enterprise at $99/month."
- Creates the product, then three recurring prices
- Returns product ID, price IDs, and summary
- Price IDs are what you use in checkout sessions
Set up a subscription with free trial
"Create a test customer with trial-user@example.com. Subscribe them to Starter ($9/month) with a 14-day free trial."
- Creates customer, then subscription with trial period
- Returns subscription ID, status (
trialing), trial end date, first charge date
Debug a failed payment
"List recent charges and show any that failed. For failures, show the reason and customer email."
- Filters charges by failed status
- Retrieves associated customer details
- Shows amount, failure reason (
card_declined,insufficient_funds), and customer email
Create a payment link
"Create a one-time product called 'Lifetime Access' at $199 and generate a payment link."
- Creates product, one-time price, and payment link
- Returns a shareable URL you can use immediately
Review revenue and process refunds
"Show my current balance and the 10 most recent successful charges."
- Retrieves available and pending balance
- Lists charges with amounts, dates, and customer info
- "Refund charge ch_xxx for the full amount" processes the refund in one turn
Token Impact
At ~7,725 tokens (~3.9% of 200K), Stripe MCP has a moderate footprint. Comfortable alongside other servers:
- Stripe + Supabase MCP: ~20,600 tokens -- the core indie hacker stack
- Stripe + Supabase + GitHub MCP: ~30,900 tokens -- full SaaS dev stack
Omit --tools=all for a reduced tool set if you need to save tokens. See how to cut MCP token costs.
Common Gotchas
Test data is separate from live data
Everything created with a sk_test_ key exists only in Stripe's test environment. Products, customers, subscriptions, charges -- none appears in your live dashboard. Recreate your catalog in live mode when ready to launch.
Webhooks still need manual setup
The MCP server handles API calls but does not configure webhook endpoints. You still need to:
- Set up your webhook endpoint in application code
- Register the URL in the Stripe dashboard
- Select events to listen for
- Handle signature verification
For the webhook handler, pairing with Supabase MCP lets you deploy an Edge Function directly from your editor.
Prices are immutable
Once created, a price's amount cannot change. To change a plan's cost, create a new price and archive the old one. This is Stripe's design, not a server limitation.
Currency handling
Amounts use the smallest currency unit (cents for USD). $9.99 is 999, not 9.99. Double-check amounts in responses, especially for non-USD currencies.
Rate limits
100 requests/second in test mode, 25/second for live reads. Conversational usage rarely hits these, but bulk operations can. For more tips, see the MCP troubleshooting guide.
When to Use Stripe MCP vs the Dashboard
Stripe MCP excels at:
- Rapid iteration during early pricing model development
- Exploratory tasks: checking payment statuses, customer lookups
- Multi-step operations: product + prices + payment link in one flow
- Learning the Stripe API conversationally
Dashboard is still better for:
- Visual business metrics, charts, and reports
- Webhook configuration and event monitoring
- Dispute management and evidence submission
- Tax configuration, compliance, and account verification
Pairing with Other Servers
- Supabase MCP: Check a webhook event, query the user in your database, update subscription status, deploy the webhook handler
- Playwright MCP: Create products in Stripe, then test the checkout flow in a real browser
- GitHub MCP: Create billing infrastructure, push integration code, open a PR
This server is a core component of indie hacker and fullstack developer workflows.
Getting Started
Get a test API key, add the config, reload your editor, and try: "Create a product called 'Test' with a $5/month price." The setup takes two minutes and the Stripe dashboard becomes optional for most development tasks.
For a pre-configured stack, see the Indie Hacker Stack or Next.js + Supabase Stack.