How to connect Stripe with Claude Code (5 steps)
.png)
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 acts as a secure bridge between Claude Code and Stripe's API.
When you configure a Tool Pack and Registered User, Merge generates a unique MCP URL that Claude Code accesses via HTTP, combined with an API key (generated in Merge Agent Handler) for authentication.
Here's the connection config before you substitute your specific values:
Claude Code sends requests to that MCP URL, and Merge handles authentication and API calls to Stripe on the backend. You don't manage Stripe secret keys locally or rotate credentials across team members. Merge handles token storage and access scoping from here on.
Prerequisites
Before getting started, you'll need the following:
- A Merge Agent Handler account
- Claude Code installed (run <code class="blog_inline-code">
claude --version</code>to confirm) - A Stripe account with API access
Related: A guide to connecting a Salesforce MCP with Claude Code
1. Create a Tool Pack
Log into Merge Agent Handler and navigate to Tool Packs. Click Create Tool Pack and give it a name tied to your use case, like Stripe Billing Agent.

Under connectors, select Stripe. You can choose which tools to enable.

For most billing and debugging workflows, enabling payment intent retrieval, customer lookup, subscription listing, and invoice access covers the common cases. Add write tools like <code class="blog_inline-code">create_refund</code> or <code class="blog_inline-code">cancel_subscription</code> if your agent needs to take action, not just read data.
Save the Tool Pack. You'll return here in step 4 to copy your MCP URL.
2. Add a Registered User
Inside your Tool Pack, create a Registered User. This is the identity context under which your agent operates: the account it acts on behalf of when calling Stripe's API.

Give it a name that maps to your environment, like dev-local or your own name. Once created, Merge generates a unique MCP URL scoped to this user.
3. Authenticate Stripe
From the Registered User detail page, click Add Connector and select Stripe.
Complete the authentication flow to connect your Stripe account.

Once authenticated, Merge stores and manages the credentials. You won't need to re-authenticate unless you revoke access.
4. Gather your credentials
You need two things before configuring Claude Code:
1. MCP URL: found on the Tool Pack detail page under the Registered User you just created. It looks like this:
2. API key: found in Settings > API Keys in your Merge Agent Handler dashboard. Create one if you don't have one yet.
Keep both handy for the next step.
5. Configure Claude Code with Stripe
Run the following command in your terminal, substituting your actual MCP URL and API key:
Verify the connection registered with the command <code class="blog_inline-code">claude mcp list</code>.
<code class="blog_inline-code">agent-handler</code> should appear in the output with a connected status.
To confirm the connector is accessible, open a Claude Code session and run something like "List my failed payment intents from the last 7 days and tell me what the most common decline reason is."
You should 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.
.png)
.png)


.png)
.png)
