Skip to main content
Glama
DanFrModa

Stripe MCP Server

by DanFrModa

Stripe MCP Server

MCP (Model Context Protocol) server that exposes the Stripe API to Claude. Designed to be deployed on Railway in read-only mode.

👉 Deployment steps are in DEPLOY-RAILWAY.md.


What it does

Gives Claude 17 tools to query Stripe: customers, charges, payments, subscriptions, invoices, catalog, balance, transactions, payouts, events, and disputes — plus a generic tool that hits any endpoint, another that resolves any object by its id, and an aggregated revenue report.

Tool

Endpoint

stripe_whoami

verifies the key, mode, and permissions

stripe_request

any endpoint, any method

stripe_get_object

resolves any id (cus_, ch_, sub_...)

stripe_search

GET /v1/{resource}/search

stripe_list_customers

GET /v1/customers

stripe_list_charges

GET /v1/charges

stripe_list_payment_intents

GET /v1/payment_intents

stripe_list_subscriptions

GET /v1/subscriptions

stripe_list_invoices

GET /v1/invoices

stripe_list_products

GET /v1/products

stripe_list_prices

GET /v1/prices

stripe_get_balance

GET /v1/balance

stripe_list_balance_transactions

GET /v1/balance_transactions

stripe_list_payouts

GET /v1/payouts

stripe_list_events

GET /v1/events

stripe_list_disputes

GET /v1/disputes

stripe_revenue_summary

pages and sums gross/fees/net


Related MCP server: Stripe MCP Server

Environment variables

Variable

Required

Default

Description

STRIPE_API_KEY

yes

Restricted key (rk_...) or secret key (sk_...)

STRIPE_MCP_TRANSPORT

on Railway

stdio

http for remote server

MCP_AUTH_TOKEN

if http

Secret protecting the endpoint. Minimum 32 characters

STRIPE_READ_ONLY

no

see below

1 blocks all writes

STRIPE_ALLOW_LIVE_WRITES

no

0

Second gate: writes with live key

STRIPE_API_BASE

no

https://api.stripe.com

To point to a mock

STRIPE_API_VERSION

no

Sets the Stripe-Version header

STRIPE_ACCOUNT

no

Connect account (acct_...) for all calls

STRIPE_MAX_CHARS

no

20000

Response truncation

STRIPE_TIMEOUT

no

45

Timeout in seconds

PORT

no

8000

Railway injects it automatically


The three write gates

Stripe moves real money: a wrong POST refunds a customer, cancels a subscription, or deletes a record forever. That's why there are three independent locks, and a write has to pass through all three.

1. STRIPE_READ_ONLY — the default depends on the transport

  • stdio (local): writes allowed by default. A single trusted user on their own machine.

  • http (remote): writes blocked by default. You have to set STRIPE_READ_ONLY=0 deliberately to enable them.

Forgetting the variable on a public deployment leaves it read-only, not open.

2. STRIPE_ALLOW_LIVE_WRITES — the live-mode gate

Even if you turn off read-only, a live key still rejects writes until you set STRIPE_ALLOW_LIVE_WRITES=1. Test keys (sk_test_, rk_test_) don't go through this gate: experimenting against test data shouldn't require ceremony.

3. confirm=true — the per-endpoint gate

Destructive endpoints (/v1/refunds, /v1/payouts, /v1/transfers, subscription cancellations, customer deletion, dispute closure) require confirm=true in the call, in addition to everything above. A tool triggered by mistake doesn't get there on its own.

Each rejection says which of the three gates stopped it.


Endpoint authentication

The MCP protocol doesn't come with its own authentication. In http mode, this server requires Authorization: Bearer <MCP_AUTH_TOKEN> on every request, or the secret embedded in the path (/s/<secret>/mcp) for Claude connectors. /healthz is the only public route.

The server refuses to start if MCP_AUTH_TOKEN is missing or shorter than 32 characters. That's intentional: it prevents publishing an open gateway to your Stripe account by accident.


Running locally

