MCP Now
Stripe

Stripe

by atharvagupta2003
GitHub

This MCP allows integration with Stripe for handling payments, customers, and refunds.

customer
server
payment
stripe
tool

MCP Stripe Server

smithery badge

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

stripe_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:

1npx -y @smithery/cli install @atharvagupta2003/mcp-stripe --client claude

Install dependencies

1python -m venv venv 2source venv/bin/activate # On macOS/Linux 3venv\Scripts\activate # On Windows 4pip install -e .

Configuration

Set up the environment variables in a .env file:

1STRIPE_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

1uv run src/server.py

Example MCP Commands

Create a customer

1{ 2 "tool": "customer_create", 3 "arguments": { 4 "email": "[email protected]", 5 "name": "John Doe" 6 } 7}

Retrieve a customer

1{ 2 "tool": "customer_retrieve", 3 "arguments": { 4 "customer_id": "cus_123456" 5 } 6}

Create a payment intent

1{ 2 "tool": "payment_intent_create", 3 "arguments": { 4 "amount": 5000, 5 "currency": "usd", 6 "customer": "cus_123456" 7 } 8}

Create a refund

1{ 2 "tool": "refund_create", 3 "arguments": { 4 "charge_id": "ch_abc123" 5 } 6}

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:

1npx @modelcontextprotocol/inspector uv --directory /ABSOLUTE/PATH/TO/PARENT/FOLDER/src run server.py

Building

  1. Update dependencies:
uv compile pyproject.toml
  1. Build package:
uv build

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

License

This project is licensed under the MIT License - see the LICENSE file for details.