Manage Stripe Payments and Customers
An MCP server for Stripe customer, payment, and refund operations with built-in audit logging.
Why it matters
Integrate with Stripe to securely manage financial transactions, including customer creation, payment processing, and refunds, with comprehensive audit logging for enhanced traceability.
Outcomes
What it gets done
Create and manage Stripe customers.
Process payments and generate payment intents.
Initiate refunds for completed charges.
Maintain an audit log of all financial operations.
Install
Add it to your toolbox
Run in your project directory:
curl -fsSL https://spark.entire.vc/get/vb-stripe | bash Capabilities
Tools your agent gets
Create a new customer
Get customer data
Update customer information
Create a payment intent for payment processing
Show a list of recent charges
Create a refund for a charge
Overview
Stripe MCP Server
An MCP server that manages Stripe customers, payments, and refunds through structured tools with built-in audit logging. Use when an MCP client needs to create Stripe customers, payment intents, or refunds through a structured tool interface.
What it does
An MCP server that integrates with Stripe for payments, customers, and refunds, giving an MCP client a structured, auditable API for financial transactions. It exposes six tools across three areas: customer management (customer_create, customer_retrieve, customer_update), payment operations (payment_intent_create, charge_list), and refunds (refund_create). Every operation is written to an audit log via MCP resource endpoints, with structured logging for traceability across customer, payment, and refund actions, and clear error messages for common failure cases: a missing STRIPE_API_KEY, an invalid key (authentication error), an invalid customer ID, or missing/incorrect tool arguments. The project is MIT-licensed.
When to use - and when NOT to
Use it when an MCP client needs to create or look up Stripe customers, create payment intents, list recent charges, or issue refunds through a structured tool interface rather than calling the Stripe API directly. It requires Python 3.8+, MCP SDK 0.1.0+, the Stripe Python SDK, dotenv, and a STRIPE_API_KEY set via .env - since it handles real payment and refund operations, it's the kind of connector that should be scoped to an authorized, trusted environment rather than exposed to arbitrary end users, given that a misdirected refund_create or payment_intent_create call moves real customer money.
Inputs and outputs
{
"tool": "payment_intent_create",
"arguments": {
"amount": 5000,
"currency": "usd",
"customer": "cus_123456"
}
}
The example above creates a payment intent for a 5000-cent (fifty-dollar) USD charge against an existing customer. Each tool call takes a small set of named arguments (e.g. email/name for customer_create, customer_id for customer_retrieve, amount/currency/customer for payment_intent_create, charge_id for refund_create) and returns the corresponding Stripe object or a structured error. Audit-log resources are retrievable via MCP resource endpoints for after-the-fact traceability of every operation.
How to install
Install via Smithery (npx -y @smithery/cli install @atharvagupta2003/mcp-stripe --client claude) or manually: create a virtualenv, pip install -e ., and set STRIPE_API_KEY in a .env file. Add an mcpServers entry to Claude Desktop's config pointing command at uv with --directory <path> run server.py, then start the server with uv run src/server.py. For interactive testing, run the MCP Inspector: npx @modelcontextprotocol/inspector uv --directory <path> run server.py. To build the package from source, update dependencies with uv compile pyproject.toml and produce a build with uv build.
Who it's for
Developers building an AI assistant that needs to manage Stripe customers, payments, and refunds through a structured, audited tool interface instead of hand-rolling Stripe API calls, and who want the same server's MCP Inspector workflow available for interactive debugging during development.
Source README
MCP Stripe Server
A Model Context Protocol (MCP) server implementation that integrates with Stripe for handling payments, customers, and refunds. This server provides a structured API to manage financial transactions securely.
Demo
Requirements
- Python 3.8+
- MCP SDK 0.1.0+
- Stripe Python SDK
- dotenv
Components
Resources
The server provides audit logging of all Stripe operations:
- Stores audit logs of customer, payment, and refund operations
- Supports structured logging for better traceability
- Uses MCP resource endpoints to retrieve audit data
Tools
The server implements Stripe API operations, including:
Customer Management
- customer_create: Create a new customer
- customer_retrieve: Retrieve a customer's details
- customer_update: Update customer information
Payment Operations
- payment_intent_create: Create a payment intent for processing payments
- charge_list: List recent charges
Refund Operations
- refund_create: Create a refund for a charge
Features
- Secure Payments: Integrates with Stripe for robust payment handling
- Audit Logging: Keeps track of all Stripe transactions
- Error Handling: Comprehensive error handling with clear messages
- MCP Integration: Supports MCP-compatible tools and resource listing
Installation
Installing via Smithery
To install Stripe Server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @atharvagupta2003/mcp-stripe --client claude
Install dependencies
python -m venv venv
source venv/bin/activate # On macOS/Linux
venv\Scripts\activate # On Windows
pip install -e .
Configuration
Set up the environment variables in a .env file:
STRIPE_API_KEY=your_stripe_secret_key
Claude Desktop
Add the server configuration to your Claude Desktop config:
Windows: C:\Users<username>\AppData\Roaming\Claude\claude_desktop_config.json
MacOS: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"stripe": {
"command": "uv",
"args": [
"--directory",
"/ABSOLUTE/PATH/TO/PARENT/FOLDER/src",
"run",
"server.py"
]
}
}
}
Usage
Start the server
uv run src/server.py
Example MCP Commands
Create a customer
{
"tool": "customer_create",
"arguments": {
"email": "customer@example.com",
"name": "John Doe"
}
}
Retrieve a customer
{
"tool": "customer_retrieve",
"arguments": {
"customer_id": "cus_123456"
}
}
Create a payment intent
{
"tool": "payment_intent_create",
"arguments": {
"amount": 5000,
"currency": "usd",
"customer": "cus_123456"
}
}
Create a refund
{
"tool": "refund_create",
"arguments": {
"charge_id": "ch_abc123"
}
}
Error Handling
The server provides clear error messages for common scenarios:
- Missing API Key: STRIPE_API_KEY required
- Invalid API Key: Authentication error
- Customer not found: Invalid customer ID
- Invalid input: Missing or incorrect parameters
Development
Testing
Run the MCP Inspector for interactive testing:
npx @modelcontextprotocol/inspector uv --directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/src run server.py
Building
- Update dependencies:
uv compile pyproject.toml
- Build package:
uv build
FAQ
Common questions
Discussion
Questions & comments ยท 0
Sign In Sign in to leave a comment.