taskfleet-mcp 0.1.0 → 0.1.1
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/index.mjs +9 -6
- package/package.json +4 -2
package/index.mjs
CHANGED
|
@@ -20,7 +20,7 @@ import { toolName } from "./toolname.mjs";
|
|
|
20
20
|
|
|
21
21
|
const BASE = (process.env.TASKFLEET_URL || "https://taskfleet.net").replace(/\/$/, "");
|
|
22
22
|
const PK = process.env.BUYER_WALLET_PRIVATE_KEY || "";
|
|
23
|
-
const VERSION = "0.1.
|
|
23
|
+
const VERSION = "0.1.1";
|
|
24
24
|
|
|
25
25
|
async function loadServices() {
|
|
26
26
|
const res = await fetch(`${BASE}/.well-known/x402.json`);
|
|
@@ -34,12 +34,15 @@ async function loadServices() {
|
|
|
34
34
|
async function makeFetch() {
|
|
35
35
|
if (!PK) return { fetchImpl: fetch, paid: false };
|
|
36
36
|
const { privateKeyToAccount } = await import("viem/accounts");
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
37
|
+
// TaskFleet serves x402 **v2** payment requirements (PAYMENT-REQUIRED header,
|
|
38
|
+
// network "eip155:8453"). The legacy `x402-fetch` package only parses v1 and
|
|
39
|
+
// fails before signing, so use the v2 SDK here.
|
|
40
|
+
const { wrapFetchWithPayment, x402Client } = await import("@x402/fetch");
|
|
41
|
+
const { ExactEvmScheme } = await import("@x402/evm/exact/client");
|
|
40
42
|
const account = privateKeyToAccount(PK.startsWith("0x") ? PK : `0x${PK}`);
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
+
const client = new x402Client();
|
|
44
|
+
client.register("eip155:*", new ExactEvmScheme(account));
|
|
45
|
+
return { fetchImpl: wrapFetchWithPayment(fetch, client), paid: true };
|
|
43
46
|
}
|
|
44
47
|
|
|
45
48
|
const server = new Server({ name: "taskfleet", version: VERSION }, { capabilities: { tools: {} } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "taskfleet-mcp",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
|
+
"mcpName": "io.github.BFAI-1/taskfleet-mcp",
|
|
4
5
|
"description": "MCP server exposing TaskFleet's pay-per-call AI task APIs (web search, scrape, extract, translate, code review, on-chain wallet intel) as tools. Payment via x402 (USDC on Base).",
|
|
5
6
|
"type": "module",
|
|
6
7
|
"bin": { "taskfleet-mcp": "index.mjs" },
|
|
@@ -11,7 +12,8 @@
|
|
|
11
12
|
"dependencies": {
|
|
12
13
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
13
14
|
"viem": "^2.21.0",
|
|
14
|
-
"x402
|
|
15
|
+
"@x402/fetch": "^2",
|
|
16
|
+
"@x402/evm": "^2"
|
|
15
17
|
},
|
|
16
18
|
"license": "MIT"
|
|
17
19
|
}
|