File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ set -euo pipefail
3+
4+ # Reads a Stripe API key from dotnet user-secrets and execs @stripe/mcp.
5+ # Only accepts restricted keys (rk_*) so write-capable full secret keys (sk_*)
6+ # can never reach the MCP, regardless of environment. Configure the restricted
7+ # key with read-only scopes in the Stripe dashboard.
8+ # Usage: stripe-mcp.sh <secret-name>
9+ # Example: stripe-mcp.sh Parameters:stripe-api-key
10+ SECRET_NAME=" ${1:? Secret name required, e.g. Parameters: stripe-api-key} "
11+
12+ STRIPE_SECRET_KEY=$( dotnet user-secrets list --project application/AppHost/AppHost.csproj | sed -n " s/^${SECRET_NAME} = //p" )
13+
14+ if [ -z " $STRIPE_SECRET_KEY " ]; then
15+ echo " Stripe MCP: secret '${SECRET_NAME} ' not found in dotnet user-secrets." >&2
16+ exit 1
17+ fi
18+
19+ if [[ " $STRIPE_SECRET_KEY " != rk_* ]]; then
20+ echo " Stripe MCP: secret '${SECRET_NAME} ' must be a restricted key (rk_test_* or rk_live_*); full secret keys (sk_*) are not allowed." >&2
21+ exit 1
22+ fi
23+
24+ export STRIPE_SECRET_KEY
25+ exec npx -y @stripe/mcp
Original file line number Diff line number Diff line change 3939 }
4040 },
4141 "stripe-development" : {
42- "command" : " .claude/scripts/stripe-mcp-dev.sh"
42+ "command" : " .claude/scripts/stripe-mcp.sh" ,
43+ "args" : [" Parameters:stripe-api-key" ]
44+ },
45+ "stripe-staging" : {
46+ "command" : " .claude/scripts/stripe-mcp.sh" ,
47+ "args" : [" Parameters:stripe-api-key-staging" ]
4348 }
4449 }
4550}
You can’t perform that action at this time.
0 commit comments