Package com.tnsai.mcp.stripe
Class StripeMcpClient
java.lang.Object
com.tnsai.mcp.stripe.StripeMcpClient
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
ConstructorsConstructorDescriptionStripeMcpClient(McpClient mcpClient) Creates a new StripeMcpClient wrapping the given MCP client. -
Method Summary
Modifier and TypeMethodDescriptioncom.fasterxml.jackson.databind.JsonNodecreateCustomer(String name, String email) Creates a new customer.com.fasterxml.jackson.databind.JsonNodecreatePaymentIntent(long amount, String currency) Creates a payment intent with the given amount and currency.com.fasterxml.jackson.databind.JsonNodeGets the current Stripe account balance.Returns the underlying MCP client.booleanChecks if the Stripe MCP server is available.com.fasterxml.jackson.databind.JsonNodelistCustomers(int limit) Lists customers with a limit.com.fasterxml.jackson.databind.JsonNodelistPayments(int limit) Lists recent payments with a limit.
-
Constructor Details
-
StripeMcpClient
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
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
Gets the current Stripe account balance.- Returns:
- the balance as JSON
- Throws:
IOException- if the MCP call fails
-
listCustomers
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 nameemail- the customer email address- Returns:
- the created customer as JSON
- Throws:
IOException- if the MCP call fails
-
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
-