@t2000/mcp 0.20.38 → 0.22.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 CHANGED
@@ -235,6 +235,21 @@ function registerReadTools(server, agent) {
235
235
  }
236
236
  }
237
237
  );
238
+ server.tool(
239
+ "t2000_services",
240
+ "Discover available MPP services the agent can pay for with t2000_pay. Returns all services with URLs, endpoints, descriptions, and prices. Use this BEFORE t2000_pay to find the right URL and request format. Includes AI models, search, media, weather, maps, code execution, email, gift cards, physical mail, and more.",
241
+ {},
242
+ async () => {
243
+ try {
244
+ const res = await fetch("https://mpp.t2000.ai/api/services");
245
+ if (!res.ok) throw new Error(`Service discovery failed (${res.status})`);
246
+ const services = await res.json();
247
+ return { content: [{ type: "text", text: JSON.stringify(services) }] };
248
+ } catch (err) {
249
+ return errorResult(err);
250
+ }
251
+ }
252
+ );
238
253
  server.tool(
239
254
  "t2000_sentinel_list",
240
255
  "List active Sui Sentinels \u2014 AI agents with prize pools you can attack. Shows name, attack fee, prize pool, and attack count. Use this for bounty hunting.",
@@ -761,6 +776,40 @@ function registerWriteTools(server, agent) {
761
776
  }
762
777
  }
763
778
  );
779
+ server.tool(
780
+ "t2000_pay",
781
+ `Make a paid API request using MPP (Machine Payments Protocol). Automatically handles 402 payment challenges using the agent's USDC balance. Enforces safeguards. Returns the API response and payment receipt.
782
+
783
+ IMPORTANT: Use t2000_services first to discover available services and their URLs. All services are at https://mpp.t2000.ai/.
784
+
785
+ Common examples:
786
+ - Chat: POST https://mpp.t2000.ai/openai/v1/chat/completions {"model":"gpt-4o","messages":[...]}
787
+ - Search: POST https://mpp.t2000.ai/brave/v1/web/search {"q":"query"}
788
+ - Image: POST https://mpp.t2000.ai/fal/fal-ai/flux/dev {"prompt":"..."}
789
+ - Weather: POST https://mpp.t2000.ai/openweather/v1/weather {"q":"Tokyo"}
790
+ - Email: POST https://mpp.t2000.ai/resend/v1/emails {"from":"...","to":"...","subject":"...","text":"..."}
791
+ - Gift card: POST https://mpp.t2000.ai/reloadly/v1/order {"productId":120,"unitPrice":20,"recipientEmail":"..."}
792
+ - Postcard: POST https://mpp.t2000.ai/lob/v1/postcards {"to":{"name":"...","address_line1":"...","address_city":"...","address_state":"...","address_zip":"..."},...}
793
+ - Letter: POST https://mpp.t2000.ai/lob/v1/letters {similar to postcards}
794
+ - Code exec: POST https://mpp.t2000.ai/judge0/v1/submissions {"source_code":"...","language_id":71}`,
795
+ {
796
+ url: z.string().describe("Full URL of the MPP service endpoint (use t2000_services to discover available URLs)"),
797
+ method: z.enum(["GET", "POST", "PUT", "DELETE"]).default("POST").describe("HTTP method (most services use POST)"),
798
+ body: z.string().optional().describe("JSON request body (required for POST endpoints)"),
799
+ headers: z.record(z.string()).optional().describe("Additional HTTP headers"),
800
+ maxPrice: z.number().default(1).describe("Max USD to pay (default: $1.00). Set higher for gift cards/commerce.")
801
+ },
802
+ async ({ url, method, body, headers, maxPrice }) => {
803
+ try {
804
+ const result = await mutex.run(
805
+ () => agent.pay({ url, method, body, headers, maxPrice })
806
+ );
807
+ return { content: [{ type: "text", text: JSON.stringify(result) }] };
808
+ } catch (err) {
809
+ return errorResult(err);
810
+ }
811
+ }
812
+ );
764
813
  server.tool(
765
814
  "t2000_sentinel_attack",
766
815
  "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.",
@@ -1746,7 +1795,7 @@ async function startMcpServer(opts) {
1746
1795
  );
1747
1796
  process.exit(1);
1748
1797
  }
1749
- const server = new McpServer({ name: "t2000", version: "0.20.1" });
1798
+ const server = new McpServer({ name: "t2000", version: "0.22.0" });
1750
1799
  registerReadTools(server, agent);
1751
1800
  registerWriteTools(server, agent);
1752
1801
  registerSafetyTools(server, agent);