pip install -r requirements.txt

# stdio (para Claude Desktop)
STRIPE_API_KEY=rk_test_xxx python stripe_mcp.py

# http (como en Railway)
STRIPE_MCP_TRANSPORT=http \
STRIPE_API_KEY=rk_test_xxx \
MCP_AUTH_TOKEN=$(python3 -c "import secrets;print(secrets.token_urlsafe(48))") \
PORT=8000 python stripe_mcp.py

On startup it prints which mode it ended up in:

[stripe-mcp] streamable-http on 0.0.0.0:8000  mode=test  read_only=True  allow_live_writes=False  writes_enabled=False

Notes on the Stripe API

Things the server already handles for you, and that are good to know when reading responses:

  • Stripe doesn't accept JSON in the body. Everything goes application/x-www-form-urlencoded with bracket notation: metadata[order]=6735, expand[]=customer, items[0][price]=price_1. The server translates nested dicts and lists only.

  • Money is an integer in the smallest unit. 2500 with usd is $25.00. And there are zero-decimal currencies (JPY, KRW, CLP…) where the integer is the amount — dividing by 100 there would be a mistake. Formatted outputs respect that.

  • Test and live are separate universes. An id created in test returns 404 with a live key and vice versa. That's the most common cause of a 404 with a correct id.

  • Pagination is cursor-based, not page-based. The last id is taken and passed as starting_after. When there's more, the response includes next_page_hint with the exact value.

  • There's no PATCH or PUT. Stripe uses POST for both creating and updating. Only GET, POST, and DELETE.

  • Lists don't filter by status on charges or payment_intents. You have to filter over the returned records or use stripe_search.

  • stripe_list_subscriptions omits canceled ones by default. For churn questions you have to pass status='all' or the answer comes out wrong silently.

  • The search index takes up to a minute to see a newly created object. For new objects, look them up by id.

  • Events are only kept for 30 days. For anything older, go to the objects.

  • There's no aggregation endpoint. That's why stripe_revenue_summary pages and sums on the MCP server side, and warns with complete=false when the page cap cut off the count — those totals are partial and shouldn't be reported as final.

  • Each POST goes out with an Idempotency-Key, so a retry doesn't charge twice. Stripe remembers them for 24 hours.


Security

  • Secrets go in environment variables, never in code. The .gitignore blocks .env files.

  • Use a restricted key (rk_...), not the secret key. You can create as many as you want in the dashboard and give them per-resource permissions. For this deployment: everything Read, nothing Write. An sk_live_ gives full access to the account, including moving money.

  • A single shared token means zero per-person traceability. Anything anyone does is logged as the same key.

  • There's no rate limiting of its own. Whoever has the MCP_AUTH_TOKEN can hit Stripe until they run into Stripe's limit (~100 read req/s on live).

  • To cut off access at once: delete the restricted key at https://dashboard.stripe.com/apikeys — the server becomes useless instantly.

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables Claude to connect to and interact with SQLite, SQL Server, PostgreSQL, and MySQL databases through natural language. Supports executing queries, managing tables, exporting data, and storing business insights with authentication options including AWS IAM.
    853
    MIT
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables natural language interaction with Stripe accounts to query customers, revenue, invoices, subscriptions, disputes, and issue refunds.
    59
    1
    MIT
  • A
    license
    C
    quality
    D
    maintenance
    Enables Claude to integrate with Stripe for creating payment links, processing payments, and managing products and customers.
    17
    59
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables integration with Stripe APIs through function calling, supporting operations on customers, products, invoices, subscriptions, and more.
    10,572
    MIT

View all related MCP servers

Related MCP Connectors

  • Read-only bank access for your AI agent. Connects Claude, ChatGPT, Cursor, Gemini, Codex.

  • Connect your team's living knowledge base — docs, data, issues, CRM — to Claude and ChatGPT.

  • WHOOP recovery, strain, sleep and workouts in Claude via official WHOOP OAuth. Free, open source.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/DanFrModa/Stripe-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server