Skip to content

x402_get_payment_info should not require Fireblocks credentials #1

Description

@TateLyman

Summary

x402_get_payment_info is described as a no-payment inspection tool, but it currently calls this.httpService.get(url) without overriding the default balance-check behavior. When a target returns a supported 402, HttpX402Service.get() defaults checkBalance to true, initializes FireblocksService, and requires FIREBLOCKS_API_KEY plus FIREBLOCKS_PRIVATE_KEY_PATH before it can return the payment preview.

That makes a read-only preview path depend on Fireblocks credentials even though no payment is being made.

Source path

In src/mcp-server.ts:

private async handleX402GetPaymentInfo(args: { url: string }) {
  const { url } = args;

  const response = await this.httpService.get(url);

In src/HttpX402Service.ts, get() defaults to balance checking:

const checkBalance = opts.checkBalance ?? true;
if (checkBalance) {
  this.fireblocksService = new FireblocksService();
  await this.fireblocksService.initialize(initChainId);
}

Impact

A user who only wants to inspect a merchant's 402 requirements from MCP can hit FIREBLOCKS_API_KEY not set in .env / private-key setup errors instead of seeing the amount/network/asset/payTo preview. This is especially surprising because the MCP tool description says it checks payment requirements without completing payment.

Suggested fix

Have x402_get_payment_info call the service in preview mode, for example:

const response = await this.httpService.get(url, {
  checkBalance: false,
  selection: "manual",
});

Optionally include a note in the returned preview that balance was not checked. x402_get_and_pay can keep check_balance=true as the default because that path may actually sign.

Verification

I ran a local build from a fresh clone of main:

npm ci
npm run build

Result: build passed. I did not use Fireblocks credentials, payment headers, wallets, private endpoints, or paid x402 calls.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions