MCP cover image
See in Github
2025-04-05

MCP server for token metrics

1

Github Watches

0

Github Forks

0

Github Stars

Tokens MCP

MCP server for Token Metrics API.

About

MCP (Model Control Protocol) provides a standardized interface for AI systems to access external tools and data sources. This repository implements an MCP server for TokenMetrics API, enabling you to:

  • Access comprehensive cryptocurrency market data
  • Implement and backtest trading strategies (like moving average crossovers)
  • Generate visual performance metrics for your strategies
  • Analyze token performance across different timeframes
  • Build automated trading systems with consistent API access

Whether for algorithmic trading bots or market research, this server simplifies working with crypto data and strategy development.

Demo Video

Hackathon Demo Video

Getting Started

Installation

  1. Clone the repository:
git clone https://github.com/antonkulaga/tokens-mcp.git
  1. Install dependencies:
uv sync

Configuration

Copy .env.example to .env and configure your API keys:

cp .env.example .env
# Edit .env with your TokenMetrics API key

You must also update the mcp_server_config.json file with your TokenMetrics API key:

{
  "mcpServers": {
    "TmaiAPI": {
      "command": "uv",
      "args": ["--directory", "/path/to/tokens-mcp", "run", "mcp", "run", "run.py"],
      "env": {
        "TOKEN_METRICS_API_KEY": "your-api-key-here"
      }
    }
  }
}

Running the Server

uv run mcp run run.py

You can inspect the server by running

uv run mcp dev run.py

Note: if uv environment is activated you can omit uv run part

IDE Integration

This project works best with IDEs that support the Model Context Protocol (MCP).

Cursor

Cursor provides native support for MCP, allowing AI assistants to directly interact with the TokenMetrics API through this server. To use this project in Cursor:

  1. Open the project in Cursor
  2. Ensure your configuration files (.env and mcp_server_config.json) are properly set up
  3. The MCP server will be automatically detected, enabling AI assistants to analyze crypto data and implement trading strategies

Cursor IDE integration with TokenMetrics MCP server

Project Structure

The project is organized using a standard Python package structure:

tokens-mcp/
├── src/                           # Source code directory
│   └── tokens_mcp/                # Main package
│       ├── __init__.py            # Package initialization
│       ├── server.py              # MCP server implementation
│       ├── models.py              # Pydantic models
│       ├── helpers.py             # Helper functions
│       ├── chart_utils.py         # Chart utilities
│       ├── check_api_access.py    # API access validation
│       ├── save_and_decode_chart.py # Chart handling utilities
│       ├── inspect_exchange.py    # Exchange inspection utilities
│       └── inspect_api.py         # API inspection utilities
├── tests/                         # Test directory
│   ├── test_token_symbols.py      # Token symbol tests
│   ├── test_pagination.py         # Pagination tests
│   ├── test_ma_chart.py           # Moving average chart tests
│   ├── test_cache.py              # Cache tests
│   └── ...                        # Other tests
├── run.py                         # Server runner script
├── pyproject.toml                 # Project configuration
├── mcp_server_config.json         # Server configuration
├── notebooks/                     # Jupyter notebooks
├── images/                        # Image resources
└── README.md                      # This file

Known Issues

Configuration File Paths

The mcp_server_config.json file currently contains absolute paths to the server. You must manually edit this file to update the path to match your local environment:

{
  "mcpServers": {
    "TmaiAPI": {
      "command": "uv",
      "args": ["--directory", "/path/to/tokens-mcp", "run", "mcp", "run", "run.py"],
                              ^^^^^^^^^^^^^^^^^^^ 
                              Update this to your actual path
      "env": {
        "TOKEN_METRICS_API_KEY": "your-api-key-here"
      }
    }
  }
}

This is a temporary limitation that will be addressed in future updates.

Testing Framework

Currently, the test files in the tests/ directory are manually run scripts rather than proper pytest files with assertions. These scripts are used to verify functionality through manual inspection of outputs rather than automated test assertions. Future updates will implement proper pytest-based testing with complete assertion coverage.

TokenMetrics API Implementation

Many TokenMetrics API endpoints had to be directly implemented in this project because they are not available in the existing tmai-api library. This results in some custom API handling code that would ideally be part of the upstream library. Future updates may migrate these implementations to the official library or create a more comprehensive client package.

Experimental Code

This repository may contain traces of unused code that was previously used for experimentation and development iterations. These code fragments remain for reference purposes but may be removed in future cleanup efforts. If you encounter seemingly unused functions or modules, they likely fall into this category.

Project Background

This repository serves as a demo for the HolyMCP project developed at the Bucharest ETH 2025 Hackathon.

HolyMCP Project

相关推荐

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Yusuf Emre Yeşilyurt
  • I find academic articles and books for research and literature reviews.

  • https://maiplestudio.com
  • Find Exhibitors, Speakers and more

  • Carlos Ferrin
  • Encuentra películas y series en plataformas de streaming.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • Contraband Interactive
  • Emulating Dr. Jordan B. Peterson's style in providing life advice and insights.

  • rustassistant.com
  • Your go-to expert in the Rust ecosystem, specializing in precise code interpretation, up-to-date crate version checking, and in-depth source code analysis. I offer accurate, context-aware insights for all your Rust programming questions.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • lumpenspace
  • Take an adjectivised noun, and create images making it progressively more adjective!

  • apappascs
  • Discover the most comprehensive and up-to-date collection of MCP servers in the market. This repository serves as a centralized hub, offering an extensive catalog of open-source and proprietary MCP servers, complete with features, documentation links, and contributors.

  • ShrimpingIt
  • Micropython I2C-based manipulation of the MCP series GPIO expander, derived from Adafruit_MCP230xx

  • modelcontextprotocol
  • Model Context Protocol Servers

  • Mintplex-Labs
  • The all-in-one Desktop & Docker AI application with built-in RAG, AI agents, No-code agent builder, MCP compatibility, and more.

  • n8n-io
  • Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.

  • WangRongsheng
  • 🧑‍🚀 全世界最好的LLM资料总结(Agent框架、辅助编程、数据处理、模型训练、模型推理、o1 模型、MCP、小语言模型、视觉语言模型) | Summary of the world's best LLM resources.

    Reviews

    2 (1)
    Avatar
    user_2qmeRJwC
    2025-04-17

    I've been using tokens-mcp for a while now, and it has significantly streamlined my application development. Created by antonkulaga, this tool is well-documented and intuitive, making it easy to integrate into my projects. The GitHub page provides all the necessary information and support. Highly recommend it to fellow developers!