feat: add x402_fetch tool#12
Conversation
|
Warning Review limit reached
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 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 configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: ⛔ Files ignored due to path filters (1)
📒 Files selected for processing (2)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
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 Requiredinvoice using their local keystore.Changes Made
@injectivelabs/x402to utilize thecreateInjectiveClientHTTP wrapper.x402_fetchtool tosrc/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.