@t2000/mcp 0.20.37 → 0.21.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/dist/bin.js +21 -0
- package/dist/bin.js.map +1 -1
- package/dist/index.js +21 -0
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -761,6 +761,27 @@ function registerWriteTools(server, agent) {
|
|
|
761
761
|
}
|
|
762
762
|
}
|
|
763
763
|
);
|
|
764
|
+
server.tool(
|
|
765
|
+
"t2000_pay",
|
|
766
|
+
"Make a paid API request. Automatically handles MPP 402 payment challenges using the agent's USDC balance. Enforces safeguards. Returns the API response and payment receipt.",
|
|
767
|
+
{
|
|
768
|
+
url: z.string().describe("URL of the MPP-protected resource"),
|
|
769
|
+
method: z.enum(["GET", "POST", "PUT", "DELETE"]).default("GET").describe("HTTP method"),
|
|
770
|
+
body: z.string().optional().describe("JSON request body"),
|
|
771
|
+
headers: z.record(z.string()).optional().describe("Additional HTTP headers"),
|
|
772
|
+
maxPrice: z.number().default(1).describe("Max USD to pay (default: $1.00)")
|
|
773
|
+
},
|
|
774
|
+
async ({ url, method, body, headers, maxPrice }) => {
|
|
775
|
+
try {
|
|
776
|
+
const result = await mutex.run(
|
|
777
|
+
() => agent.pay({ url, method, body, headers, maxPrice })
|
|
778
|
+
);
|
|
779
|
+
return { content: [{ type: "text", text: JSON.stringify(result) }] };
|
|
780
|
+
} catch (err) {
|
|
781
|
+
return errorResult(err);
|
|
782
|
+
}
|
|
783
|
+
}
|
|
784
|
+
);
|
|
764
785
|
server.tool(
|
|
765
786
|
"t2000_sentinel_attack",
|
|
766
787
|
"Attack a Sui Sentinel with a prompt to try to breach its defenses and win the prize pool. Costs SUI (the attack fee). Use t2000_sentinel_list to find targets first.",
|