Skip to content

Migrate x402 MCP integration from legacy x402 package to @x402/core and @x402/evm v2 #793

Closed

Description

@adlonymous

Summary

Update packages/agents/src/mcp/x402.ts to use the new x402 v2 packages (@x402/core, @x402/evm) instead of the legacy x402 package.

Background

The x402 protocol has been refactored into a modular architecture. Key changes in v2:

Aspect V1 V2
Packages x402 @x402/core, @x402/evm
Payment Header X-PAYMENT PAYMENT-SIGNATURE
Network Format "base-sepolia" "eip155:84532" (CAIP-2)
Version 1 2

See: Migration Guide (https://github.com/coinbase/x402/blob/main/docs/guides/migration-v1-to-v2.md)

Motivation

  1. The legacy x402 package is being deprecated
  2. v2 architecture enables future Solana support (@x402/svm)
  3. CAIP-2 network identifiers are the standard for multi-chain compatibility

Requirements

  • Migrate to @x402/core and @x402/evm packages
  • Update server-side (withX402) and client-side (withX402Client) implementations to v2 APIs
  • Support both legacy network names and CAIP-2 format for backward compatibility
  • Update examples/x402-mcp to work with v2
  • No breaking changes to public API types

Activity

  1. self-assigned this
    on Feb 8, 2026
  2. threepointone commented on Feb 9, 2026

    @threepointone
    Contributor

    fixed in #871

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

Metadata

Metadata

Assignees

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