by stripe
Enables popular agent frameworks to integrate with Stripe APIs via function calling, providing tools for MCP, Python, and TypeScript.
Enables popular agent frameworks—including Model Context Protocol (MCP), OpenAI's Agent SDK, LangChain, CrewAI, and Vercel's AI SDK—to call Stripe APIs through function calling. The library builds on the official Stripe Python and Node SDKs and offers a curated set of API actions.
pip install stripe-agent-toolkit
(requires Python 3.11+).npm install @stripe/agent-toolkit
(requires Node 18+).Create an instance of StripeAgentToolkit
with your secret key and an optional configuration object to enable specific actions or set context values (e.g., connected account ID).
from stripe_agent_toolkit.openai.toolkit import StripeAgentToolkit
toolkit = StripeAgentToolkit(
secret_key="sk_test_...",
configuration={"actions": {"payment_links": {"create": True}}},
)
import { StripeAgentToolkit } from "@stripe/agent-toolkit/langchain";
const toolkit = new StripeAgentToolkit({
secretKey: process.env.STRIPE_SECRET_KEY!,
configuration: { actions: { paymentLinks: { create: true } } },
});
Pass toolkit.get_tools()
to your agent framework (OpenAI Agent SDK, LangChain, CrewAI, Vercel AI SDK, etc.).
npx -y @stripe/mcp
).account
value for connected‑account requests.Q: Do I need to clone the repository to use the toolkit?
A: No. Install the published packages via pip
or npm
. Clone only if you intend to modify the source.
Q: Can I use the toolkit with frameworks other than the ones listed?
A: Yes. As long as the framework accepts a list of tool definitions compatible with the OpenAI function‑calling schema, you can pass toolkit.get_tools()
.
Q: How do I run a local MCP server?
A: Run npx -y @stripe/mcp --tools=all --api-key=YOUR_STRIPE_SECRET_KEY
.
Q: What Python version is required? A: Python 3.11 or newer.
Q: Is the library exhaustive of the Stripe API? A: No. It currently supports a curated subset of common endpoints (see the "Supported API methods" list).
The Stripe Agent Toolkit enables popular agent frameworks including Model Context Protocol (MCP), OpenAI's Agent SDK, LangChain, CrewAI, and Vercel's AI SDK to integrate with Stripe APIs through function calling. The library is not exhaustive of the entire Stripe API. It includes support for MCP, Python, and TypeScript and is built directly on top of the Stripe Python and Node SDKs.
Included below are basic instructions, but refer to the MCP Python, TypeScript packages for more information.
Stripe hosts a remote MCP server at https://mcp.stripe.com
. This allows secure MCP client access via OAuth. View the docs here.
The Stripe Agent Toolkit also exposes tools in the Model Context Protocol (MCP) format. Or, to run a local Stripe MCP server using npx, use the following command:
npx -y @stripe/mcp --tools=all --api-key=YOUR_STRIPE_SECRET_KEY
You don't need this source code unless you want to modify the package. If you just want to use the package run:
pip install stripe-agent-toolkit
The library needs to be configured with your account's secret key which is available in your Stripe Dashboard.
from stripe_agent_toolkit.openai.toolkit import StripeAgentToolkit
stripe_agent_toolkit = StripeAgentToolkit(
secret_key="sk_test_...",
configuration={
"actions": {
"payment_links": {
"create": True,
},
}
},
)
The toolkit works with OpenAI's Agent SDK, LangChain, and CrewAI and can be passed as a list of tools. For example:
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()
)
Examples for OpenAI's Agent SDK,LangChain, and CrewAI are included in /examples.
In some cases you will want to provide values that serve as defaults when making requests. Currently, the account
context value enables you to make API calls for your connected accounts.
stripe_agent_toolkit = StripeAgentToolkit(
secret_key="sk_test_...",
configuration={
"context": {
"account": "acct_123"
}
}
)
You don't need this source code unless you want to modify the package. If you just want to use the package run:
npm install @stripe/agent-toolkit
The library needs to be configured with your account's secret key which is available in your Stripe Dashboard. Additionally, configuration
enables you to specify the types of actions that can be taken using the toolkit.
import { StripeAgentToolkit } from "@stripe/agent-toolkit/langchain";
const stripeAgentToolkit = new StripeAgentToolkit({
secretKey: process.env.STRIPE_SECRET_KEY!,
configuration: {
actions: {
paymentLinks: {
create: true,
},
},
},
});
The toolkit works with LangChain and Vercel's AI SDK and can be passed as a list of tools. For example:
import { AgentExecutor, createStructuredChatAgent } from "langchain/agents";
const tools = stripeAgentToolkit.getTools();
const agent = await createStructuredChatAgent({
llm,
tools,
prompt,
});
const agentExecutor = new AgentExecutor({
agent,
tools,
});
In some cases you will want to provide values that serve as defaults when making requests. Currently, the account
context value enables you to make API calls for your connected accounts.
const stripeAgentToolkit = new StripeAgentToolkit({
secretKey: process.env.STRIPE_SECRET_KEY!,
configuration: {
context: {
account: "acct_123",
},
},
});
For Vercel's AI SDK, you can use middleware to submit billing events for usage. All that is required is the customer ID and the input/output meters to bill.
import { StripeAgentToolkit } from "@stripe/agent-toolkit/ai-sdk";
import { openai } from "@ai-sdk/openai";
import {
generateText,
experimental_wrapLanguageModel as wrapLanguageModel,
} from "ai";
const stripeAgentToolkit = new StripeAgentToolkit({
secretKey: process.env.STRIPE_SECRET_KEY!,
configuration: {
actions: {
paymentLinks: {
create: true,
},
},
},
});
const model = wrapLanguageModel({
model: openai("gpt-4o"),
middleware: stripeAgentToolkit.middleware({
billing: {
customer: "cus_123",
meters: {
input: "input_tokens",
output: "output_tokens",
},
},
}),
});
Please log in to share your review and rating for this MCP.
{ "mcpServers": { "stripe-mcp": { "command": "npx", "args": [ "-y", "@stripe/mcp", "--tools=all", "--api-key=YOUR_STRIPE_SECRET_KEY" ], "env": { "API_KEY": "<YOUR_API_KEY>" } } } }
Discover more MCP servers with similar functionality and use cases
by goat-sdk
GOAT is the largest agentic finance toolkit for AI agents, enabling them to become economic actors by leveraging blockchains, cryptocurrencies, and wallets.
by financial-datasets
Provides AI assistants with tools to retrieve income statements, balance sheets, cash flow statements, stock prices, market news, and crypto information via the Model Context Protocol.
by razorpay
Enables seamless interaction with Razorpay APIs via Model Context Protocol, allowing developers and AI agents to capture payments, manage orders, process refunds, handle settlements, and more through a unified MCP interface.
by armorwallet
Armor Crypto MCP provides a unified interface for AI agents to interact with the crypto ecosystem, including wallet management, swaps, staking, and multi-chain operations.
by alpacahq
Alpaca’s MCP server lets you trade stocks and options, analyze market data, and build strategies through Alpaca's Trading API.
by XeroAPI
Provides a bridge between the Model Context Protocol and Xero's API, enabling standardized access to Xero accounting and business features.
by kukapay
Integrates the Freqtrade cryptocurrency trading bot with an MCP server, exposing the bot's REST API as tools that AI agents can call for fully automated trading operations.
by kukapay
Offers over 50 cryptocurrency technical analysis indicators and corresponding trading strategies, enabling AI agents and developers to assess market trends and generate buy, hold, or sell signals.
by stefanoamorelli
SEC EDGAR MCP is an open-source MCP server that connects AI models to the rich dataset of SEC EDGAR filings. It makes the trove of public company data accessible to AI assistants (LLMs) for financial research, investment insights, and corporate transparency use cases.