Create a new Stripe customer
List all Stripe customers
Create a new Stripe coupon
List all Stripe coupons
Create a new Stripe payment link
List all Stripe payment links
Create a new Stripe product
List all Stripe products
Create a new Stripe price
List all Stripe prices
The Stripe Agent Toolkit enables seamless integration between Stripe's payment processing APIs and popular AI agent frameworks. It provides a structured way for AI agents to interact with Stripe services through function calling, supporting frameworks like OpenAI's Agent SDK, LangChain, CrewAI, Vercel's AI SDK, and Model Context Protocol (MCP). Built directly on top of Stripe's official Python and TypeScript SDKs, this toolkit allows AI agents to perform operations like creating customers, managing payment links, handling products and prices, and more. It includes robust configuration options for specifying allowed actions and context parameters, making it a powerful solution for building AI-powered financial applications.
The Stripe Agent Toolkit provides a bridge between AI agent frameworks and Stripe's payment processing APIs. This MCP server allows AI assistants to interact with Stripe services through structured function calls, enabling the development of sophisticated financial applications powered by AI.
To run the Stripe MCP server using npx, use the following command:
npx -y @stripe/mcp --tools=all --api-key=YOUR_STRIPE_SECRET_KEY
Replace YOUR_STRIPE_SECRET_KEY
with your actual Stripe secret key from your Stripe Dashboard. Alternatively, you can set the STRIPE_SECRET_KEY
in your environment variables.
The Stripe Agent Toolkit MCP server can be configured to limit which Stripe API actions are available to the AI assistant. This is done through a configuration object that specifies allowed actions.
For example, to create your own MCP server with specific permissions:
import { StripeAgentToolkit } from "@stripe/agent-toolkit/modelcontextprotocol";
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
const server = new StripeAgentToolkit({
secretKey: process.env.STRIPE_SECRET_KEY,
configuration: {
actions: {
paymentLinks: {
create: true,
},
products: {
create: true,
},
prices: {
create: true,
},
// Add other actions as needed
},
},
});
async function main() {
const transport = new StdioServerTransport();
await server.connect(transport);
console.error("Stripe MCP Server running on stdio");
}
main().catch((error) => {
console.error("Fatal error in main():", error);
process.exit(1);
});
You can provide context values that serve as defaults when making requests. For example, the account
context value enables you to make API calls for your connected accounts:
const server = new StripeAgentToolkit({
secretKey: process.env.STRIPE_SECRET_KEY,
configuration: {
context: {
account: "acct_123",
},
actions: {
// Your actions configuration
},
},
});
Once the MCP server is running, AI assistants can use it to interact with Stripe APIs. The assistant can perform operations like creating customers, managing payment links, handling products and prices, and more, depending on the configured permissions.
For example, you might ask the assistant to:
The assistant will use the appropriate Stripe API functions to fulfill these requests while respecting the permissions configured in the MCP server.