- Home
- MCP servers
- DEX Metrics
DEX Metrics
- python
1
GitHub Stars
python
Language
6 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
DEX Metrics MCP is an MCP server that tracks trading volume metrics organized by DEX, blockchain, aggregator, frontend, and Telegram bot, powered by Dune Analytics. It exposes a ready-to-run server you can query via MCP clients to get up-to-date volume data across multiple dimensions and timeframes.
How to use
You run this MCP server locally or in your preferred MCP environment and connect to it with MCP client calls. You can fetch the latest trading volumes by DEX or by aggregator, daily volumes by chain or DEX, weekly and monthly volumes, year-over-year by aggregator, Solana-specific volumes, and volumes by frontend or Telegram bot. Each tool returns results in a markdown-formatted table or reports an error if a query fails.
Typical workflows you can perform include comparing top DEXs by 24-hour and 7-day volumes, monitoring aggregator activity over different periods, and examining platform activity segmented by blockchain, frontend, or messaging bot. Use the functions to build dashboards, alerts, or periodic reports for traders, researchers, or product teams.
How to install
Prerequisites: Python 3.10 or higher and uv as the recommended package manager. You also need a Dune Analytics API key to access data.
Step 1: Clone the MCP project directory and navigate into it.
Step 2: Install dependencies and start the MCP server locally using the standard MCP runtime. The following command runs the MCP server in your environment and starts the runtime process.
Step 3: If you want to install the server as a Claude Desktop application, use the MCP runtime command shown in the configuration example.
Step 4: Provide your Dune Analytics API key in the environment or configuration as shown in the example configuration.
Configuration and environment
The server configuration is shown in the following example. It defines a single MCP server named “DEX Metrics” that runs via uv with a specified project directory and the main Python script. The configuration also includes an environment variable for the DUNE_API_KEY.
{
"mcpServers": {
"DEX Metrics": {
"command": "uv",
"args": [ "--directory", "/path/to/dex-metrics-mcp", "run", "main.py" ],
"env": { "DUNE_API_KEY": "dune_api_key"}
}
}
}
What you get from the tools
The server exposes a collection of tools you can call through MCP to fetch curated trading volume data. Each tool returns a markdown-formatted table suitable for dashboards or reports. The available tools include: get_latest_trading_volume_by_dex, get_latest_trading_volume_by_aggregator, get_daily_trading_volume_by_chain, get_daily_trading_volume_by_dex, get_weekly_trading_volume_by_dex, get_monthly_trading_volume_by_dex, get_yoy_monthly_trading_volume_by_aggragator, get_weekly_solana_trading_volume_by_dex, get_weekly_trading_volume_by_frontend, and get_daily_trading_volume_by_telegram_bot.
Security and best practices
Keep your Dune Analytics API key secure. Do not paste keys in public spaces or commit them to version control. Use environment variables or secret management features provided by your MCP environment to store sensitive credentials.
Notes and troubleshooting
If you encounter data fetch errors, verify that your DUNE_API_KEY is valid and has access to the necessary data sources. Check that the MCP server is running with the correct directory and entry script. Ensure network access from the MCP host to Dune Analytics services is not blocked by a firewall.
Available tools
get_latest_trading_volume_by_dex
Fetches the latest 24-hour and 7-day trading volumes for the top DEXs.
get_latest_trading_volume_by_aggregator
Fetches the latest 24-hour and 7-day trading volumes for the top aggregators.
get_daily_trading_volume_by_chain
Retrieves daily trading volume broken down by blockchain.
get_daily_trading_volume_by_dex
Retrieves daily trading volume broken down by DEX.
get_weekly_trading_volume_by_dex
Retrieves weekly trading volume broken down by DEX.
get_monthly_trading_volume_by_dex
Retrieves monthly trading volume broken down by DEX.
get_yoy_monthly_trading_volume_by_aggragator
Retrieves year-over-year monthly trading volume by aggregator.
get_weekly_solana_trading_volume_by_dex
Retrieves Solana-specific weekly trading volume by DEX.
get_weekly_trading_volume_by_frontend
Retrieves 7-day trading volume by frontend.
get_daily_trading_volume_by_telegram_bot
Retrieves daily trading volume by Telegram bot.