mcpField
M
mcp-stripe

mcp-stripe

Local
github.com/codesparFinance275Updated 5w ago

About mcp-stripe

@codespar/mcp-stripe is an MCP server for Stripe's standard payments API, aimed at SaaS teams that already accept payments through Stripe and want agents to work within that stack. It wraps the regular API rather than Stripe's Agentic Commerce Protocol.

Key features

  1. 0130 tools covering Stripe payment operations
  2. 02PaymentIntents, refunds and payment links
  3. 03Customers, products, prices and subscriptions
  4. 04Invoice creation, sending and payment collection
  5. 05Optional API version pinning via environment variable

Use cases

  1. 01Handling subscription changes and refunds through an agent
  2. 02Creating invoices and following up on open payments
  3. 03Reviewing disputes and submitting evidence

MCP support

This project is an MCP server that exposes Stripe's standard payment, refund, customer, subscription and invoice tools to MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-stripe": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-stripe"
],
"env": {
"STRIPE_SECRET_KEY": "<STRIPE_SECRET_KEY>",
"STRIPE_API_VERSION": "<STRIPE_API_VERSION>"
}
}
}
}
Run commandnpx -y @codespar/mcp-stripe
Environment variables to set
STRIPE_SECRET_KEYSecretStripe secret key (sk_test_... for test mode, sk_live_... for live mode). The key prefix selects the environment — no separate base URL.
STRIPE_API_VERSIONOptional Stripe API version to pin via the Stripe-Version header (e.g. '2024-06-20'). When omitted, Stripe uses the account's default version.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-stripe0.2.2

Tools

30

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
amountnumberYesAmount in the smallest currency unit (e.g. cents for USD, centavos for BRL)
confirmbooleanNoIf true, confirm the PaymentIntent immediately
currencystringYesISO-4217 currency code (usd, brl, mxn, eur, ...)
customerstringNoStripe customer id (cus_...) to attach this intent to
metadataobjectNoArbitrary key-value metadata
descriptionstringNoHuman-readable description
receipt_emailstringNoEmail address to send a receipt to
capture_methodenumNomanual = authorize only; capture laterautomatic | automatic_async | manual
payment_methodstringNoPaymentMethod id (pm_...) to charge
payment_method_typesarrayNoAllowed method types, e.g. ['card','pix','boleto']
statement_descriptorstringNoUp to 22 chars appearing on the customer's statement
automatic_payment_methodsobjectNoe.g. { enabled: true } to let Stripe pick methods from the Dashboard

Details

From the project README

@codespar/mcp-stripe

MCP server for Stripe — global standard-bearer payments API

npm License: MIT

Stripe vs. Stripe ACP

Two Stripe MCP servers live in the CodeSpar catalog — different products:

PackageWrapsWhen to use
@codespar/mcp-stripe (this package)Stripe's regular payments API (PaymentIntents, Checkout, Billing)You are already using Stripe to accept payments today — the 99% case for LatAm SaaS that ship with Stripe.
@codespar/mcp-stripe-acpStripe's Agentic Commerce ProtocolYou are building on Stripe's new agent-native checkout spec. Much narrower product, bleeding edge.

If you are a typical SaaS with Stripe as your PSP, this is the package.

Why Stripe in the CodeSpar catalog?

Stripe is the global standard-bearer for developer-first payments. Nearly every LatAm SaaS that bills international cards ships with Stripe — Truora, Platzi, Rappi Pay (for some flows), countless Y Combinator LatAm companies. Adding Stripe lets agents operate the payments stack those SaaS already run, without forcing a migration to a local-first gateway.

Quick Start

Claude Desktop

Add to ~/.config/claude/claude_desktop_config.json:

{
  "mcpServers": {
    "stripe": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-stripe"],
      "env": {
        "STRIPE_SECRET_KEY": "sk_test_..."
      }
    }
  }
}
Claude Code
claude mcp add stripe -- npx @codespar/mcp-stripe
Cursor / VS Code

Add to .cursor/mcp.json or .vscode/mcp.json:

