Skip to main content
Glama

DEX K-line MCP

An MCP server that streams K-line (candlestick) data from decentralized exchanges (DEXs) to power your AI agents and workflows.

Features

  • K-line Data Retrieval: Fetches OHLCV (Open, High, Low, Close, Volume) data for specified tokens on supported chains (Ethereum, Binance Smart Chain, Solana).

  • Dynamic Timeframes: Supports multiple timeframes (1m, 5m, 15m, 1h, 4h, 12h, 1d) with appropriate API endpoints.

  • Best Pool Selection: Automatically selects the pool with the highest liquidity for accurate data.

  • Flexible End Time: Allows specifying an end time in ISO 8601 format or defaults to the current UTC time.

  • Tabular Output: Formats K-line data into a clean, readable table using the tabulate library.

Related MCP server: liquidity-pools-mcp

Installation

Prerequisites

  • Python 3.10 or higher

  • uv for dependency management

Setup

  1. Clone the repository:

    git clone https://github.com/kukapay/dex-kline-mcp.git
    cd dex-kline-mcp
  2. Install dependencies:

    uv sync
  3. Installing to Claude Desktop:

    Install the server as a Claude Desktop application:

    uv run mcp install main.py --name "DEX K-line"

    Configuration file as a reference:

    {
       "mcpServers": {
           "DEX K-line": {
               "command": "uv",
               "args": [ "--directory", "/path/to/dex-kline-mcp", "run", "main.py" ]
           }
       }
    }

    Replace /path/to/dex-kline-mcp with your actual installation path.

Usage

Tool: get_kline

The server exposes a single tool, get_kline, which retrieves K-line data for a specified token.

Parameters

  • chain (str): Blockchain network (e.g., eth, bsc, solana)

  • address (str): Token contract address

  • timeframe (str): K-line timeframe (e.g., 1m, 5m, 15m, 1h, 4h, 12h, 1d). Default: 1h

  • end_time (str, optional): ISO 8601 timestamp for data end time (e.g., 2025-07-03T02:14:00Z). Default: current UTC time

  • limit (int): Number of data points to return (max 1000). Default: 100

Example Prompt

Fetch the 1-hour K-line data for the token with the contract address 0xf4b385849f2e817e92bffbfb9aeb48f950ff4444 on the Binance Smart Chain (BSC).

Example Output

Pair: TOKEN/USDT

+---------------------+------------+------------+------------+------------+------------+
| Timestamp           | Open       | High       | Low        | Close      | Volume     |
+---------------------+------------+------------+------------+------------+------------+
| 2025-07-03 01:00:00 | 0.12345678 | 0.12345678 | 0.12345678 | 0.12345678 | 1234.56789 |
| 2025-07-03 00:00:00 | 0.12345678 | 0.12345678 | 0.12345678 | 0.12345678 | 1234.56789 |
+---------------------+------------+------------+------------+------------+------------+

License

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

Acknowledgments

Data powered by GeckoTerminal API.

Available Tools

1 tool
get_klineA
Fetch K-line data for a specified token on a given chain and return it as a formatted table.

Parameters:
    chain (str): Blockchain network (e.g., 'eth', 'bsc', 'solana')
    address (str): Token contract address
    timeframe (str): K-line timeframe (e.g., '1m', '5m', '15m', '1h', '4h', '12h', '1d'). Default: '1n'
    end_time (str, optional): ISO 8601 timestamp for data end time (e.g., '2025-07-03T02:14:00Z'). Default: current UTC time
    limit (int): Number of data points to return (max 1000). Default: 100

Returns:
    str: String containing pair name and K-line data in a formatted table

Inputs: chain (required), address (required), timeframe, end_time, +1 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 1 tool

    Disambiguation5/5

    With only one tool, there is no possibility of confusion or overlap between tools. The tool has a single, clearly defined purpose of fetching K-line data for tokens on specific blockchains.

    Naming Consistency5/5

    The single tool follows a clear verb_noun pattern (get_kline). With only one tool, naming consistency is inherently perfect as there are no other tools to compare against.

    Tool Count2/5

    A single tool is insufficient for a K-line data server that presumably needs to handle multiple aspects of cryptocurrency trading data. While the tool itself is well-defined, the server feels thin and incomplete with only one operation available.

    Completeness2/5

    The server is severely incomplete for K-line data operations. While fetching K-line data is covered, there are obvious gaps such as listing available tokens, getting token metadata, historical data analysis tools, or comparison tools between different tokens or timeframes.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that provides AI agents with real-time access to DEX liquidity pool data, enabling smarter trading, analytics, and automated strategies.
      10
      1
      MIT
    • A
      license
      B
      quality
      D
      maintenance
      MCP server that exposes QuantXData's institutional crypto market data APIs to AI assistants, enabling natural language queries for trades, order books, OHLCV, options, and more across 120+ exchanges.
      12
      MIT