Class StripeMcpClient

java.lang.Object
com.tnsai.mcp.stripe.StripeMcpClient

public class StripeMcpClient extends Object
Client for Stripe's MCP server.

Provides convenience methods for common Stripe operations by wrapping MCP tool calls to a Stripe MCP server. All operations are performed through the underlying McpClient, which handles the MCP protocol.

Example usage:


 McpClient mcpClient = McpClient.create(transport);
 mcpClient.connect();
 mcpClient.initialize();

 StripeMcpClient stripe = new StripeMcpClient(mcpClient);
 JsonNode balance = stripe.getBalance();
 JsonNode payment = stripe.createPaymentIntent(2000, "usd");
 
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new StripeMcpClient wrapping the given MCP client.
  • Method Summary

    Modifier and Type
    Method
    Description
    com.fasterxml.jackson.databind.JsonNode
    Creates a new customer.
    com.fasterxml.jackson.databind.JsonNode
    createPaymentIntent(long amount, String currency)
    Creates a payment intent with the given amount and currency.
    com.fasterxml.jackson.databind.JsonNode
    Gets the current Stripe account balance.
    Returns the underlying MCP client.
    boolean
    Checks if the Stripe MCP server is available.
    com.fasterxml.jackson.databind.JsonNode
    listCustomers(int limit)
    Lists customers with a limit.
    com.fasterxml.jackson.databind.JsonNode
    listPayments(int limit)
    Lists recent payments with a limit.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • StripeMcpClient

      public StripeMcpClient(McpClient mcpClient)
      Creates a new StripeMcpClient wrapping the given MCP client.
      Parameters:
      mcpClient - the MCP client connected to a Stripe MCP server
      Throws:
      IllegalArgumentException - if mcpClient is null
  • Method Details

    • createPaymentIntent

      public com.fasterxml.jackson.databind.JsonNode createPaymentIntent(long amount, String currency) throws IOException
      Creates a payment intent with the given amount and currency.
      Parameters:
      amount - the amount in the smallest currency unit (e.g., cents for USD)
      currency - the three-letter ISO currency code (e.g., "usd")
      Returns:
      the created payment intent as JSON
      Throws:
      IOException - if the MCP call fails
    • listPayments

      public com.fasterxml.jackson.databind.JsonNode listPayments(int limit) throws IOException
      Lists recent payments with a limit.
      Parameters:
      limit - the maximum number of payments to return
      Returns:
      the list of payments as JSON
      Throws:
      IOException - if the MCP call fails
    • getBalance

      public com.fasterxml.jackson.databind.JsonNode getBalance() throws IOException
      Gets the current Stripe account balance.
      Returns:
      the balance as JSON
      Throws:
      IOException - if the MCP call fails
    • listCustomers

      public com.fasterxml.jackson.databind.JsonNode listCustomers(int limit) throws IOException
      Lists customers with a limit.
      Parameters:
      limit - the maximum number of customers to return
      Returns:
      the list of customers as JSON
      Throws:
      IOException - if the MCP call fails
    • createCustomer

      public com.fasterxml.jackson.databind.JsonNode createCustomer(String name, String email) throws IOException
      Creates a new customer.
      Parameters:
      name - the customer name
      email - the customer email address
      Returns:
      the created customer as JSON
      Throws:
      IOException - if the MCP call fails
    • getMcpClient

      public McpClient getMcpClient()
      Returns the underlying MCP client.
      Returns:
      the MCP client
    • isAvailable

      public boolean isAvailable()
      Checks if the Stripe MCP server is available.
      Returns:
      true if the MCP client is connected and initialized