{
  "servers": {
    "stripe": {
      "command": "npx",
      "args": ["-y", "@codespar/mcp-stripe"],
      "env": {
        "STRIPE_SECRET_KEY": "sk_test_..."
      }
    }
  }
}

Tools (30)

ToolPurpose
create_payment_intentCreate a PaymentIntent — Stripe's modern primitive for charging a customer.
confirm_payment_intentConfirm a PaymentIntent created with confirm=false.
retrieve_payment_intentRetrieve a PaymentIntent by id.
cancel_payment_intentCancel a PaymentIntent.
list_payment_intentsList PaymentIntents.
create_refundRefund a charge or a PaymentIntent.
list_refundsList Refunds.
create_customerCreate a Stripe Customer.
retrieve_customerRetrieve a Customer by id.
update_customerUpdate a Customer.
create_productCreate a Product — the catalog entity Prices reference.
list_productsList Products.
create_priceCreate a Price attached to a Product.
list_pricesList Prices.
create_subscriptionCreate a Subscription for an existing customer.
update_subscriptionUpdate a Subscription.
cancel_subscriptionCancel a Subscription.
list_subscriptionsList Subscriptions.
create_checkout_sessionCreate a hosted Checkout Session.
create_payment_linkCreate a long-lived Payment Link (shareable URL) that charges a price or set of line items.
list_payment_linksList Payment Links.
create_invoiceCreate an Invoice draft for a customer.
list_invoicesList Invoices.
finalize_invoiceFinalize a draft Invoice.
send_invoiceSend a finalized Invoice to the customer by email.
pay_invoiceAttempt to collect payment on an open Invoice.
void_invoiceVoid a finalized Invoice.
update_disputeSubmit evidence on a Dispute.
list_disputesList Disputes.
retrieve_balanceRetrieve the current Stripe account balance — available, pending, and connect_reserved funds broken down by...

Authentication

Stripe uses a single secret key. The key prefix selects the environment:

  • sk_test_... → test mode (no real money moves)
  • sk_live_... → live mode

There is no separate base URL — the key itself routes requests. Set STRIPE_SECRET_KEY and you are done.

Request bodies are application/x-www-form-urlencoded with bracket notation (customer[name]=Foo, metadata[order]=123, expand[]=latest_invoice). This server handles nested objects and arrays for you.

Pinning an API version

Stripe auto-upgrades breaking changes on a calendar cadence. If you want to lock the version your agent sees, set STRIPE_API_VERSION (e.g. 2024-06-20). The server passes it as the Stripe-Version header on every call.

Environment Variables

VariableRequiredDescription
STRIPE_SECRET_KEYYessk_test_... or sk_live_... from Stripe Dashboard > Developers > API keys
STRIPE_API_VERSIONNoPin API version via the Stripe-Version header (e.g. 2024-06-20)

Sandbox / Testing

Every Stripe account has test mode built in — no separate signup. Use a sk_test_... key and any of Stripe's test cards (e.g. 4242 4242 4242 4242).

Get your credentials
  1. Sign up at stripe.com
  2. Go to Dashboard > Developers > API keys
  3. Copy your Secret key (test mode by default)
  4. Set STRIPE_SECRET_KEY

Roadmap

v0.2 (planned)
  • update_payment_intent, capture_payment_intent (separate capture)
  • retrieve_refund, list_refunds
  • list_customers, search_customers
  • update_subscription, retrieve_subscription
  • retrieve_invoice, finalize_invoice, pay_invoice, send_invoice, void_invoice
  • create_invoice_item, list_invoice_items
  • create_price, create_product
  • list_charges, retrieve_charge
  • retrieve_dispute, close_dispute, list_disputes
v0.3 (planned)
  • Stripe Connect: accounts, account links, transfers, payouts
  • create_setup_intent, confirm_setup_intent (saving cards for later)
  • PaymentMethod attach / detach / list
  • Webhook event construction helper

Want a tool sooner? Open an issue or PR.

Links

Enterprise

Need governance, spend caps, and audit trails for agent-initiated charges, refunds, and subscription changes? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.