We use cookies to improve your experience on our site. By clicking “Accept”, you are agreeing to the collection and use of data as described in our Privacy Policy.
We use cookies to improve your experience on our site. By using our site, you are agreeing to the collection and use of data as described in our Privacy Policy.
Developers building billing logic, subscription workflows, or payment integrations spend a lot of time in two places at once: the terminal and the Stripe dashboard.
Debugging a failed charge means looking up the payment intent. Validating subscription state means checking the customer record. Testing a refund flow means cross-referencing the original charge. Every one of those lookups is a context switch.
To help your developers query and act on Stripe data directly from their coding session, we'll show you how to connect Stripe with Merge Agent Handler's Stripe MCP server.
How it works
Merge Agent Handler connects Claude Code to Stripe's API through a single CLI setup. You install the Merge CLI, authenticate once, and register the connection with one command. Agent Handler manages your Stripe credentials so you don't keep secret keys in your local environment or embed them in your codebase.
To confirm the connection is working, open a Claude Code session and try: "List my failed payment intents from the last 7 days and tell me what the most common decline reason is."
On first use, a Magic Link will appear to finish connector authentication.
You should then see a response like the following:
{{this-blog-only-cta}}
Stripe MCP FAQ
In case you have more questions on setting up and using the Stripe MCP in Claude Code, we've addressed several more commonly-asked questions below.
What can you do once the Stripe MCP is connected to Claude Code?
With Stripe connected, Claude Code can:
Retrieve and search payment intents: pull up payment intent status, decline codes, and metadata without opening the dashboard or writing a one-off API call
Look up customers and subscriptions: fetch customer records, active subscriptions, and payment method details from within a coding session
List and inspect invoices: retrieve invoice status, line items, and payment history for any customer to validate billing logic against real data
Create and track refunds: issue refunds and check their status directly from the terminal, useful when testing cancellation or return flows
Pull balance and payout data: check current balance, review payout schedules, and list recent balance transactions to verify settlement behavior
Search charges by customer or date range: surface recent charges filtered by status or metadata to debug a specific transaction or audit a billing run
Why use Merge Agent Handler vs. a self-hosted Stripe MCP server?
You can build a self-hosted MCP server that calls Stripe's API directly. For a solo developer working against a test mode account, that's a workable starting point. You store a secret key, write tool schemas for the endpoints you need, and connect it to Claude Code.
The problem is what happens when more than one person needs access, or when you're working against live mode data.
Stripe secret keys carry full account access by default. Sharing them across developers, or handing one to an agent with no access controls on top, means the agent can read customer PII, issue refunds, cancel subscriptions, or pull balance data, whether or not your use case requires it. There's no audit trail of what the agent did, and revoking a key breaks everyone using it.
Merge Agent Handler sits between Claude Code and Stripe. You define exactly which tools each Tool Pack exposes, so a read-only reporting agent never gets a <code class="blog_inline-code">create_refund</code> tool. Every call is logged with the tool name, inputs, and response metadata. And each developer or environment gets its own Registered User with its own scoped credentials, so access is isolated and revocable without touching anyone else's setup.
For teams building agents against live Stripe data, the per-developer credential problem and the lack of access controls are the failure modes that matter. Merge Agent Handler addresses both.
Why connect Stripe to Claude Code?
Stripe is the source of truth for revenue data. Every charge, subscription, invoice, and payout lives there, and developers building billing agents, RevOps tooling, or payment debugging workflows need to reach it constantly. Right now that means a browser tab, a Stripe CLI command, or a throwaway script.
With the Stripe MCP connected, Claude Code can query payment intents, pull subscription state, and surface customer billing history without leaving the terminal.
That changes how debugging works: instead of tracing a failed payment across logs, a webhook event, and a manual API call to reconstruct the charge, you can ask Claude Code to pull the payment intent directly and explain what happened.
It also changes how testing works: agents validating billing logic can check live Stripe state mid-session rather than relying on fixtures that may not reflect production behavior.
Jon Gitlin
Senior Content Marketing Manager
@Merge
Jon Gitlin is the Managing Editor of Merge's blog. He has several years of experience in the integration and automation space; before Merge, he worked at Workato, an integration platform as a service (iPaaS) solution, where he also managed the company's blog. In his free time he loves to watch soccer matches, go on long runs in parks, and explore local restaurants.
Read more
Introducing the Universal Context Layer: a company brain that works with every AI tool and agent
Product
Instantly cut token spend in half: introducing Merge for Workforce