chaink9-mcp 0.1.3 → 0.2.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/README.md +8 -4
- package/index.js +32 -9
- package/manifest.json +47 -11
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -9,8 +9,8 @@ forks the chain and really buys and sells the token through its market (PancakeS
|
|
|
9
9
|
Uniswap V2, V3 or V4, hooks included), then runs 70+ checks. A honeypot is caught by what it
|
|
10
10
|
does, not by what its code looks like.
|
|
11
11
|
|
|
12
|
-
Each successful call is paid automatically in **USDC on Base**
|
|
13
|
-
[x402](https://x402.org) protocol, from a wallet you choose. There is no account and no API
|
|
12
|
+
Each successful call is paid automatically in **USDC on Base** or **USDT on BNB Smart Chain**
|
|
13
|
+
with the [x402](https://x402.org) protocol, from a wallet you choose. There is no account and no API
|
|
14
14
|
key, and failed calls (bad input, not a token, no liquidity, engine busy) are free.
|
|
15
15
|
|
|
16
16
|
## Tools
|
|
@@ -42,6 +42,9 @@ Every tool takes `chain`: `bsc` (default), `eth`, `base` or `arc`. `trace` takes
|
|
|
42
42
|
|
|
43
43
|
1. Make a **new wallet just for this** and put a few dollars of **USDC on Base** in it. It
|
|
44
44
|
needs no ETH: x402 payments are signatures, and the payment service pays the gas.
|
|
45
|
+
To pay on BNB Smart Chain instead, put **USDT on BSC** in it plus about $0.01 of **BNB**, and
|
|
46
|
+
set `CHAINK9_PAY_NETWORK=bsc`. BSC's USDT is paid through Permit2: the first payment also
|
|
47
|
+
signs a one-time approval, which is the only thing that uses the BNB.
|
|
45
48
|
2. Add the server to your MCP client with that wallet's private key.
|
|
46
49
|
|
|
47
50
|
Claude Code:
|
|
@@ -80,12 +83,13 @@ clients can connect and use `verdict`; to pay from those, use the package above.
|
|
|
80
83
|
|
|
81
84
|
| Variable | Default | Meaning |
|
|
82
85
|
|---|---|---|
|
|
83
|
-
| `CHAINK9_PRIVATE_KEY` | (required) | Private key of the dedicated
|
|
86
|
+
| `CHAINK9_PRIVATE_KEY` | (required) | Private key of the dedicated wallet that pays. |
|
|
87
|
+
| `CHAINK9_PAY_NETWORK` | `base` | `base` pays in USDC on Base, `bsc` in USDT on BNB Smart Chain. |
|
|
84
88
|
| `CHAINK9_MAX_USD_PER_CALL` | `0.05` | Any single payment above this is refused. |
|
|
85
89
|
| `CHAINK9_MAX_USD_PER_DAY` | `1` | Stops paying once this much was spent today (UTC). |
|
|
86
90
|
|
|
87
91
|
The daily total is kept in `~/.chaink9-mcp/spend.json`. The wallet only ever signs payments
|
|
88
|
-
on
|
|
92
|
+
on the network you chose, and the key never leaves your machine.
|
|
89
93
|
|
|
90
94
|
## Disclaimer
|
|
91
95
|
|
package/index.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
// chaink9-mcp: ChainK9's token risk checks as MCP tools, paid per call with x402 (USDC on Base
|
|
2
|
+
// chaink9-mcp: ChainK9's token risk checks as MCP tools, paid per call with x402 (USDC on Base,
|
|
3
|
+
// or USDT on BNB Smart Chain).
|
|
3
4
|
// Tools come from the live catalog (https://api.chaink9.com/openapi.json), so new products
|
|
4
5
|
// appear without updating this package.
|
|
5
6
|
|
|
@@ -12,10 +13,27 @@ import { CallToolRequestSchema, ListToolsRequestSchema } from "@modelcontextprot
|
|
|
12
13
|
import { decodePaymentResponseHeader, wrapFetchWithPaymentFromConfig } from "@x402/fetch";
|
|
13
14
|
import { ExactEvmScheme } from "@x402/evm";
|
|
14
15
|
import { privateKeyToAccount } from "viem/accounts";
|
|
16
|
+
import { parseUnits } from "viem";
|
|
15
17
|
|
|
16
18
|
const VERSION = JSON.parse(readFileSync(new URL("./package.json", import.meta.url), "utf8")).version;
|
|
17
19
|
const API = "https://api.chaink9.com";
|
|
18
|
-
|
|
20
|
+
// Where the wallet pays. BSC's USDT has no EIP-3009, so it goes through Permit2: the first payment
|
|
21
|
+
// also signs a one-time approval, which needs a little BNB for gas.
|
|
22
|
+
const NETWORKS = {
|
|
23
|
+
base: { id: "eip155:8453", label: "USDC on Base", wallet: "a little USDC on Base (no ETH needed)" },
|
|
24
|
+
bsc: {
|
|
25
|
+
id: "eip155:56",
|
|
26
|
+
label: "USDT on BNB Smart Chain",
|
|
27
|
+
wallet: "a little USDT on BNB Smart Chain, plus about $0.01 of BNB for the one-time Permit2 approval",
|
|
28
|
+
usdt: "0x55d398326f99059fF775485246999027B3197955",
|
|
29
|
+
rpcUrl: "https://bsc-dataseed.bnbchain.org", // reads the Permit2 allowance, prices the approval
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
const PAY = NETWORKS[(process.env.CHAINK9_PAY_NETWORK || "base").trim().toLowerCase()];
|
|
33
|
+
if (!PAY) {
|
|
34
|
+
console.error(`[chaink9] CHAINK9_PAY_NETWORK must be one of: ${Object.keys(NETWORKS).join(", ")}`);
|
|
35
|
+
process.exit(1);
|
|
36
|
+
}
|
|
19
37
|
const MAX_PER_CALL = Number(process.env.CHAINK9_MAX_USD_PER_CALL || 0.05);
|
|
20
38
|
const MAX_PER_DAY = Number(process.env.CHAINK9_MAX_USD_PER_DAY || 1);
|
|
21
39
|
const DIR = join(homedir(), ".chaink9-mcp");
|
|
@@ -40,7 +58,7 @@ async function loadCatalog() {
|
|
|
40
58
|
price,
|
|
41
59
|
tool: {
|
|
42
60
|
name,
|
|
43
|
-
description: `${op.description || op.summary || name} Costs $${price} per successful call, paid automatically in
|
|
61
|
+
description: `${op.description || op.summary || name} Costs $${price} per successful call, paid automatically in ${PAY.label}; failed calls are free.`,
|
|
44
62
|
inputSchema: op.requestBody?.content?.["application/json"]?.schema ?? { type: "object", properties: {} },
|
|
45
63
|
},
|
|
46
64
|
});
|
|
@@ -55,11 +73,16 @@ function payer() {
|
|
|
55
73
|
if (payFetch) return payFetch;
|
|
56
74
|
const key = process.env.CHAINK9_PRIVATE_KEY;
|
|
57
75
|
if (!key) return null;
|
|
58
|
-
// The x402 client signs
|
|
59
|
-
// whatever a server asks for.
|
|
76
|
+
// The x402 client signs payments on PAY's network only and refuses any single one above the cap,
|
|
77
|
+
// whatever a server asks for. x402 clients pay only in tokens they know by default; BSC's USDT
|
|
78
|
+
// isn't one, so it's opted in with the same cap in its 18 decimals.
|
|
79
|
+
const account = privateKeyToAccount(key);
|
|
60
80
|
payFetch = wrapFetchWithPaymentFromConfig(fetch, {
|
|
61
|
-
schemes: [{ network:
|
|
62
|
-
spendControls: {
|
|
81
|
+
schemes: [{ network: PAY.id, client: PAY.rpcUrl ? new ExactEvmScheme(account, { 56: { rpcUrl: PAY.rpcUrl } }) : new ExactEvmScheme(account) }],
|
|
82
|
+
spendControls: {
|
|
83
|
+
maxAmountPerPayment: `$${MAX_PER_CALL}`,
|
|
84
|
+
...(PAY.usdt && { allowedAssets: [{ network: PAY.id, asset: PAY.usdt, maxAmountPerPayment: parseUnits(String(MAX_PER_CALL), 18).toString() }] }),
|
|
85
|
+
},
|
|
63
86
|
});
|
|
64
87
|
return payFetch;
|
|
65
88
|
}
|
|
@@ -88,7 +111,7 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
88
111
|
const entry = (await loadCatalog()).get(req.params.name);
|
|
89
112
|
if (!entry) return fail(`Unknown tool ${req.params.name}.`);
|
|
90
113
|
const pay = payer();
|
|
91
|
-
if (!pay) return fail(
|
|
114
|
+
if (!pay) return fail(`No wallet configured. Set CHAINK9_PRIVATE_KEY to the private key of a dedicated wallet holding ${PAY.wallet}; see https://api.chaink9.com.`);
|
|
92
115
|
if (!(entry.price <= MAX_PER_CALL)) return fail(`${req.params.name} costs $${entry.price}, above CHAINK9_MAX_USD_PER_CALL ($${MAX_PER_CALL}).`);
|
|
93
116
|
if (spentToday() + entry.price > MAX_PER_DAY) return fail(`Daily limit reached: $${spentToday()} of CHAINK9_MAX_USD_PER_DAY ($${MAX_PER_DAY}) spent today.`);
|
|
94
117
|
|
|
@@ -116,4 +139,4 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
116
139
|
});
|
|
117
140
|
|
|
118
141
|
await server.connect(new StdioServerTransport());
|
|
119
|
-
log(`chaink9-mcp ${VERSION} ready (limits: $${MAX_PER_CALL}/call, $${MAX_PER_DAY}/day)`);
|
|
142
|
+
log(`chaink9-mcp ${VERSION} ready (pays in ${PAY.label}; limits: $${MAX_PER_CALL}/call, $${MAX_PER_DAY}/day)`);
|
package/manifest.json
CHANGED
|
@@ -2,12 +2,19 @@
|
|
|
2
2
|
"manifest_version": "0.3",
|
|
3
3
|
"name": "chaink9",
|
|
4
4
|
"display_name": "ChainK9 token risk checks",
|
|
5
|
-
"version": "0.
|
|
5
|
+
"version": "0.2.0",
|
|
6
6
|
"icon": "icon.png",
|
|
7
|
-
"description": "Check a token on BNB Smart Chain, Ethereum, Base or Arc for honeypots, hidden taxes and owner traps before buying it. Paid per call in USDC on Base.",
|
|
8
|
-
"long_description": "ChainK9 checks a token by doing what a buyer would: it forks the chain and really buys and sells the token through its market (Uniswap or PancakeSwap V2, V3 or V4, hooks included), then runs 70+ checks: honeypot, buy and sell taxes and how they change, owner pause, blacklist, mint and confiscation powers, transfer and sell limits, liquidity, upgrade authority and more. Tools also simulate a trade for a given wallet, test exits, preview a transaction, read liquidity, follow new launches and follow the money out of a transaction. There is no account and no API key: each successful call is paid automatically in USDC on Base with the x402 protocol, from a wallet you choose; failed calls are free. Use a dedicated wallet holding a few dollars of USDC; the per-call and per-day limits below are a second safety net. Results are evidence from a private copy of the chain at one block, not a guarantee and not financial advice.",
|
|
9
|
-
"author": {
|
|
10
|
-
|
|
7
|
+
"description": "Check a token on BNB Smart Chain, Ethereum, Base or Arc for honeypots, hidden taxes and owner traps before buying it. Paid per call in USDC on Base or USDT on BNB Smart Chain.",
|
|
8
|
+
"long_description": "ChainK9 checks a token by doing what a buyer would: it forks the chain and really buys and sells the token through its market (Uniswap or PancakeSwap V2, V3 or V4, hooks included), then runs 70+ checks: honeypot, buy and sell taxes and how they change, owner pause, blacklist, mint and confiscation powers, transfer and sell limits, liquidity, upgrade authority and more. Tools also simulate a trade for a given wallet, test exits, preview a transaction, read liquidity, follow new launches and follow the money out of a transaction. There is no account and no API key: each successful call is paid automatically in USDC on Base or USDT on BNB Smart Chain with the x402 protocol, from a wallet you choose; failed calls are free. Use a dedicated wallet holding a few dollars of USDC on Base (or USDT plus a little BNB on BSC); the per-call and per-day limits below are a second safety net. Results are evidence from a private copy of the chain at one block, not a guarantee and not financial advice.",
|
|
9
|
+
"author": {
|
|
10
|
+
"name": "ChainK9",
|
|
11
|
+
"email": "hello@chaink9.com",
|
|
12
|
+
"url": "https://chaink9.com"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/ChainK9/chaink9-mcp"
|
|
17
|
+
},
|
|
11
18
|
"homepage": "https://chaink9.com",
|
|
12
19
|
"support": "https://github.com/ChainK9/chaink9-mcp/issues",
|
|
13
20
|
"server": {
|
|
@@ -15,26 +22,55 @@
|
|
|
15
22
|
"entry_point": "index.js",
|
|
16
23
|
"mcp_config": {
|
|
17
24
|
"command": "node",
|
|
18
|
-
"args": [
|
|
25
|
+
"args": [
|
|
26
|
+
"${__dirname}/index.js"
|
|
27
|
+
],
|
|
19
28
|
"env": {
|
|
20
29
|
"CHAINK9_PRIVATE_KEY": "${user_config.private_key}",
|
|
21
30
|
"CHAINK9_MAX_USD_PER_CALL": "${user_config.max_usd_per_call}",
|
|
22
|
-
"CHAINK9_MAX_USD_PER_DAY": "${user_config.max_usd_per_day}"
|
|
31
|
+
"CHAINK9_MAX_USD_PER_DAY": "${user_config.max_usd_per_day}",
|
|
32
|
+
"CHAINK9_PAY_NETWORK": "${user_config.pay_network}"
|
|
23
33
|
}
|
|
24
34
|
}
|
|
25
35
|
},
|
|
26
36
|
"tools_generated": true,
|
|
27
|
-
"keywords": [
|
|
37
|
+
"keywords": [
|
|
38
|
+
"token security",
|
|
39
|
+
"honeypot",
|
|
40
|
+
"rug pull",
|
|
41
|
+
"bsc",
|
|
42
|
+
"ethereum",
|
|
43
|
+
"base",
|
|
44
|
+
"x402",
|
|
45
|
+
"usdc",
|
|
46
|
+
"usdt"
|
|
47
|
+
],
|
|
28
48
|
"license": "MIT",
|
|
29
|
-
"compatibility": {
|
|
49
|
+
"compatibility": {
|
|
50
|
+
"platforms": [
|
|
51
|
+
"darwin",
|
|
52
|
+
"win32",
|
|
53
|
+
"linux"
|
|
54
|
+
],
|
|
55
|
+
"runtimes": {
|
|
56
|
+
"node": ">=20.0.0"
|
|
57
|
+
}
|
|
58
|
+
},
|
|
30
59
|
"user_config": {
|
|
31
60
|
"private_key": {
|
|
32
61
|
"type": "string",
|
|
33
|
-
"title": "
|
|
34
|
-
"description": "0x + 64 hex. A NEW, dedicated wallet holding a few dollars of USDC on Base (no ETH needed). Never your main wallet.",
|
|
62
|
+
"title": "Wallet private key",
|
|
63
|
+
"description": "0x + 64 hex. A NEW, dedicated wallet holding a few dollars of USDC on Base (no ETH needed), or USDT plus about $0.01 of BNB on BNB Smart Chain. Never your main wallet.",
|
|
35
64
|
"sensitive": true,
|
|
36
65
|
"required": true
|
|
37
66
|
},
|
|
67
|
+
"pay_network": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"title": "Pay on",
|
|
70
|
+
"description": "base: USDC on Base. bsc: USDT on BNB Smart Chain.",
|
|
71
|
+
"default": "base",
|
|
72
|
+
"required": false
|
|
73
|
+
},
|
|
38
74
|
"max_usd_per_call": {
|
|
39
75
|
"type": "number",
|
|
40
76
|
"title": "Max USD per call",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "chaink9-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "MCP server for ChainK9: token risk checks on BNB Smart Chain, Ethereum, Base and Arc. It buys and sells the token on a private fork of the chain to catch honeypots, hidden taxes and owner traps. Paid per call in USDC on Base with x402.",
|
|
5
5
|
"mcpName": "com.chaink9/chaink9",
|
|
6
6
|
"type": "module",
|