* fix(mcp): sync User-Agent version with package.json and add missing CLI tests - VERSION in userAgent.ts was stuck at 0.3.1 while package.json is 0.3.3 - Add test coverage for validateApiKey, validateStripeAccount, and --tools deprecation Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * style: fix Prettier formatting in test file Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor(mcp): inject version at build time via PACKAGE_VERSION Replace hardcoded VERSION constant with process.env.PACKAGE_VERSION, injected at build time by scripts/inject-version.js. This mirrors the pattern used by the shared toolkit (tsup define in tools/typescript) and eliminates manual version sync between userAgent.ts and package.json. - userAgent.ts: read VERSION from process.env.PACKAGE_VERSION - scripts/inject-version.js: post-tsc step replaces the env reference with the actual version from package.json - jest.setup.ts: sets PACKAGE_VERSION for test environment - package.json: updated build script to run inject-version.js Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> * refactor(mcp): replace inject-version.js with tsup build system Use tsup's define option to inline PACKAGE_VERSION at build time, matching the pattern used by the shared toolkit (tools/typescript). Removes the brittle post-build string replacement script. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> --------- Co-authored-by: aptsalt <aptsalt@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Stripe Model Context Protocol
The Stripe Model Context Protocol server allows you to integrate with Stripe APIs through function calling. This protocol supports various tools to interact with different Stripe services.
Setup
Stripe hosts a remote MCP server at https://mcp.stripe.com. View the docs here.
Local
To run the Stripe MCP server locally using npx, use the following command:
# Basic usage
npx -y @stripe/mcp --api-key=YOUR_STRIPE_SECRET_KEY
# To configure a Stripe connected account
npx -y @stripe/mcp --api-key=YOUR_STRIPE_SECRET_KEY --stripe-account=CONNECTED_ACCOUNT_ID
Make sure to replace YOUR_STRIPE_SECRET_KEY with your actual Stripe secret key. Alternatively, you could set the STRIPE_SECRET_KEY in your environment variables.
Note: Tool permissions are controlled by your Restricted API Key (RAK). Create a RAK with the desired permissions at https://dashboard.stripe.com/apikeys
Usage with Claude Desktop
Add the following to your claude_desktop_config.json. See here for more details.
{
"mcpServers": {
"stripe": {
"command": "npx",
"args": ["-y", "@stripe/mcp", "--api-key=STRIPE_SECRET_KEY"]
}
}
}
or if you're using Docker
{
"mcpServers": {
"stripe": {
"command": "docker",
"args": ["run", "--rm", "-i", "mcp/stripe", "--api-key=STRIPE_SECRET_KEY"]
}
}
}
Usage with Gemini CLI
- Install Gemini CLI through your preferred method.
- Install the Stripe MCP extension:
gemini extensions install https://github.com/stripe/ai. - Start Gemini CLI:
gemini. - Go through the OAUTH flow:
/mcp auth stripe.
Available tools
See the Stripe MCP documentation for a list of tools.
Debugging the Server
To debug your server, you can use the MCP Inspector.
First build the server
npm run build
Run the following command in your terminal:
# Start MCP Inspector and server
npx @modelcontextprotocol/inspector node dist/index.js --api-key=YOUR_STRIPE_SECRET_KEY
Build using Docker
First build the server
docker build -t mcp/stripe .
Run the following command in your terminal:
docker run -p 3000:3000 -p 5173:5173 -v /var/run/docker.sock:/var/run/docker.sock mcp/inspector docker run --rm -i mcp/stripe --api-key=YOUR_STRIPE_SECRET_KEY
Instructions
- Replace
YOUR_STRIPE_SECRET_KEYwith your actual Stripe API secret key. - Run the command to start the MCP Inspector.
- Open the MCP Inspector UI in your browser and click Connect to start the MCP server.
- You can see the list of tools you selected and test each tool individually.