@rapay/mcp-server 1.1.9 → 1.1.10
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +4 -1
- package/dist/version-check.d.ts +9 -0
- package/dist/version-check.js +41 -0
- package/package.json +1 -1
package/dist/handlers.js
CHANGED
|
@@ -536,7 +536,7 @@ async function executeSend(args) {
|
|
|
536
536
|
rapay_fee: rapayFee,
|
|
537
537
|
rapay_fee_percent: "2%",
|
|
538
538
|
recipient_receives: recipientReceives,
|
|
539
|
-
note: "Stripe processing fees
|
|
539
|
+
note: "Stripe processing fees also apply. Final breakdown shown upon payment execution.",
|
|
540
540
|
},
|
|
541
541
|
next_step: "Call ra_send again with user_confirmed=true after user approves the fee breakdown.",
|
|
542
542
|
}, null, 2);
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -18,11 +18,12 @@ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"
|
|
|
18
18
|
import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
|
|
19
19
|
import { TOOLS, logToolIntegrity } from "./tools.js";
|
|
20
20
|
import { handleToolCall } from "./handlers.js";
|
|
21
|
+
import { checkForUpdates } from "./version-check.js";
|
|
21
22
|
/**
|
|
22
23
|
* Server metadata
|
|
23
24
|
*/
|
|
24
25
|
const SERVER_NAME = "rapay-mcp";
|
|
25
|
-
const SERVER_VERSION = "1.1.
|
|
26
|
+
export const SERVER_VERSION = "1.1.10";
|
|
26
27
|
/**
|
|
27
28
|
* Initialize MCP server
|
|
28
29
|
*/
|
|
@@ -91,6 +92,8 @@ async function main() {
|
|
|
91
92
|
console.error(`[${SERVER_NAME}] Tools: ${TOOLS.map((t) => t.name).join(", ")}`);
|
|
92
93
|
// Verify tool integrity on startup
|
|
93
94
|
logToolIntegrity();
|
|
95
|
+
// Non-blocking update check (fire-and-forget, logs to stderr if outdated)
|
|
96
|
+
checkForUpdates();
|
|
94
97
|
await server.connect(transport);
|
|
95
98
|
console.error(`[${SERVER_NAME}] Server running`);
|
|
96
99
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version Check Module
|
|
3
|
+
*
|
|
4
|
+
* Fire-and-forget check against npm registry to notify MCP server users
|
|
5
|
+
* when a newer version is available. Logs to stderr so it never
|
|
6
|
+
* interferes with the MCP protocol on stdout.
|
|
7
|
+
*/
|
|
8
|
+
export declare function checkForUpdates(): Promise<void>;
|
|
9
|
+
//# sourceMappingURL=version-check.d.ts.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Version Check Module
|
|
3
|
+
*
|
|
4
|
+
* Fire-and-forget check against npm registry to notify MCP server users
|
|
5
|
+
* when a newer version is available. Logs to stderr so it never
|
|
6
|
+
* interferes with the MCP protocol on stdout.
|
|
7
|
+
*/
|
|
8
|
+
import { SERVER_VERSION } from "./index.js";
|
|
9
|
+
const NPM_REGISTRY_URL = "https://registry.npmjs.org/@rapay/mcp-server/latest";
|
|
10
|
+
const CHECK_TIMEOUT_MS = 3000;
|
|
11
|
+
export async function checkForUpdates() {
|
|
12
|
+
try {
|
|
13
|
+
const controller = new AbortController();
|
|
14
|
+
const timeout = setTimeout(() => controller.abort(), CHECK_TIMEOUT_MS);
|
|
15
|
+
const response = await fetch(NPM_REGISTRY_URL, {
|
|
16
|
+
signal: controller.signal,
|
|
17
|
+
headers: { Accept: "application/json" },
|
|
18
|
+
});
|
|
19
|
+
clearTimeout(timeout);
|
|
20
|
+
if (!response.ok)
|
|
21
|
+
return;
|
|
22
|
+
const data = (await response.json());
|
|
23
|
+
const latest = data.version;
|
|
24
|
+
if (latest && latest !== SERVER_VERSION && isNewer(latest, SERVER_VERSION)) {
|
|
25
|
+
console.error(`[rapay-mcp] Update available: ${SERVER_VERSION} \u2192 ${latest}. Run: npm install -g @rapay/mcp-server`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
// Silent failure — network issues should never block MCP startup
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function isNewer(latest, current) {
|
|
33
|
+
const [lMaj = 0, lMin = 0, lPatch = 0] = latest.split(".").map(Number);
|
|
34
|
+
const [cMaj = 0, cMin = 0, cPatch = 0] = current.split(".").map(Number);
|
|
35
|
+
if (lMaj !== cMaj)
|
|
36
|
+
return lMaj > cMaj;
|
|
37
|
+
if (lMin !== cMin)
|
|
38
|
+
return lMin > cMin;
|
|
39
|
+
return lPatch > cPatch;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=version-check.js.map
|