Skip to content

feat: add x402_fetch tool#12

Open
Intellihackz wants to merge 1 commit into
InjectiveLabs:mainfrom
Intellihackz:main
Open

feat: add x402_fetch tool#12
Intellihackz wants to merge 1 commit into
InjectiveLabs:mainfrom
Intellihackz:main

Conversation

@Intellihackz

Copy link
Copy Markdown

Overview

This PR adds native x402 payment capabilities to the Injective MCP server, allowing AI agents to fetch gated API
endpoints and seamlessly pay the 402 Payment Required invoice using their local keystore.

Changes Made

  • Dependency Added: Installed @injectivelabs/x402 to utilize the createInjectiveClient HTTP wrapper.
  • New MCP Tool: Added the x402_fetch tool to src/mcp/server.ts.

How it Works

When an agent calls x402_fetch(address, password, url):
1. The server decrypts the local EVM private key.
2. It initiates a fetch request to the gated endpoint.
3. If the server responds with a 402 and a price quote, the client automatically signs an EIP-3009 USDC
authorization.
4. The signed payment is submitted to the x402 facilitator to settle on Injective EVM.
5. The original request is retried with the payment receipt, successfully returning the underlying data back to
the AI.

@coderabbitai

coderabbitai Bot commented Jun 9, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Intellihackz, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 58 minutes and 6 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: eccdc170-92cb-4785-b708-fb8278e1be72

📥 Commits

Reviewing files that changed from the base of the PR and between 747441e and 22566ea.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (2)
  • package.json
  • src/mcp/server.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​injectivelabs/​x402@​0.0.17610010091100

View full report

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant