You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This PR extends the @x402scan/mcp package to support CLI-first invocation alongside the existing MCP server functionality. Users can now run commands directly via npx @x402scan/mcp <command> without needing to install and configure an MCP server first.
Key Changes
CLI commands: Added fetch, check, discover, wallet, and report-error commands that mirror MCP tool functionality
Structured JSON output: All CLI commands output agent-readable JSON with consistent success/error response formats
Exit codes: Standardized exit codes (0-5) for programmatic error handling by invoking agents
DRY architecture: Extracted shared business logic into src/shared/operations/ consumed by both MCP tools and CLI commands
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR extends the
@x402scan/mcppackage to support CLI-first invocation alongside the existing MCP server functionality. Users can now run commands directly vianpx @x402scan/mcp <command>without needing to install and configure an MCP server first.Key Changes
fetch,check,discover,wallet, andreport-errorcommands that mirror MCP tool functionalitysrc/shared/operations/consumed by both MCP tools and CLI commandsArchitecture
New Files
src/cli/commands/*.tssrc/cli/commands/lib/src/cli/output/src/shared/operations/Test plan
npx @x402scan/mcp wallet inforeturns wallet address and balancenpx @x402scan/mcp discover https://enrichx402.comfinds x402 resourcesnpx @x402scan/mcp check https://enrichx402.com/api/apollo/people-enrichreturns pricing infonpx @x402scan/mcp fetch <url>makes paid requests successfullynpx @x402scan/mcp schema fetchreturns JSON schemanpx @x402scan/mcp serverstarts the MCP server (existing functionality preserved)