io.github.lx1112/token-safety-check

Registre officiel Autres

Rug check tokens on Base, Ethereum, Arbitrum, Optimism, Polygon, Solana: 0-100 risk score + reasons

Installation

Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).

NPM package token-safety-check
Claude Code
claude mcp add token-safety-check -e 'X402_PRIVATE_KEY=<your x402_private_key>' -e 'TOKEN_SAFETY_MAX_USD=<TOKEN_SAFETY_MAX_USD>' -- npx -y token-safety-check@0.4.1
Configuration JSON (Claude Desktop, Cursor, VS Code)
{
    "mcpServers": {
        "token-safety-check": {
            "command": "npx",
            "args": [
                "-y",
                "token-safety-check@0.4.1"
            ],
            "env": {
                "X402_PRIVATE_KEY": "<your x402_private_key>",
                "TOKEN_SAFETY_MAX_USD": "<TOKEN_SAFETY_MAX_USD>"
            }
        }
    }
}

Variables d'environnement

  • X402_PRIVATE_KEY obligatoire secret Private key of a dedicated wallet holding a little USDC on Base; pays $0.01 per check
  • TOKEN_SAFETY_MAX_USD Refuse checks priced above this many USD (default 0.05)

Documentation

Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.

Sommaire
  1. token-safety-check
  2. Use it from Claude Desktop, Cursor or any MCP client
  3. Use it from code
  4. Use it in Coinbase AgentKit
  5. Use it in LangChain (JS)
  6. Example output (trimmed)
  7. Without this package
  8. Safety notes

token-safety-check

Is this token safe? A rug check for any token on Base, Ethereum, Arbitrum, Optimism, Polygon or Solana, for AI agents and scripts. Each check returns:

  • a 0–100 risk score and level (low, medium, high, critical) with plain-language reasons:
    • who can mint, freeze, blacklist, pause or change fees
    • upgradeable contract code
    • Token-2022 permanent delegates, transfer fees and hooks
    • holder concentration
    • thin or missing liquidity
    • a deployer whose earlier tokens lost their liquidity, or who launches tokens in bulk
  • the facts behind the score: owner, authorities, supply, top holders, pools, and the deployer's launch record when we saw the token launch;
  • USD price and liquidity;
  • a fingerprint. Pass it back as since and the next check tells you what changed: new risks, authority changes, liquidity or price moves. That makes it easy to monitor tokens on a schedule.

A watchlist call re-checks up to 5 tokens at once for the same $0.01, returning a compact entry per token and one-line alerts for whatever changed since your last call.

Checks and watchlist calls cost $0.01 each in USDC on Base, paid automatically with x402 from a wallet you control. There's no account or API key. Errors and invalid input are never charged, and a spending cap stops any call priced above your limit (default $0.05).

The score is rules-based and is not investment advice. Powers count for less on tokens with deep liquidity, where they're usually a large issuer's compliance controls (USDC can freeze and mint, for example).

Use it from Claude Desktop, Cursor or any MCP client

