Commerce

Connect Stripe to AI Agents

Connect Stripe with a read-only restricted key and ask about revenue, MRR, subscriptions, payments, refunds, disputes and payouts in plain English. Claude, ChatGPT, Claude Code and any other MCP client answer from your own account, and if you have Stripe Sigma they can run SQL over your data too.

What you'll need

  • A Stripe account where you can create restricted keys, under Developers and then API keys.
  • A key with Read on the resources you want your agent to see. Customers, Charges, Subscriptions, Invoices, Balance and Payouts cover most questions.
  • Optional: a Stripe Sigma subscription, and Read on Financial Reports, if you want SQL queries.

Stripe connects with that restricted key, which starts with rk_live_ or rk_test_. A full secret key is refused on purpose, because a restricted key can be limited to Read and a secret key cannot. Every operation only reads from your account.

Connect it

Create a restricted key
In Stripe, open Developers, then API keys, and choose Create restricted key.
Set its permissions
Set Read on the resources you want your agent to see and leave everything else on None. Copy the key when Stripe shows it, because Stripe only shows it once. Leave IP address restrictions off, since requests from SourcetoMCP are blocked if the key is limited to certain addresses.
Open Connectors
In your SourcetoMCP dashboard, go to Connectors and choose Add Connection, then Stripe.
Paste your key
SourcetoMCP verifies it against your Stripe account. A key starting with rk_test_ connects your test data and one starting with rk_live_ connects real payments. You can connect both, and they show as separate connections.
Confirm
The connection shows up as Connected in your Connectors table. Ask your agent which resources your key can read to see exactly what it was given.

Nothing in your Stripe account can be changed. Every request your agent makes counts towards your account's own read allowance, so SourcetoMCP counts them, reports the number with each answer and stops at 3,000 requests a day across Stripe operations. Sigma queries run read-only SQL and leave a query record in your account for 90 days. They stop at 20 a day.

Try it

  • "What was net revenue last month after refunds and Stripe fees?"
  • "What is our MRR today, and which price brings in the most?"
  • "Which subscriptions are past due?"
  • "Why are payments failing, and is the success rate falling?"
  • "Which disputes are due for evidence in the next seven days?"
  • "How many new customers did we add each week this quarter?"
  • "Which refunds over $200 were issued this quarter?"
  • "Run a Sigma query for churn by plan by signup month."

Join it with other sources

"Compare Stripe revenue by week with Google Ads spend for the same weeks, in one thread."

Troubleshooting

SymptomLikely fix
The key is refused as a full-access secret keyStripe secret keys start with sk_. Create a restricted key with Read only and paste that one. Publishable keys (pk_) and webhook secrets (whsec_) are refused too.
An answer says the key lacks permissionThe key has no Read on that resource. Edit its permissions in Stripe, then ask again. There is nothing to reconnect, and asking your agent which resources the key can read lists them all.
The connection shows Needs attentionStripe says the key is invalid, expired or revoked. Create a new restricted key and reconnect.
Sigma says it needs a subscriptionSigma queries need your own Sigma subscription from Stripe and a key with Read on Financial Reports. A slow query returns a query run ID first, so ask your agent for the result a moment later.
The daily request budget has been reachedSourcetoMCP stops at 3,000 Stripe requests a day to protect your read allowance. Try again tomorrow. Narrower date ranges use fewer requests, and every answer reports how many it used.
Revenue differs from the Stripe dashboardRevenue is built from your balance transactions, with days taken in your account's time zone. A dashboard report built on invoice dates or accrual can differ. MRR is before discounts and tax and is a snapshot of today.

Related