@rapay/mcp-server 1.2.2 → 1.2.4
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/dist/handlers.js +22 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tools.d.ts +4 -4
- package/dist/tools.js +78 -7
- package/package.json +2 -2
package/dist/handlers.js
CHANGED
|
@@ -41,6 +41,8 @@ const RATE_LIMITS = {
|
|
|
41
41
|
ra_balance: { windowMs: 60000, maxCalls: 10 },
|
|
42
42
|
ra_history: { windowMs: 60000, maxCalls: 10 },
|
|
43
43
|
ra_whoami: { windowMs: 60000, maxCalls: 20 },
|
|
44
|
+
ra_dashboard: { windowMs: 60000, maxCalls: 5 },
|
|
45
|
+
ra_dispute: { windowMs: 60000, maxCalls: 5 },
|
|
44
46
|
};
|
|
45
47
|
/**
|
|
46
48
|
* In-memory rate limiter
|
|
@@ -278,6 +280,12 @@ export async function handleToolCall(toolName, args) {
|
|
|
278
280
|
case "ra_whoami":
|
|
279
281
|
result = await executeWhoami();
|
|
280
282
|
break;
|
|
283
|
+
case "ra_dashboard":
|
|
284
|
+
result = await executeDashboard();
|
|
285
|
+
break;
|
|
286
|
+
case "ra_dispute":
|
|
287
|
+
result = await executeDispute();
|
|
288
|
+
break;
|
|
281
289
|
default:
|
|
282
290
|
throw new Error(`Unknown tool: ${toolName}`);
|
|
283
291
|
}
|
|
@@ -573,4 +581,18 @@ async function executeWhoami() {
|
|
|
573
581
|
const cliArgs = ["whoami", "--json"];
|
|
574
582
|
return executeCliCommand(cliArgs);
|
|
575
583
|
}
|
|
584
|
+
/**
|
|
585
|
+
* Execute ra dashboard command (opens Stripe Dashboard in browser)
|
|
586
|
+
*/
|
|
587
|
+
async function executeDashboard() {
|
|
588
|
+
const cliArgs = ["dashboard"];
|
|
589
|
+
return executeCliCommand(cliArgs);
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Execute ra dispute command (opens Stripe Disputes page in browser)
|
|
593
|
+
*/
|
|
594
|
+
async function executeDispute() {
|
|
595
|
+
const cliArgs = ["dispute"];
|
|
596
|
+
return executeCliCommand(cliArgs);
|
|
597
|
+
}
|
|
576
598
|
//# sourceMappingURL=handlers.js.map
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/tools.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Ra Pay MCP Server - Tool Definitions
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* 7 Tools:
|
|
5
5
|
* - 2 Payment Operations (SENSITIVE)
|
|
6
|
-
* -
|
|
6
|
+
* - 5 Query/Navigation Operations (Read-only)
|
|
7
7
|
*
|
|
8
8
|
* Note: ra_subscribe removed in v1.2.0 for compliance (Session 53)
|
|
9
9
|
*
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
*/
|
|
12
12
|
import type { Tool } from "@modelcontextprotocol/sdk/types.js";
|
|
13
13
|
/**
|
|
14
|
-
* All
|
|
14
|
+
* All 7 tools combined
|
|
15
15
|
*/
|
|
16
16
|
export declare const TOOLS: Tool[];
|
|
17
17
|
/**
|
|
@@ -24,7 +24,7 @@ export declare const SENSITIVE_TOOLS: Set<string>;
|
|
|
24
24
|
export declare function isSensitiveTool(toolName: string): boolean;
|
|
25
25
|
/**
|
|
26
26
|
* Compute the integrity hash of the tool definitions
|
|
27
|
-
* Hash is based on tool names
|
|
27
|
+
* Hash is based on tool names, input schemas, and annotations (deterministic)
|
|
28
28
|
*/
|
|
29
29
|
export declare function computeToolHash(): string;
|
|
30
30
|
/**
|
package/dist/tools.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Ra Pay MCP Server - Tool Definitions
|
|
3
3
|
*
|
|
4
|
-
*
|
|
4
|
+
* 7 Tools:
|
|
5
5
|
* - 2 Payment Operations (SENSITIVE)
|
|
6
|
-
* -
|
|
6
|
+
* - 5 Query/Navigation Operations (Read-only)
|
|
7
7
|
*
|
|
8
8
|
* Note: ra_subscribe removed in v1.2.0 for compliance (Session 53)
|
|
9
9
|
*
|
|
@@ -60,6 +60,13 @@ const PAYMENT_TOOLS = [
|
|
|
60
60
|
},
|
|
61
61
|
required: ["amount", "recipient_id", "business_purpose", "user_confirmed"],
|
|
62
62
|
},
|
|
63
|
+
annotations: {
|
|
64
|
+
title: "Send Payment",
|
|
65
|
+
readOnlyHint: false,
|
|
66
|
+
destructiveHint: true,
|
|
67
|
+
idempotentHint: false,
|
|
68
|
+
openWorldHint: true,
|
|
69
|
+
},
|
|
63
70
|
},
|
|
64
71
|
{
|
|
65
72
|
name: "ra_refund",
|
|
@@ -71,6 +78,13 @@ const PAYMENT_TOOLS = [
|
|
|
71
78
|
properties: {},
|
|
72
79
|
required: [],
|
|
73
80
|
},
|
|
81
|
+
annotations: {
|
|
82
|
+
title: "Process Refund",
|
|
83
|
+
readOnlyHint: false,
|
|
84
|
+
destructiveHint: true,
|
|
85
|
+
idempotentHint: false,
|
|
86
|
+
openWorldHint: true,
|
|
87
|
+
},
|
|
74
88
|
},
|
|
75
89
|
];
|
|
76
90
|
/**
|
|
@@ -86,6 +100,13 @@ const QUERY_TOOLS = [
|
|
|
86
100
|
properties: {},
|
|
87
101
|
required: [],
|
|
88
102
|
},
|
|
103
|
+
annotations: {
|
|
104
|
+
title: "Check Balance",
|
|
105
|
+
readOnlyHint: true,
|
|
106
|
+
destructiveHint: false,
|
|
107
|
+
idempotentHint: true,
|
|
108
|
+
openWorldHint: true,
|
|
109
|
+
},
|
|
89
110
|
},
|
|
90
111
|
{
|
|
91
112
|
name: "ra_history",
|
|
@@ -103,6 +124,13 @@ const QUERY_TOOLS = [
|
|
|
103
124
|
},
|
|
104
125
|
required: [],
|
|
105
126
|
},
|
|
127
|
+
annotations: {
|
|
128
|
+
title: "Transaction History",
|
|
129
|
+
readOnlyHint: true,
|
|
130
|
+
destructiveHint: false,
|
|
131
|
+
idempotentHint: true,
|
|
132
|
+
openWorldHint: true,
|
|
133
|
+
},
|
|
106
134
|
},
|
|
107
135
|
{
|
|
108
136
|
name: "ra_whoami",
|
|
@@ -113,10 +141,52 @@ const QUERY_TOOLS = [
|
|
|
113
141
|
properties: {},
|
|
114
142
|
required: [],
|
|
115
143
|
},
|
|
144
|
+
annotations: {
|
|
145
|
+
title: "Account Info",
|
|
146
|
+
readOnlyHint: true,
|
|
147
|
+
destructiveHint: false,
|
|
148
|
+
idempotentHint: true,
|
|
149
|
+
openWorldHint: true,
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "ra_dashboard",
|
|
154
|
+
description: "Open the Stripe Dashboard in the user's browser. " +
|
|
155
|
+
"Provides access to the full Stripe account overview including payments, payouts, and settings.",
|
|
156
|
+
inputSchema: {
|
|
157
|
+
type: "object",
|
|
158
|
+
properties: {},
|
|
159
|
+
required: [],
|
|
160
|
+
},
|
|
161
|
+
annotations: {
|
|
162
|
+
title: "Open Dashboard",
|
|
163
|
+
readOnlyHint: true,
|
|
164
|
+
destructiveHint: false,
|
|
165
|
+
idempotentHint: true,
|
|
166
|
+
openWorldHint: true,
|
|
167
|
+
},
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: "ra_dispute",
|
|
171
|
+
description: "Open the Stripe Disputes page in the user's browser. " +
|
|
172
|
+
"Disputes and chargebacks must be managed through the Stripe Dashboard interface. " +
|
|
173
|
+
"Respond to disputes within the timeframe to avoid auto-loss.",
|
|
174
|
+
inputSchema: {
|
|
175
|
+
type: "object",
|
|
176
|
+
properties: {},
|
|
177
|
+
required: [],
|
|
178
|
+
},
|
|
179
|
+
annotations: {
|
|
180
|
+
title: "Manage Disputes",
|
|
181
|
+
readOnlyHint: true,
|
|
182
|
+
destructiveHint: false,
|
|
183
|
+
idempotentHint: true,
|
|
184
|
+
openWorldHint: true,
|
|
185
|
+
},
|
|
116
186
|
},
|
|
117
187
|
];
|
|
118
188
|
/**
|
|
119
|
-
* All
|
|
189
|
+
* All 7 tools combined
|
|
120
190
|
*/
|
|
121
191
|
export const TOOLS = [...PAYMENT_TOOLS, ...QUERY_TOOLS];
|
|
122
192
|
/**
|
|
@@ -137,25 +207,26 @@ export function isSensitiveTool(toolName) {
|
|
|
137
207
|
*/
|
|
138
208
|
/**
|
|
139
209
|
* Expected hash of tool definitions (update when tools change)
|
|
140
|
-
* This is the SHA-256 hash of the sorted tool names
|
|
210
|
+
* This is the SHA-256 hash of the sorted tool names, input schemas, and annotations.
|
|
141
211
|
*
|
|
142
212
|
* To regenerate after modifying tools:
|
|
143
213
|
* 1. Run: cd mcp-server && npm run build
|
|
144
214
|
* 2. Run: RAPAY_DEBUG=1 node dist/index.js (will log computed hash)
|
|
145
215
|
* 3. Update this constant with the new hash
|
|
146
216
|
*
|
|
147
|
-
* Last updated: 2026-02-
|
|
217
|
+
* Last updated: 2026-02-08 (Session 64 added annotations to hash)
|
|
148
218
|
*/
|
|
149
|
-
const EXPECTED_TOOL_HASH = "
|
|
219
|
+
const EXPECTED_TOOL_HASH = "f5d8adb129c9c36d";
|
|
150
220
|
/**
|
|
151
221
|
* Compute the integrity hash of the tool definitions
|
|
152
|
-
* Hash is based on tool names
|
|
222
|
+
* Hash is based on tool names, input schemas, and annotations (deterministic)
|
|
153
223
|
*/
|
|
154
224
|
export function computeToolHash() {
|
|
155
225
|
// Create a deterministic representation of tools
|
|
156
226
|
const toolData = TOOLS.map((tool) => ({
|
|
157
227
|
name: tool.name,
|
|
158
228
|
inputSchema: tool.inputSchema,
|
|
229
|
+
annotations: tool.annotations ?? null,
|
|
159
230
|
}))
|
|
160
231
|
.sort((a, b) => a.name.localeCompare(b.name))
|
|
161
232
|
.map((t) => JSON.stringify(t))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rapay/mcp-server",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.4",
|
|
4
4
|
"description": "Ra Pay MCP Server for Claude Desktop and Claude Code - AI Agent Payment Infrastructure",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@modelcontextprotocol/sdk": "^1.
|
|
52
|
+
"@modelcontextprotocol/sdk": "^1.11.0",
|
|
53
53
|
"cross-spawn": "^7.0.6"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|