Create a new wallet just for this and send it a little USDC on Base: $1 covers 100 checks. Then add to your MCP config (for Claude Desktop, that's claude_desktop_config.json):

{
  "mcpServers": {
    "token-safety-check": {
      "command": "npx",
      "args": ["-y", "token-safety-check"],
      "env": { "X402_PRIVATE_KEY": "0x<private key of the dedicated wallet>" }
    }
  }
}

The server has two tools:

  • check_token_safety (address, optional chain and since): the full check for one token.
  • watch_tokens (tokens: up to 5 of { address, chain?, since? }): re-checks them all in one paid call and, given each token's earlier fingerprint, reports what changed with one-line alerts.

Optional environment variables:

  • TOKEN_SAFETY_MAX_USD: per-check spending cap, default 0.05.
  • TOKEN_SAFETY_ENDPOINT: point at another deployment.

Use it from code

npm install token-safety-check
import { createTokenSafetyClient } from "token-safety-check";

const client = createTokenSafetyClient({ privateKey: process.env.X402_PRIVATE_KEY as `0x${string}` });

const first = await client.checkToken({ chain: "base", address: "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed" });
console.log(first.risk.score, first.risk.level, first.risk.summary);
// 15 low Low risk: the owner can pause all transfers; ownership is not renounced.

// Later: what changed since then?
const later = await client.checkToken({ address: first.address, chain: "base", since: first.watch.fingerprint });
if (later.watch.changes?.anythingChanged) console.log(later.watch.changes);
Watch what you hold
let list = [
  { chain: "base", address: "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed" },
  { chain: "solana", address: "JUPyiwrYJFskUPiHa7hkeR8VUtAeFoSYbKedZNsDvCN" },
] as const;
let fingerprints: (string | undefined)[] = [];

// Every hour (or however often): one $0.01 call for the whole list.
const w = await client.watchlist(list.map((t, i) => ({ ...t, since: fingerprints[i] })));
for (const alert of w.alerts) console.log(alert); // e.g. "PEPINA (eth): risk 0 -> 30 (medium); liquidity -99.99%"
fingerprints = w.tokens.map((t) => t.fingerprint);

Use it in Coinbase AgentKit

import { customActionProvider } from "@coinbase/agentkit";
import { z } from "zod";
import { createTokenSafetyClient } from "token-safety-check";

const safety = createTokenSafetyClient({ privateKey: process.env.X402_PRIVATE_KEY as `0x${string}` });

export const tokenSafety = customActionProvider({
  name: "check_token_safety",
  description: "Rug check a token on Base, Ethereum, Arbitrum, Optimism, Polygon or Solana: 0-100 risk score with reasons.",
  schema: z.object({
    address: z.string().describe("Token contract or Solana mint address"),
    chain: z.enum(["base", "eth", "arbitrum", "optimism", "polygon", "solana"]).optional(),
  }),
  invoke: async (args) => JSON.stringify(await safety.checkToken(args)),
});
// Add tokenSafety to the actionProviders you pass to AgentKit.from(...).

Use it in LangChain (JS)

import { tool } from "@langchain/core/tools";
import { z } from "zod";
import { createTokenSafetyClient } from "token-safety-check";

const safety = createTokenSafetyClient({ privateKey: process.env.X402_PRIVATE_KEY as `0x${string}` });

export const checkTokenSafety = tool(async (args) => JSON.stringify(await safety.checkToken(args)), {
  name: "check_token_safety",
  description: "Rug check a token on Base, Ethereum, Arbitrum, Optimism, Polygon or Solana: 0-100 risk score with reasons.",
  schema: z.object({
    address: z.string(),
    chain: z.enum(["base", "eth", "arbitrum", "optimism", "polygon", "solana"]).optional(),
  }),
});

Example output (trimmed)

{
  "address": "0x4ed4E862860beD51a9570b96d89aF5E1B0Efefed",
  "chain": "base",
  "name": "Degen",
  "symbol": "DEGEN",
  "risk": {
    "score": 15,
    "level": "low",
    "reasons": [
      { "code": "can-pause", "points": 10, "text": "The owner can pause all transfers." },
      { "code": "owner-not-renounced", "points": 5, "text": "Ownership is not renounced." }
    ],
    "summary": "Low risk: the owner can pause all transfers; ownership is not renounced."
  },
  "market": { "dex": "uniswap-v3", "pairedWith": "WETH", "priceUsd": 0.000963, "quoteSideLiquidityUsd": 134000 },
  "watch": { "fingerprint": "eyJzIjoxNSwi…", "changes": null }
}

Without this package

Both are plain x402 endpoints, so any x402 client can call them directly: GET https://onchaincheck.dev/token?chain=<chain>&address=<address>[&since=<fingerprint>] and GET https://onchaincheck.dev/watchlist?tokens=<chain>:<address>,...[&since=<fp>,...]. It's also listed in the x402 Bazaar.

Safety notes

  • Use a dedicated wallet with a small balance. The key never leaves your machine; it only signs USDC payments of the quoted price.
  • Each check's price is read from the server's payment request before paying, and anything above maxUsdPerCheck / TOKEN_SAFETY_MAX_USD is refused.

MIT licensed.

Questions fréquentes

Qu'est-ce que io.github.lx1112/token-safety-check ?

Rug check tokens on Base, Ethereum, Arbitrum, Optimism, Polygon, Solana: 0-100 risk score + reasons

Comment installer io.github.lx1112/token-safety-check ?

Il s'exécute sur votre machine. Dans Claude Code : claude mcp add token-safety-check -e 'X402_PRIVATE_KEY=<your x402_private_key>' -e 'TOKEN_SAFETY_MAX_USD=<TOKEN_SAFETY_MAX_USD>' -- npx -y token-safety-check@0.4.1. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.

Faut-il une clé API pour io.github.lx1112/token-safety-check ?

Oui. Il attend X402_PRIVATE_KEY, à renseigner dans sa configuration.

io.github.lx1112/token-safety-check est-il open source ?

Oui. Son code est sur GitHub sous licence MIT.

Qui maintient io.github.lx1112/token-safety-check ?

Il est publié par lx1112. AI.tn le référence sans le maintenir ni le recommander.

Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.