@rapay/mcp-server 1.2.1 → 1.2.3
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 +25 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/tools.d.ts +3 -3
- package/dist/tools.js +26 -5
- package/package.json +1 -1
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
|
}
|
|
@@ -498,9 +506,9 @@ async function executeSend(args) {
|
|
|
498
506
|
validateSendArgs(args);
|
|
499
507
|
// Convert cents to dollars for CLI (CLI expects dollar amount)
|
|
500
508
|
const amountDollars = args.amount / 100;
|
|
501
|
-
// Calculate fee breakdown using integer math to avoid floating point errors
|
|
502
|
-
// 2% Ra Pay application fee:
|
|
503
|
-
const rapayFeeCents = Math.
|
|
509
|
+
// Calculate fee breakdown using true integer math to avoid floating point errors
|
|
510
|
+
// 2% Ra Pay application fee: integer ceiling of (amount_cents * 2 / 100)
|
|
511
|
+
const rapayFeeCents = Math.floor((args.amount * 2 + 99) / 100);
|
|
504
512
|
const recipientReceivesCents = args.amount - rapayFeeCents;
|
|
505
513
|
// Convert to dollars for display (after integer calculation)
|
|
506
514
|
const rapayFee = rapayFeeCents / 100;
|
|
@@ -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
|
/**
|
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
|
*
|
|
@@ -114,9 +114,30 @@ const QUERY_TOOLS = [
|
|
|
114
114
|
required: [],
|
|
115
115
|
},
|
|
116
116
|
},
|
|
117
|
+
{
|
|
118
|
+
name: "ra_dashboard",
|
|
119
|
+
description: "Open the Stripe Dashboard in the user's browser. " +
|
|
120
|
+
"Provides access to the full Stripe account overview including payments, payouts, and settings.",
|
|
121
|
+
inputSchema: {
|
|
122
|
+
type: "object",
|
|
123
|
+
properties: {},
|
|
124
|
+
required: [],
|
|
125
|
+
},
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: "ra_dispute",
|
|
129
|
+
description: "Open the Stripe Disputes page in the user's browser. " +
|
|
130
|
+
"Disputes and chargebacks must be managed through the Stripe Dashboard interface. " +
|
|
131
|
+
"Respond to disputes within the timeframe to avoid auto-loss.",
|
|
132
|
+
inputSchema: {
|
|
133
|
+
type: "object",
|
|
134
|
+
properties: {},
|
|
135
|
+
required: [],
|
|
136
|
+
},
|
|
137
|
+
},
|
|
117
138
|
];
|
|
118
139
|
/**
|
|
119
|
-
* All
|
|
140
|
+
* All 7 tools combined
|
|
120
141
|
*/
|
|
121
142
|
export const TOOLS = [...PAYMENT_TOOLS, ...QUERY_TOOLS];
|
|
122
143
|
/**
|
|
@@ -144,9 +165,9 @@ export function isSensitiveTool(toolName) {
|
|
|
144
165
|
* 2. Run: RAPAY_DEBUG=1 node dist/index.js (will log computed hash)
|
|
145
166
|
* 3. Update this constant with the new hash
|
|
146
167
|
*
|
|
147
|
-
* Last updated: 2026-02-
|
|
168
|
+
* Last updated: 2026-02-07 (Session 62 added ra_dashboard + ra_dispute)
|
|
148
169
|
*/
|
|
149
|
-
const EXPECTED_TOOL_HASH = "
|
|
170
|
+
const EXPECTED_TOOL_HASH = "dde200868f33fd4d";
|
|
150
171
|
/**
|
|
151
172
|
* Compute the integrity hash of the tool definitions
|
|
152
173
|
* Hash is based on tool names and their input schemas (deterministic)
|