npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@dexterai/x402-mcp-tools

v0.4.0

Published

Shared MCP tool registrations for the Dexter x402 ecosystem. One register*Tool function per tool, plus widget metadata. Consumed by @dexterai/opendexter (npm CLI), the hosted public MCP server, and the hosted authenticated MCP server.

Readme


What is @dexterai/x402-mcp-tools?

The shared tool-registration layer for every Dexter MCP surface. One register*Tool function per tool, plus an adapter contract that lets each consumer wire its own wallet, session, and storage backend behind a uniform interface.

Today this package powers three production surfaces:

  • @dexterai/opendexter — the npm CLI that exposes Dexter's full toolset to local AI clients (Cursor, Claude Code, Codex, VS Code, etc.).
  • The hosted public MCP server at https://open.dexter.cash/mcp — anonymous session-bound wallets.
  • The hosted authenticated MCP server — Supabase-managed wallets for signed-in users.

All three consume the same registrars from this package. Their tool surfaces look identical to clients because the logic is shared; what differs is each consumer's wallet adapter, session storage, and widget URI scheme.


Install

npm install @dexterai/x402-mcp-tools

Peer-friendly with @dexterai/dextercard, @dexterai/x402-core, and @modelcontextprotocol/sdk.

Quickstart

import {
  composeAllTools,
  composeCardTools,
  buildToolMetas,
  buildCardToolMetas,
} from "@dexterai/x402-mcp-tools";
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";

const server = new McpServer({ name: "my-dexter-server", version: "1.0.0" });

// x402 tools (search, check, fetch, access, wallet)
composeAllTools(server, {
  apiBaseUrl: "https://x402.dexter.cash",
  metas: buildToolMetas(myWidgetUris),
  wallet: myWalletAdapter,
});

// Dextercard tools (status, issue, link-wallet, freeze)
composeCardTools(server, {
  cards: myCardsAdapter,
  metas: buildCardToolMetas(myCardWidgetUris),
});

Tools

This package exposes nine MCP tools across two domains.

x402 Marketplace Tools

| Tool | Description | |------|-------------| | x402_search | Semantic capability search over the Dexter x402 marketplace. Returns strong + related matches with synonym expansion and cross-encoder LLM rerank. | | x402_check | Probe an endpoint for x402 payment requirements without paying. Returns pricing per chain plus input/output schemas. | | x402_fetch | Call any x402 endpoint with automatic USDC settlement. | | x402_pay | Alias of x402_fetch for clients that want an explicit payment verb. | | x402_access | Access identity-gated endpoints with Sign-In-With-X (Solana / EVM) instead of payment. | | x402_wallet | Show wallet addresses, USDC balances per chain, and deposit hints. |

Dextercard Tools

| Tool | Description | |------|-------------| | card_status | Show current card state: stage indicator, account, card metadata, linked wallets, recent transactions. | | card_issue | Stage-aware issuance orchestrator. Takes the next correct action automatically based on the user's current onboarding state. | | card_link_wallet | Authorize a wallet to fund card transactions up to a per-wallet cap. | | card_freeze | Pause or resume the card with a single frozen: boolean argument. |


Adapter Contracts

Tools never reach into a global wallet, filesystem, or environment variable. Each consumer provides three adapters:

WalletAdapter

Resolves balances and signers for the active session. Implementations:

  • npm CLI: file-backed local keypair at ~/.dexterai-mcp/wallet.json
  • hosted public: session-bound anonymous wallet
  • hosted authed: Supabase-managed managed wallet
interface WalletAdapter {
  getInfo(): WalletInfo;
  getAvailableUsdc(network: string): Promise<number>;
  getAllBalances(): Promise<WalletBalances>;
  getSolanaSigner(): SolanaSigner | null;
  getEvmSigner(): EvmSigner | null;
}

CardsAdapter and CardOperations

Resolves a {@link CardOperations} instance bound to the active user (or null when no session is configured). Returning null makes the card tools no-op gracefully with a configurable hint, instead of erroring.

interface CardsAdapter {
  getOperations(): Promise<CardOperations | null> | CardOperations | null;
  describe?(): Promise<string | null> | string | null;
}

CardOperations is the small subset of the Dextercard SDK surface that the registrars actually call — exposed as an interface so consumers can plug in either:

  • LocalCardOperations(dextercardClient) — wraps a real Dextercard instance (npm CLI; any environment that holds the carrier session in-process).
  • createRemoteCardOperations({ baseUrl, userId, hmacSecret }) — calls a remote /internal/dextercard/* HMAC-gated surface (hosted MCP servers that intentionally don't hold carrier sessions in-process). Translates HTTP errors back to the SDK's typed exceptions, so registrars work identically with either adapter.

Migrating from 0.2.x: getClient(): Dextercard | null was renamed to getOperations(): CardOperations | null. To preserve old behavior, wrap your existing Dextercard with new LocalCardOperations(dextercard).

Widget URIs

Each consumer computes its own content-hashed ui:// URIs (typically by SHA-1 of the widget HTML). The buildToolMetas and buildCardToolMetas helpers turn those URIs into the dual-format metadata blobs that work with both the MCP Apps standard (Cursor, Claude Desktop, VS Code) and the OpenAI Apps SDK (ChatGPT).

const metas = buildCardToolMetas({
  status: "ui://dexter/card-status-abc12345",
  issue: "ui://dexter/card-issue-def67890",
  linkWallet: "ui://dexter/card-link-wallet-ghi13579",
});

Compose Helpers

Most consumers register tools with one call.

| Helper | Tools registered | |--------|------------------| | composeAllTools(server, opts) | x402_search, x402_check, x402_fetch, x402_access, x402_wallet | | composeCardTools(server, opts) | card_status, card_issue, card_link_wallet, card_freeze |

Both helpers accept an optional include array if you want to surface only a subset.


Status

0.x.x — surface stable, breaking changes pre-1.0 will be called out in the changelog. The Dextercard tools were added in 0.2.x and depend on @dexterai/dextercard@^0.3.0.


Links

License

MIT