MCP Recipe
Implement a Stripe PaymentIntent with Context7
Influzer starter recipe: use Stripe MCP for account/product context, then pull current Stripe API docs via Context7 before writing PaymentIntent code — test mode only.
MCP servers used
Compatible clients (author-reported, not verified by Influzer): Cursor, Claude Desktop, Claude Code, ChatGPT
Prerequisites
- Stripe remote MCP authorized for a test-mode account you own
- Context7 remote MCP access
- Never paste live secret keys into chat — configure OAuth / client secrets in MCP settings
Required permissions
Stripe MCP can read and mutate payment objects depending on scopes. Stay in test mode. Context7 is read-only docs lookup. This is not a PCI or security approval.
Setup
Add Stripe at https://mcp.stripe.com (test-mode account) and Context7 at https://mcp.context7.com/mcp. Confirm tools appear before asking for payment code.
{
"mcpServers": {
"stripe": {
"url": "https://mcp.stripe.com"
},
"context7": {
"url": "https://mcp.context7.com/mcp"
}
}
}
Using Context7, fetch the current Stripe docs for creating a PaymentIntent (server SDK + client confirm).
Using Stripe MCP in **test mode only**, list whether any products/prices already exist that fit a $20 one-time checkout (do not create live charges).
Start from the Node / Python / PHP snippets in this recipe, then adapt them to my stack.
Prefer Context7 over the snippets if the API shape differs.
Do not use live secret keys, do not disable webhooks guidance, and do not invent PCI-sensitive shortcuts.
Use these as copy-paste starting points for a $20.00 USD PaymentIntent. Replace YOUR_STRIPE_SECRET_KEY via env only. Confirm the final SDK calls with Context7 before shipping.
// npm i stripe
import Stripe from 'stripe';
const stripe = new Stripe(process.env.STRIPE_SECRET_KEY); // sk_test_...
export async function createCheckoutIntent() {
const intent = await stripe.paymentIntents.create({
amount: 2000, // $20.00
currency: 'usd',
automatic_payment_methods: { enabled: true },
});
return { clientSecret: intent.client_secret };
}
# pip install stripe
import os
import stripe
stripe.api_key = os.environ["STRIPE_SECRET_KEY"] # sk_test_...
def create_checkout_intent():
intent = stripe.PaymentIntent.create(
amount=2000, # $20.00
currency="usd",
automatic_payment_methods={"enabled": True},
)
return {"client_secret": intent.client_secret}
<?php
// composer require stripe/stripe-php
require 'vendor/autoload.php';
$stripe = new \Stripe\StripeClient(getenv('STRIPE_SECRET_KEY')); // sk_test_...
$intent = $stripe->paymentIntents->create([
'amount' => 2000, // $20.00
'currency' => 'usd',
'automatic_payment_methods' => ['enabled' => true],
]);
return ['client_secret' => $intent->client_secret];
Put Stripe secrets in MCP / env config. Reject prompts that ask you to paste sk_live or production customer PII into chat.
Expected result
A minimal PaymentIntent create flow (server-side) grounded in current Stripe docs, plus the client confirm steps — with test-mode caveats called out.
Sample output
Context7 (stripe-node): paymentIntents.create({ amount, currency, automatic_payment_methods })
Proposed route: POST /api/checkout/intent → returns client_secret
Test card: use Stripe test PANs only; do not charge live customers from this recipe.
Troubleshooting
- Auth / empty tools: re-add
https://mcp.stripe.comand complete OAuth for the test account - Wrong API shape: prefer Context7 over training memory for Stripe SDK versions
- If the agent suggests live keys or skipping webhooks: stop and tighten the prompt