This repository provides a Model Context Protocol (MCP) server for integrating Stripe with LLMs and agent frameworks. It enables secure access to Stripe's APIs through function calling, making it easier to build AI-powered applications that leverage Stripe's payment infrastructure.
You can run a local Stripe MCP server using npx with the following command:
npx -y @stripe/mcp --tools=all --api-key=YOUR_STRIPE_SECRET_KEY
Alternatively, Stripe hosts a remote MCP server at https://mcp.stripe.com that allows secure MCP client access via OAuth.
The Agent Toolkit enables integration with popular agent frameworks including OpenAI's Agent SDK, LangChain, CrewAI, and Vercel's AI SDK.
Install the package with pip:
pip install stripe-agent-toolkit
Requirements:
Configure the toolkit with your Stripe secret key:
from stripe_agent_toolkit.openai.toolkit import StripeAgentToolkit
stripe_agent_toolkit = StripeAgentToolkit(
secret_key="sk_test_...",
configuration={
"actions": {
"payment_links": {
"create": True,
},
}
},
)
Use with agent frameworks:
from agents import Agent
stripe_agent = Agent(
name="Stripe Agent",
instructions="You are an expert at integrating with Stripe",
tools=stripe_agent_toolkit.get_tools()
)
Install the package with npm:
npm install @stripe/agent-toolkit
Requirements:
Configure the toolkit with your Stripe secret key:
import { StripeAgentToolkit } from "@stripe/agent-toolkit/langchain";
const stripeAgentToolkit = new StripeAgentToolkit({
secretKey: process.env.STRIPE_SECRET_KEY!,
configuration: {
actions: {
paymentLinks: {
create: true,
},
},
},
});
Use with LangChain:
import { AgentExecutor, createStructuredChatAgent } from "langchain/agents";
const tools = stripeAgentToolkit.getTools();
const agent = await createStructuredChatAgent({
llm,
tools,
prompt,
});
const agentExecutor = new AgentExecutor({
agent,
tools,
});
You can provide context values as defaults when making requests, such as for connected accounts:
stripe_agent_toolkit = StripeAgentToolkit(
secret_key="sk_test_...",
configuration={
"context": {
"account": "acct_123"
}
}
)
const stripeAgentToolkit = new StripeAgentToolkit({
secretKey: process.env.STRIPE_SECRET_KEY!,
configuration: {
context: {
account: "acct_123",
},
},
});
For a complete list of supported API methods, see the Stripe MCP documentation.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "stripe-agent-toolkit" '{"command":"npx","args":["-y","@stripe/mcp","--tools=all"]}'
See the official Claude Code MCP documentation for more details.
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.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:
{
"mcpServers": {
"stripe-agent-toolkit": {
"command": "npx",
"args": [
"-y",
"@stripe/mcp",
"--tools=all"
]
}
}
}
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.
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json%APPDATA%\Claude\claude_desktop_config.json~/.config/Claude/claude_desktop_config.json2. Add this to your configuration file:
{
"mcpServers": {
"stripe-agent-toolkit": {
"command": "npx",
"args": [
"-y",
"@stripe/mcp",
"--tools=all"
]
}
}
}
3. Restart Claude Desktop for the changes to take effect