Skip to main content

An MCP server that provides real-time funding rate data across major crypto exchanges, enabling agents to detect arbitrage opportunities.

Project description

Funding Rates MCP

An MCP server that provides real-time funding rate data across major crypto exchanges, enabling agents to detect arbitrage opportunities.

Discord GitHub License Python Version Status

Features

  • Real-Time Funding Rates: Fetches current funding across Binance, OKX, Bybit, Bitget, Gate and CoinEx.
  • Pivoted Table Output: Displays symbols as rows, exchanges as columns, and includes a Divergence column for max funding rate difference.
  • Claude Desktop Integration: Runs as an MCP server for interactive queries.

Installation

Prerequisites

  • Python 3.10+
  • uv for dependency management
  • Claude Desktop (optional, for interactive queries)
  • Git

Steps

  1. Clone the Repository:

    git clone https://github.com/kukapay/funding-rates-mcp.git
    cd funding-rates-mcp
    
  2. Set Up Dependencies with uv:

    uv sync
    
  3. Configuring Claude Desktop

    To use with Claude Desktop:

    1. Edit the Claude configuration file:
      • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
      • Windows: %APPDATA%\Claude\claude_desktop_config.json
    2. Add the MCP server:
      {
        "mcpServers": {
          "funding-rates-mcp": {
            "command": "uv",
            "args": ["--directory", "/absolute/path/to/funding-rates-mcp", "run", "funding-rates-mcp"]
          }
        }
      }
      
    3. Restart Claude Desktop. Look for the hammer icon to confirm integration.

Usage

Tools

The server provides the following MCP tool for querying funding rates:

  • compare_funding_rates:
    • Description: Compares current funding rates for multiple symbols across specified exchanges, returning a pivoted Markdown table with a Divergence column showing the maximum funding rate difference for each symbol.
    • Parameters:
      • symbols (List[str]): List of trading pairs (e.g., ["BTC/USDT:USDT", "ETH/USDT:USDT"]). Required.
      • exchanges (List[str], optional): List of exchanges to compare (e.g., ["binance", "okx"]). Defaults to all supported exchanges (binance, okx, bybit, bitget, gate, coinex).
      • params (Dict, optional): Additional parameters for the API call. Defaults to {}.
    • Returns: A Markdown table with symbols as rows, exchanges as columns, funding rates as values (formatted as percentages), and a Divergence column.
    • Example: See the Examples section below.

Prompts

The server includes the following MCP prompt for generating natural language queries:

  • compare_funding_rates_prompt:
    • Description: Generates a natural language prompt for comparing funding rates across all supported exchanges, suitable for Claude Desktop input.
    • Parameters:
      • symbols (List[str]): List of trading pairs (e.g., ["BTC/USDT:USDT", "ETH/USDT:USDT"]). Required.
    • Returns: A string prompt (e.g., "Compare the funding rates for BTC/USDT:USDT, ETH/USDT:USDT across binance, okx, bybit, bitget, gate, coinex.").
    • Usage: Used internally by Claude Desktop to interpret user queries or for testing in MCP Inspector.

Examples

Compare Funding Rates

  • Input (in Claude Desktop):
    "Compare funding rates for BTC/USDT:USDT and ETH/USDT:USDT across all exchanges."
  • Output:
    Current funding rates:
    
    | Symbol\Exchange | binance   | okx       | bybit     | bitget    | gate      | coinex    | Divergence |
    |-----------------|-----------|-----------|-----------|-----------|-----------|-----------|------------|
    | BTC/USDT:USDT   | 0.005161% | 0.007548% | 0.010000% | 0.002900% | -0.019200% | -0.035013% | 0.045013%  |
    | ETH/USDT:USDT   | 0.010000% | 0.005839% | 0.010000% | 0.010000% | -0.008200% | 0.000000%  | 0.018200%  |
    

Compare Specific Exchanges

  • Input (in Claude Desktop):
    "Compare funding rates for SOL/USDT:USDT on Binance, OKX, and Bybit."
  • Output:
    Current funding rates:
    
    | Symbol\Exchange | binance   | okx       | bybit     | Divergence |
    |-----------------|-----------|-----------|-----------|------------|
    | SOL/USDT:USDT   | -0.015312% | -0.003639% | -0.004467% | 0.011673%  |
    

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

funding_rates_mcp-0.1.0.tar.gz (86.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

funding_rates_mcp-0.1.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

Details for the file funding_rates_mcp-0.1.0.tar.gz.

File metadata

  • Download URL: funding_rates_mcp-0.1.0.tar.gz
  • Upload date:
  • Size: 86.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.6.5

File hashes

Hashes for funding_rates_mcp-0.1.0.tar.gz
Algorithm Hash digest
SHA256 44870ef9fb3b7a0c1809810501c401bfff757cc6814abfda2a908a549982e6ad
MD5 4bfcfb3a3bf231b10abe0a0903b8f258
BLAKE2b-256 d3a2e403785859858f82f78e8f440308126e01b44d5ec909eb4dc9726788f6d7

See more details on using hashes here.

File details

Details for the file funding_rates_mcp-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for funding_rates_mcp-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6106352dc585d3679da594a16aea510e3d041e9e9463d7c513baa9a6857fb25d
MD5 ac6b67d9b614edfe0248452d6fbcae7c
BLAKE2b-256 665c31983781eacd5f9fc339b6800e32603956e6dfbd9ce3aaf5a682a42ff5b5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page