Stripe MCP server

Integrates with Stripe's payment processing API to enable transaction processing, customer management, and subscription handling for financial applications.
Back to servers
Provider
Atharva Gupta
Release date
Feb 07, 2025
Language
Python
Stats
37 stars

The MCP Stripe Server is a specialized implementation of the Model Context Protocol that integrates with Stripe to manage payments, customers, and refunds through a structured API. It provides secure financial transaction handling with comprehensive audit logging.

Requirements

  • Python 3.8+
  • MCP SDK 0.1.0+
  • Stripe Python SDK
  • dotenv

Installation

Via Smithery

The easiest way to install Stripe Server for Claude Desktop is through Smithery:

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

Manual Installation

  1. Set up a virtual environment and install dependencies:
python -m venv venv
source venv/bin/activate  # On macOS/Linux
venv\Scripts\activate    # On Windows
pip install -e .
  1. Create a .env file with your Stripe API key:
STRIPE_API_KEY=your_stripe_secret_key

Claude Desktop Configuration

Add the server configuration to your Claude Desktop config file:

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

Starting the Server

Launch the MCP Stripe server with:

uv run src/server.py

Available Tools

The server provides several Stripe-related tools through MCP:

Customer Management

  • customer_create: Create a new customer
  • customer_retrieve: Get customer details
  • customer_update: Update customer information

Payment Operations

  • payment_intent_create: Process payments
  • charge_list: View recent charges

Refund Processing

  • refund_create: Issue refunds for charges

Example Commands

Creating a Customer

{
    "tool": "customer_create",
    "arguments": {
        "email": "[email protected]",
        "name": "John Doe"
    }
}

Retrieving Customer Information

{
    "tool": "customer_retrieve",
    "arguments": {
        "customer_id": "cus_123456"
    }
}

Creating a Payment Intent

{
    "tool": "payment_intent_create",
    "arguments": {
        "amount": 5000,
        "currency": "usd",
        "customer": "cus_123456"
    }
}

Issuing a Refund

{
    "tool": "refund_create",
    "arguments": {
        "charge_id": "ch_abc123"
    }
}

Error Handling

The server provides clear error messages for common scenarios:

  • Missing API key
  • Invalid authentication
  • Non-existent customer ID
  • Missing or incorrect parameters

Interactive Testing

For testing and exploring the API capabilities, use the MCP Inspector:

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

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later