@neuroequalityorg/mcp-stripe 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +186 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +406 -0
- package/dist/index.js.map +1 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 NeuralEquality.org
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
# @neuroequalityorg/mcp-stripe
|
|
2
|
+
|
|
3
|
+
MCP (Model Context Protocol) server for Stripe API integration. Enables AI assistants like Claude to interact with Stripe for payment processing, customer management, and subscriptions.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **list_customers** - List and filter Stripe customers
|
|
8
|
+
- **create_payment_link** - Create payment links for one-time or recurring payments
|
|
9
|
+
- **get_balance** - Get current account balance
|
|
10
|
+
- **list_subscriptions** - List and filter subscriptions
|
|
11
|
+
- **create_product** - Create products with optional default pricing
|
|
12
|
+
|
|
13
|
+
## Installation
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g @neuroequalityorg/mcp-stripe
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Or use npx:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
npx @neuroequalityorg/mcp-stripe
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
Set your Stripe API key as an environment variable:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
export STRIPE_API_KEY=sk_live_xxx # or sk_test_xxx for test mode
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or use `STRIPE_SECRET_KEY`:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
export STRIPE_SECRET_KEY=sk_live_xxx
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Usage with Claude Desktop
|
|
40
|
+
|
|
41
|
+
Add to your Claude Desktop configuration (`~/.config/claude/claude_desktop_config.json` on Linux/Mac or `%APPDATA%\Claude\claude_desktop_config.json` on Windows):
|
|
42
|
+
|
|
43
|
+
```json
|
|
44
|
+
{
|
|
45
|
+
"mcpServers": {
|
|
46
|
+
"stripe": {
|
|
47
|
+
"command": "npx",
|
|
48
|
+
"args": ["@neuroequalityorg/mcp-stripe"],
|
|
49
|
+
"env": {
|
|
50
|
+
"STRIPE_API_KEY": "sk_live_your_key_here"
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
## Tools
|
|
58
|
+
|
|
59
|
+
### list_customers
|
|
60
|
+
|
|
61
|
+
List Stripe customers with optional filtering.
|
|
62
|
+
|
|
63
|
+
**Parameters:**
|
|
64
|
+
- `limit` (number, optional): Max customers to return (1-100, default: 10)
|
|
65
|
+
- `email` (string, optional): Filter by email address
|
|
66
|
+
- `starting_after` (string, optional): Pagination cursor (customer ID)
|
|
67
|
+
|
|
68
|
+
**Example:**
|
|
69
|
+
```json
|
|
70
|
+
{
|
|
71
|
+
"limit": 20,
|
|
72
|
+
"email": "customer@example.com"
|
|
73
|
+
}
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
### create_payment_link
|
|
77
|
+
|
|
78
|
+
Create a Stripe Payment Link. Either provide an existing `price_id` or create a new product/price on the fly.
|
|
79
|
+
|
|
80
|
+
**Parameters:**
|
|
81
|
+
- `price_id` (string, optional): Existing Stripe Price ID
|
|
82
|
+
- `product_name` (string, optional): Name for new product (required if no price_id)
|
|
83
|
+
- `unit_amount` (number, optional): Price in cents (required if no price_id)
|
|
84
|
+
- `currency` (string, optional): Currency code (default: "usd")
|
|
85
|
+
- `quantity` (number, optional): Item quantity (default: 1)
|
|
86
|
+
- `allow_promotion_codes` (boolean, optional): Allow promo codes (default: false)
|
|
87
|
+
|
|
88
|
+
**Example (new product):**
|
|
89
|
+
```json
|
|
90
|
+
{
|
|
91
|
+
"product_name": "Premium Plan",
|
|
92
|
+
"unit_amount": 2999,
|
|
93
|
+
"currency": "usd"
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Example (existing price):**
|
|
98
|
+
```json
|
|
99
|
+
{
|
|
100
|
+
"price_id": "price_1234567890"
|
|
101
|
+
}
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### get_balance
|
|
105
|
+
|
|
106
|
+
Get current Stripe account balance.
|
|
107
|
+
|
|
108
|
+
**Parameters:** None
|
|
109
|
+
|
|
110
|
+
**Returns:** Available and pending amounts by currency.
|
|
111
|
+
|
|
112
|
+
### list_subscriptions
|
|
113
|
+
|
|
114
|
+
List Stripe subscriptions with optional filtering.
|
|
115
|
+
|
|
116
|
+
**Parameters:**
|
|
117
|
+
- `limit` (number, optional): Max subscriptions to return (1-100, default: 10)
|
|
118
|
+
- `customer` (string, optional): Filter by customer ID
|
|
119
|
+
- `status` (string, optional): Filter by status (active, canceled, past_due, etc.)
|
|
120
|
+
- `starting_after` (string, optional): Pagination cursor (subscription ID)
|
|
121
|
+
|
|
122
|
+
**Example:**
|
|
123
|
+
```json
|
|
124
|
+
{
|
|
125
|
+
"customer": "cus_xxx",
|
|
126
|
+
"status": "active",
|
|
127
|
+
"limit": 50
|
|
128
|
+
}
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
### create_product
|
|
132
|
+
|
|
133
|
+
Create a new Stripe product with optional default pricing.
|
|
134
|
+
|
|
135
|
+
**Parameters:**
|
|
136
|
+
- `name` (string, required): Product name
|
|
137
|
+
- `description` (string, optional): Product description
|
|
138
|
+
- `active` (boolean, optional): Available for purchase (default: true)
|
|
139
|
+
- `metadata` (object, optional): Key-value metadata
|
|
140
|
+
- `default_price_data` (object, optional): Default price configuration
|
|
141
|
+
- `unit_amount` (number): Price in cents
|
|
142
|
+
- `currency` (string): Currency code (default: "usd")
|
|
143
|
+
- `recurring` (object, optional): For subscriptions
|
|
144
|
+
- `interval`: "day", "week", "month", or "year"
|
|
145
|
+
- `interval_count` (number): Intervals between billings (default: 1)
|
|
146
|
+
|
|
147
|
+
**Example (one-time):**
|
|
148
|
+
```json
|
|
149
|
+
{
|
|
150
|
+
"name": "Widget Pro",
|
|
151
|
+
"description": "Premium widget with all features",
|
|
152
|
+
"default_price_data": {
|
|
153
|
+
"unit_amount": 4999,
|
|
154
|
+
"currency": "usd"
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
**Example (subscription):**
|
|
160
|
+
```json
|
|
161
|
+
{
|
|
162
|
+
"name": "Pro Plan",
|
|
163
|
+
"description": "Monthly subscription",
|
|
164
|
+
"default_price_data": {
|
|
165
|
+
"unit_amount": 1999,
|
|
166
|
+
"currency": "usd",
|
|
167
|
+
"recurring": {
|
|
168
|
+
"interval": "month"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
## Security
|
|
175
|
+
|
|
176
|
+
- Never commit your Stripe API keys to version control
|
|
177
|
+
- Use test mode keys (`sk_test_...`) during development
|
|
178
|
+
- Restrict API key permissions in Stripe Dashboard when possible
|
|
179
|
+
|
|
180
|
+
## License
|
|
181
|
+
|
|
182
|
+
MIT
|
|
183
|
+
|
|
184
|
+
## Author
|
|
185
|
+
|
|
186
|
+
[NeuralEquality.org](https://neuroequality.org)
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,406 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
4
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
5
|
+
};
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
const index_js_1 = require("@modelcontextprotocol/sdk/server/index.js");
|
|
8
|
+
const stdio_js_1 = require("@modelcontextprotocol/sdk/server/stdio.js");
|
|
9
|
+
const types_js_1 = require("@modelcontextprotocol/sdk/types.js");
|
|
10
|
+
const stripe_1 = __importDefault(require("stripe"));
|
|
11
|
+
const zod_1 = require("zod");
|
|
12
|
+
// Initialize Stripe client
|
|
13
|
+
const stripeApiKey = process.env.STRIPE_API_KEY || process.env.STRIPE_SECRET_KEY;
|
|
14
|
+
if (!stripeApiKey) {
|
|
15
|
+
console.error("Error: STRIPE_API_KEY or STRIPE_SECRET_KEY environment variable is required");
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
const stripe = new stripe_1.default(stripeApiKey);
|
|
19
|
+
// Tool input schemas
|
|
20
|
+
const ListCustomersSchema = zod_1.z.object({
|
|
21
|
+
limit: zod_1.z.number().min(1).max(100).optional().default(10),
|
|
22
|
+
email: zod_1.z.string().email().optional(),
|
|
23
|
+
starting_after: zod_1.z.string().optional(),
|
|
24
|
+
});
|
|
25
|
+
const CreatePaymentLinkSchema = zod_1.z.object({
|
|
26
|
+
price_id: zod_1.z.string().optional(),
|
|
27
|
+
product_name: zod_1.z.string().optional(),
|
|
28
|
+
unit_amount: zod_1.z.number().int().positive().optional(),
|
|
29
|
+
currency: zod_1.z.string().length(3).optional().default("usd"),
|
|
30
|
+
quantity: zod_1.z.number().int().positive().optional().default(1),
|
|
31
|
+
allow_promotion_codes: zod_1.z.boolean().optional().default(false),
|
|
32
|
+
});
|
|
33
|
+
const GetBalanceSchema = zod_1.z.object({});
|
|
34
|
+
const ListSubscriptionsSchema = zod_1.z.object({
|
|
35
|
+
limit: zod_1.z.number().min(1).max(100).optional().default(10),
|
|
36
|
+
customer: zod_1.z.string().optional(),
|
|
37
|
+
status: zod_1.z.enum(["active", "canceled", "incomplete", "incomplete_expired", "past_due", "paused", "trialing", "unpaid", "all"]).optional(),
|
|
38
|
+
starting_after: zod_1.z.string().optional(),
|
|
39
|
+
});
|
|
40
|
+
const CreateProductSchema = zod_1.z.object({
|
|
41
|
+
name: zod_1.z.string().min(1),
|
|
42
|
+
description: zod_1.z.string().optional(),
|
|
43
|
+
active: zod_1.z.boolean().optional().default(true),
|
|
44
|
+
metadata: zod_1.z.record(zod_1.z.string(), zod_1.z.string()).optional(),
|
|
45
|
+
default_price_data: zod_1.z.object({
|
|
46
|
+
unit_amount: zod_1.z.number().int().positive(),
|
|
47
|
+
currency: zod_1.z.string().length(3).default("usd"),
|
|
48
|
+
recurring: zod_1.z.object({
|
|
49
|
+
interval: zod_1.z.enum(["day", "week", "month", "year"]),
|
|
50
|
+
interval_count: zod_1.z.number().int().positive().optional().default(1),
|
|
51
|
+
}).optional(),
|
|
52
|
+
}).optional(),
|
|
53
|
+
});
|
|
54
|
+
// Create MCP server
|
|
55
|
+
const server = new index_js_1.Server({
|
|
56
|
+
name: "mcp-stripe",
|
|
57
|
+
version: "1.0.0",
|
|
58
|
+
}, {
|
|
59
|
+
capabilities: {
|
|
60
|
+
tools: {},
|
|
61
|
+
},
|
|
62
|
+
});
|
|
63
|
+
// List available tools
|
|
64
|
+
server.setRequestHandler(types_js_1.ListToolsRequestSchema, async () => {
|
|
65
|
+
return {
|
|
66
|
+
tools: [
|
|
67
|
+
{
|
|
68
|
+
name: "list_customers",
|
|
69
|
+
description: "List Stripe customers with optional filtering by email. Returns customer ID, email, name, and metadata.",
|
|
70
|
+
inputSchema: {
|
|
71
|
+
type: "object",
|
|
72
|
+
properties: {
|
|
73
|
+
limit: {
|
|
74
|
+
type: "number",
|
|
75
|
+
description: "Maximum number of customers to return (1-100)",
|
|
76
|
+
default: 10,
|
|
77
|
+
},
|
|
78
|
+
email: {
|
|
79
|
+
type: "string",
|
|
80
|
+
description: "Filter customers by email address",
|
|
81
|
+
},
|
|
82
|
+
starting_after: {
|
|
83
|
+
type: "string",
|
|
84
|
+
description: "Cursor for pagination - customer ID to start after",
|
|
85
|
+
},
|
|
86
|
+
},
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: "create_payment_link",
|
|
91
|
+
description: "Create a Stripe Payment Link for one-time or recurring payments. Can use an existing price_id or create a new price on the fly.",
|
|
92
|
+
inputSchema: {
|
|
93
|
+
type: "object",
|
|
94
|
+
properties: {
|
|
95
|
+
price_id: {
|
|
96
|
+
type: "string",
|
|
97
|
+
description: "Existing Stripe Price ID to use",
|
|
98
|
+
},
|
|
99
|
+
product_name: {
|
|
100
|
+
type: "string",
|
|
101
|
+
description: "Name for a new product (required if no price_id)",
|
|
102
|
+
},
|
|
103
|
+
unit_amount: {
|
|
104
|
+
type: "number",
|
|
105
|
+
description: "Price in cents (required if no price_id)",
|
|
106
|
+
},
|
|
107
|
+
currency: {
|
|
108
|
+
type: "string",
|
|
109
|
+
description: "Three-letter currency code (default: usd)",
|
|
110
|
+
default: "usd",
|
|
111
|
+
},
|
|
112
|
+
quantity: {
|
|
113
|
+
type: "number",
|
|
114
|
+
description: "Quantity of items (default: 1)",
|
|
115
|
+
default: 1,
|
|
116
|
+
},
|
|
117
|
+
allow_promotion_codes: {
|
|
118
|
+
type: "boolean",
|
|
119
|
+
description: "Allow promotion codes on the payment page",
|
|
120
|
+
default: false,
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
},
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
name: "get_balance",
|
|
127
|
+
description: "Get the current Stripe account balance including available and pending amounts by currency.",
|
|
128
|
+
inputSchema: {
|
|
129
|
+
type: "object",
|
|
130
|
+
properties: {},
|
|
131
|
+
},
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
name: "list_subscriptions",
|
|
135
|
+
description: "List Stripe subscriptions with optional filtering by customer or status.",
|
|
136
|
+
inputSchema: {
|
|
137
|
+
type: "object",
|
|
138
|
+
properties: {
|
|
139
|
+
limit: {
|
|
140
|
+
type: "number",
|
|
141
|
+
description: "Maximum number of subscriptions to return (1-100)",
|
|
142
|
+
default: 10,
|
|
143
|
+
},
|
|
144
|
+
customer: {
|
|
145
|
+
type: "string",
|
|
146
|
+
description: "Filter by customer ID",
|
|
147
|
+
},
|
|
148
|
+
status: {
|
|
149
|
+
type: "string",
|
|
150
|
+
description: "Filter by subscription status (active, canceled, past_due, etc.)",
|
|
151
|
+
enum: ["active", "canceled", "incomplete", "incomplete_expired", "past_due", "paused", "trialing", "unpaid", "all"],
|
|
152
|
+
},
|
|
153
|
+
starting_after: {
|
|
154
|
+
type: "string",
|
|
155
|
+
description: "Cursor for pagination - subscription ID to start after",
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
name: "create_product",
|
|
162
|
+
description: "Create a new Stripe product with optional default price. Products can be used for one-time purchases or subscriptions.",
|
|
163
|
+
inputSchema: {
|
|
164
|
+
type: "object",
|
|
165
|
+
properties: {
|
|
166
|
+
name: {
|
|
167
|
+
type: "string",
|
|
168
|
+
description: "Product name (required)",
|
|
169
|
+
},
|
|
170
|
+
description: {
|
|
171
|
+
type: "string",
|
|
172
|
+
description: "Product description",
|
|
173
|
+
},
|
|
174
|
+
active: {
|
|
175
|
+
type: "boolean",
|
|
176
|
+
description: "Whether the product is available for purchase",
|
|
177
|
+
default: true,
|
|
178
|
+
},
|
|
179
|
+
metadata: {
|
|
180
|
+
type: "object",
|
|
181
|
+
description: "Key-value metadata for the product",
|
|
182
|
+
additionalProperties: { type: "string" },
|
|
183
|
+
},
|
|
184
|
+
default_price_data: {
|
|
185
|
+
type: "object",
|
|
186
|
+
description: "Default price configuration",
|
|
187
|
+
properties: {
|
|
188
|
+
unit_amount: {
|
|
189
|
+
type: "number",
|
|
190
|
+
description: "Price in cents",
|
|
191
|
+
},
|
|
192
|
+
currency: {
|
|
193
|
+
type: "string",
|
|
194
|
+
description: "Three-letter currency code",
|
|
195
|
+
default: "usd",
|
|
196
|
+
},
|
|
197
|
+
recurring: {
|
|
198
|
+
type: "object",
|
|
199
|
+
description: "Recurring billing configuration",
|
|
200
|
+
properties: {
|
|
201
|
+
interval: {
|
|
202
|
+
type: "string",
|
|
203
|
+
description: "Billing interval",
|
|
204
|
+
enum: ["day", "week", "month", "year"],
|
|
205
|
+
},
|
|
206
|
+
interval_count: {
|
|
207
|
+
type: "number",
|
|
208
|
+
description: "Number of intervals between billings",
|
|
209
|
+
default: 1,
|
|
210
|
+
},
|
|
211
|
+
},
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
},
|
|
215
|
+
},
|
|
216
|
+
required: ["name"],
|
|
217
|
+
},
|
|
218
|
+
},
|
|
219
|
+
],
|
|
220
|
+
};
|
|
221
|
+
});
|
|
222
|
+
// Handle tool calls
|
|
223
|
+
server.setRequestHandler(types_js_1.CallToolRequestSchema, async (request) => {
|
|
224
|
+
const { name, arguments: args } = request.params;
|
|
225
|
+
try {
|
|
226
|
+
switch (name) {
|
|
227
|
+
case "list_customers": {
|
|
228
|
+
const params = ListCustomersSchema.parse(args);
|
|
229
|
+
const listParams = {
|
|
230
|
+
limit: params.limit,
|
|
231
|
+
};
|
|
232
|
+
if (params.email)
|
|
233
|
+
listParams.email = params.email;
|
|
234
|
+
if (params.starting_after)
|
|
235
|
+
listParams.starting_after = params.starting_after;
|
|
236
|
+
const customers = await stripe.customers.list(listParams);
|
|
237
|
+
const result = {
|
|
238
|
+
customers: customers.data.map((c) => ({
|
|
239
|
+
id: c.id,
|
|
240
|
+
email: c.email,
|
|
241
|
+
name: c.name,
|
|
242
|
+
phone: c.phone,
|
|
243
|
+
created: new Date(c.created * 1000).toISOString(),
|
|
244
|
+
metadata: c.metadata,
|
|
245
|
+
balance: c.balance,
|
|
246
|
+
currency: c.currency,
|
|
247
|
+
})),
|
|
248
|
+
has_more: customers.has_more,
|
|
249
|
+
total_count: customers.data.length,
|
|
250
|
+
};
|
|
251
|
+
return {
|
|
252
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
case "create_payment_link": {
|
|
256
|
+
const params = CreatePaymentLinkSchema.parse(args);
|
|
257
|
+
let priceId = params.price_id;
|
|
258
|
+
// Create product and price if no price_id provided
|
|
259
|
+
if (!priceId) {
|
|
260
|
+
if (!params.product_name || !params.unit_amount) {
|
|
261
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, "Either price_id OR both product_name and unit_amount are required");
|
|
262
|
+
}
|
|
263
|
+
const product = await stripe.products.create({
|
|
264
|
+
name: params.product_name,
|
|
265
|
+
});
|
|
266
|
+
const price = await stripe.prices.create({
|
|
267
|
+
product: product.id,
|
|
268
|
+
unit_amount: params.unit_amount,
|
|
269
|
+
currency: params.currency,
|
|
270
|
+
});
|
|
271
|
+
priceId = price.id;
|
|
272
|
+
}
|
|
273
|
+
const paymentLink = await stripe.paymentLinks.create({
|
|
274
|
+
line_items: [
|
|
275
|
+
{
|
|
276
|
+
price: priceId,
|
|
277
|
+
quantity: params.quantity,
|
|
278
|
+
},
|
|
279
|
+
],
|
|
280
|
+
allow_promotion_codes: params.allow_promotion_codes,
|
|
281
|
+
});
|
|
282
|
+
const result = {
|
|
283
|
+
id: paymentLink.id,
|
|
284
|
+
url: paymentLink.url,
|
|
285
|
+
active: paymentLink.active,
|
|
286
|
+
};
|
|
287
|
+
return {
|
|
288
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
289
|
+
};
|
|
290
|
+
}
|
|
291
|
+
case "get_balance": {
|
|
292
|
+
GetBalanceSchema.parse(args);
|
|
293
|
+
const balance = await stripe.balance.retrieve();
|
|
294
|
+
const formatAmount = (amounts) => amounts.map((a) => ({
|
|
295
|
+
amount: a.amount / 100,
|
|
296
|
+
currency: a.currency.toUpperCase(),
|
|
297
|
+
source_types: a.source_types,
|
|
298
|
+
}));
|
|
299
|
+
const result = {
|
|
300
|
+
available: formatAmount(balance.available),
|
|
301
|
+
pending: formatAmount(balance.pending),
|
|
302
|
+
livemode: balance.livemode,
|
|
303
|
+
};
|
|
304
|
+
return {
|
|
305
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
case "list_subscriptions": {
|
|
309
|
+
const params = ListSubscriptionsSchema.parse(args);
|
|
310
|
+
const listParams = {
|
|
311
|
+
limit: params.limit,
|
|
312
|
+
};
|
|
313
|
+
if (params.customer)
|
|
314
|
+
listParams.customer = params.customer;
|
|
315
|
+
if (params.status && params.status !== "all")
|
|
316
|
+
listParams.status = params.status;
|
|
317
|
+
if (params.starting_after)
|
|
318
|
+
listParams.starting_after = params.starting_after;
|
|
319
|
+
const subscriptions = await stripe.subscriptions.list(listParams);
|
|
320
|
+
const result = {
|
|
321
|
+
subscriptions: subscriptions.data.map((s) => ({
|
|
322
|
+
id: s.id,
|
|
323
|
+
customer: s.customer,
|
|
324
|
+
status: s.status,
|
|
325
|
+
current_period_start: s.current_period_start ? new Date(s.current_period_start * 1000).toISOString() : null,
|
|
326
|
+
current_period_end: s.current_period_end ? new Date(s.current_period_end * 1000).toISOString() : null,
|
|
327
|
+
cancel_at_period_end: s.cancel_at_period_end,
|
|
328
|
+
items: s.items?.data?.map((item) => ({
|
|
329
|
+
id: item.id,
|
|
330
|
+
price_id: item.price?.id,
|
|
331
|
+
quantity: item.quantity,
|
|
332
|
+
product: item.price?.product,
|
|
333
|
+
})) || [],
|
|
334
|
+
metadata: s.metadata,
|
|
335
|
+
})),
|
|
336
|
+
has_more: subscriptions.has_more,
|
|
337
|
+
total_count: subscriptions.data.length,
|
|
338
|
+
};
|
|
339
|
+
return {
|
|
340
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
341
|
+
};
|
|
342
|
+
}
|
|
343
|
+
case "create_product": {
|
|
344
|
+
const params = CreateProductSchema.parse(args);
|
|
345
|
+
const productParams = {
|
|
346
|
+
name: params.name,
|
|
347
|
+
active: params.active,
|
|
348
|
+
};
|
|
349
|
+
if (params.description)
|
|
350
|
+
productParams.description = params.description;
|
|
351
|
+
if (params.metadata)
|
|
352
|
+
productParams.metadata = params.metadata;
|
|
353
|
+
if (params.default_price_data) {
|
|
354
|
+
productParams.default_price_data = {
|
|
355
|
+
unit_amount: params.default_price_data.unit_amount,
|
|
356
|
+
currency: params.default_price_data.currency,
|
|
357
|
+
};
|
|
358
|
+
if (params.default_price_data.recurring) {
|
|
359
|
+
productParams.default_price_data.recurring = {
|
|
360
|
+
interval: params.default_price_data.recurring.interval,
|
|
361
|
+
interval_count: params.default_price_data.recurring.interval_count,
|
|
362
|
+
};
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
const product = await stripe.products.create(productParams);
|
|
366
|
+
const result = {
|
|
367
|
+
id: product.id,
|
|
368
|
+
name: product.name,
|
|
369
|
+
description: product.description,
|
|
370
|
+
active: product.active,
|
|
371
|
+
default_price: product.default_price,
|
|
372
|
+
created: new Date(product.created * 1000).toISOString(),
|
|
373
|
+
metadata: product.metadata,
|
|
374
|
+
url: `https://dashboard.stripe.com/products/${product.id}`,
|
|
375
|
+
};
|
|
376
|
+
return {
|
|
377
|
+
content: [{ type: "text", text: JSON.stringify(result, null, 2) }],
|
|
378
|
+
};
|
|
379
|
+
}
|
|
380
|
+
default:
|
|
381
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.MethodNotFound, `Unknown tool: ${name}`);
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
catch (error) {
|
|
385
|
+
if (error instanceof types_js_1.McpError)
|
|
386
|
+
throw error;
|
|
387
|
+
if (error instanceof zod_1.z.ZodError) {
|
|
388
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InvalidParams, `Invalid parameters: ${error.issues.map((e) => `${e.path.join(".")}: ${e.message}`).join(", ")}`);
|
|
389
|
+
}
|
|
390
|
+
if (error instanceof stripe_1.default.errors.StripeError) {
|
|
391
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Stripe API error: ${error.message}`);
|
|
392
|
+
}
|
|
393
|
+
throw new types_js_1.McpError(types_js_1.ErrorCode.InternalError, `Unexpected error: ${error instanceof Error ? error.message : String(error)}`);
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
// Start server
|
|
397
|
+
async function main() {
|
|
398
|
+
const transport = new stdio_js_1.StdioServerTransport();
|
|
399
|
+
await server.connect(transport);
|
|
400
|
+
console.error("MCP Stripe server running on stdio");
|
|
401
|
+
}
|
|
402
|
+
main().catch((error) => {
|
|
403
|
+
console.error("Fatal error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AC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@neuroequalityorg/mcp-stripe",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "MCP server for Stripe API integration - list customers, create payment links, manage subscriptions, and more",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"bin": {
|
|
7
|
+
"mcp-stripe": "./dist/index.js"
|
|
8
|
+
},
|
|
9
|
+
"scripts": {
|
|
10
|
+
"build": "tsc",
|
|
11
|
+
"start": "node dist/index.js",
|
|
12
|
+
"dev": "tsx src/index.ts",
|
|
13
|
+
"prepublishOnly": "npm run build"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"mcp",
|
|
17
|
+
"model-context-protocol",
|
|
18
|
+
"stripe",
|
|
19
|
+
"payments",
|
|
20
|
+
"ai",
|
|
21
|
+
"llm",
|
|
22
|
+
"claude",
|
|
23
|
+
"anthropic"
|
|
24
|
+
],
|
|
25
|
+
"author": "NeuralEquality.org",
|
|
26
|
+
"license": "MIT",
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "https://github.com/neuroequalityorg/mcp-stripe.git"
|
|
30
|
+
},
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": ">=18.0.0"
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"dist",
|
|
36
|
+
"README.md",
|
|
37
|
+
"LICENSE"
|
|
38
|
+
],
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
41
|
+
"stripe": "^20.0.0",
|
|
42
|
+
"zod": "^3.23.0"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/node": "^22.0.0",
|
|
46
|
+
"typescript": "^5.6.0"
|
|
47
|
+
}
|
|
48
|
+
}
|