# X402 Funding

> X402 Funding is a freemium MCP server for finance and payments. MCP server comparing Hyperliquid funding rates with Binance or OKX, annualized. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Freemium
- **Platforms:** CLI, API, Self-hosted
- **Repository:** https://github.com/kristoferbc/x402-funding
- **MCP Registry name:** io.github.kristoferbc/x402-funding
- **Categories:** [finance and payments](https://ai-powered.com/categories/finance-and-payments)
- **Listing updated:** 2026-11-23

## About

Funding rates are normalized before comparison: Hyperliquid funds hourly, while Binance contracts vary between 8, 4 and 1 hours and OKX differs per instrument, so each interval is read per symbol rather than assumed. A pair appears only if open interest and volume clear liquidity floors on both venues, by default $1M open interest and $2M volume on Hyperliquid and $2M on the benchmark.

Each row includes a trade field that says which leg to short and which to long. Gaps beyond 2,000 bps are flagged as anomalies and ranked after ordinary rows, and the tool falls back from Binance to OKX when Binance blocks the region. The README calls the output a raw input for a basis decision, not a return forecast.

The MCP tool get_funding_divergence takes an optional limit from 1 to 50 and runs locally over stdio. The same code is a Node library, and a hosted x402 endpoint charges $0.02 a call for the divergence or $0.25 for the Ultra route that adds measured execution capacity.

## Features

- **Per-symbol funding intervals:** Intervals are read from each venue, not assumed to be 8 hours.
- **Liquidity filters:** Pairs must clear open interest and volume floors on both legs.
- **Resolved trade direction:** Each row says which venue to short and which to long.
- **Anomaly flags:** Gaps over 2,000 bps are marked and ranked last.
- **Region fallback:** Switches to OKX when Binance is unavailable.
- **Hosted pay-per-call:** An x402 endpoint serves the data for USDC per request.

## Good for

- Scan for the widest funding gaps between Hyperliquid and a CEX
- Feed a basis-trade screener with ranked pairs
- Check how much size a gap can absorb using the Ultra route
- Give an agent a no-key funding data tool
- Validate responses against the shipped JSON Schema

## Install

### Claude Code: Add with the CLI (Terminal)

```sh
claude mcp add x402-funding -- npx -y x402-funding-divergence
```

Add --scope user to use it in every project, or --scope project to share it in .mcp.json.

### Claude Code: Or share it with your project (.mcp.json)

```json
{
  "mcpServers": {
    "x402-funding": {
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "x402-funding": {
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

Settings → Developer → Edit Config, then quit and reopen Claude Desktop.

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "x402-funding": {
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

Use .cursor/mcp.json in a project to share it with the project.

### VS Code (~/.copilot/mcp-config.json)

```json
{
  "mcpServers": {
    "x402-funding": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

Or put the same entry in .mcp.json at your workspace root to share it.

### Codex: Add with the CLI (Terminal)

```sh
codex mcp add x402-funding -- npx -y x402-funding-divergence
```

### Codex: Or add to config.toml (~/.codex/config.toml)

```toml
[mcp_servers.x402-funding]
command = "npx"
args = ["-y", "x402-funding-divergence"]
```

### Gemini CLI and Antigravity: Gemini CLI (~/.gemini/settings.json)

```json
{
  "mcpServers": {
    "x402-funding": {
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

Or run: gemini mcp add -s user x402-funding npx -- -y x402-funding-divergence

### Gemini CLI and Antigravity: Antigravity (~/.gemini/config/mcp_config.json)

```json
{
  "mcpServers": {
    "x402-funding": {
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

Use .agents/mcp_config.json to add it to one workspace only.

### Devin Desktop (~/.config/devin/mcp_config.json)

```json
{
  "mcpServers": {
    "x402-funding": {
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

On Windows the file is %APPDATA%\\devin\\mcp_config.json. Use .devin/mcp_config.json to share it with a project.

### Cline (cline_mcp_settings.json)

```json
{
  "mcpServers": {
    "x402-funding": {
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

Open it from the MCP Servers icon → Configure → Configure MCP Servers.

### Zed (Zed settings.json)

```json
{
  "context_servers": {
    "x402-funding": {
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

Open it with zed: open settings file. Merge context_servers into the settings you already have.

### JetBrains AI Assistant and Junie: AI Assistant (Settings → Tools → AI Assistant → Model Context Protocol (MCP) → Add)

```json
{
  "mcpServers": {
    "x402-funding": {
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

### JetBrains AI Assistant and Junie: Junie (~/.junie/mcp/mcp.json)

```json
{
  "mcpServers": {
    "x402-funding": {
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

Use .junie/mcp/mcp.json to share it with a project.

### Kiro (~/.kiro/settings/mcp.json)

```json
{
  "mcpServers": {
    "x402-funding": {
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

Use .kiro/settings/mcp.json to add it to one workspace only.

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "x402-funding": {
      "command": "npx",
      "args": [
        "-y",
        "x402-funding-divergence"
      ]
    }
  }
}
```

## Tools

From the tool list in its README, going by the names, all 1 tool only read data. From the server's own tool labels and tool names; not verified by us.

- `get_funding_divergence` (name suggests: reads): Returns pairs where Hyperliquid and the benchmark venue disagree on funding, with an optional limit of 1 to 50.

## FAQ

### Does X402 Funding need an API key?

No keys or signup are needed for the local tool.

### What does the hosted endpoint cost?

$0.02 a call for /funding and $0.25 a call for /ultra, paid in USDC on Base.

### Which exchanges are compared?

Hyperliquid against Binance, or OKX where Binance restricts the region.

### What are the Node requirements?

Node.js 20 or newer.

### Can I change the liquidity floors?

Yes, through environment variables such as MIN_OI_USD and MIN_VOL_USD.

### How do I add X402 Funding to Claude Code?

Run this command in your terminal: claude mcp add x402-funding -- npx -y x402-funding-divergence

### What are the best alternatives to X402 Funding?

The closest alternatives to X402 Funding are Solana MCP by Vybe, Tapetide - Indian Stock Market MCP, NostrPulse, Australian Economic Data (ABS, RBA & APRA) and Crypto Perp Pulse & Outage Radar (x402).

## Where this comes from

- Description: written from the project's README.
- Install steps: from the official MCP Registry entry.

## Alternatives

- [Solana MCP by Vybe](https://ai-powered.com/mcp/solana-mcp-by-vybe): Solana MCP by Vybe is an MCP server for finance and payments.
- [Tapetide - Indian Stock Market MCP](https://ai-powered.com/mcp/tapetide-indian-stock-market-mcp): Tapetide - Indian Stock Market MCP is a freemium MCP server for finance and payments.
- [NostrPulse](https://ai-powered.com/mcp/nostrpulse): NostrPulse is an open-source MCP server for finance and payments.
- [Australian Economic Data (ABS, RBA & APRA)](https://ai-powered.com/mcp/australian-economic-data-abs-rba-and-apra): Australian Economic Data (ABS, RBA & APRA) is an open-source MCP server for analytics and data.
- [Crypto Perp Pulse & Outage Radar (x402)](https://ai-powered.com/mcp/crypto-perp-pulse-and-outage-radar-x402): Crypto Perp Pulse & Outage Radar (x402) is a paid MCP server for finance and payments.
- [LATAM Business, Fiscal & FX (x402)](https://ai-powered.com/mcp/latam-business-fiscal-and-fx-x402): LATAM Business, Fiscal & FX (x402) is a paid MCP server for finance and payments.
- [Base & EVM DeFi Pre-Trade Shield (x402)](https://ai-powered.com/mcp/base-and-evm-defi-pre-trade-shield-x402): Base & EVM DeFi Pre-Trade Shield (x402) is a paid MCP server for finance and payments.
- [x402 Micropayments MCP](https://ai-powered.com/mcp/x402-micropayments-mcp): x402 Micropayments MCP is a paid MCP server for finance and payments.

---
Source: https://ai-powered.com/mcp/x402-funding
