CoinGecko MCP server

Provides real-time cryptocurrency data through a Node.js Express server that interfaces with CoinGecko's API, automatically switching between free and Pro endpoints based on API key availability.
Back to servers
Setup instructions
Provider
BlindVibeDev
Release date
Mar 21, 2025
Language
TypeScript
Stats
4 stars

The CoinGecko API Server provides a comprehensive interface to the CoinGecko cryptocurrency data API, supporting both free and Pro APIs with automatic fallback. It's designed to work with AI systems through the Model Context Protocol (MCP) specification.

Quick Start

You can install and run the server using npx or by cloning the repository:

# Install and run with npx
npx coingecko-api-server

# Or clone and install manually
git clone https://github.com/GaplyDev01/coingecko-api-server.git
cd coingecko-api-server
npm install
npm run setup
npm start

Features

  • Dual API Support: Works with both CoinGecko Free and Pro APIs
  • Automatic Fallback: Uses free API when Pro API key isn't provided
  • RESTful Endpoints: Simple API interface
  • Robust Error Handling: Detailed error messages with proper status codes
  • Simple Setup: Quick installation with guided setup

Installation Options

Using npx (Recommended)

The fastest way to get started:

npx coingecko-api-server

This interactive setup will:

  1. Ask where to install the server
  2. Clone the repository
  3. Install dependencies
  4. Prompt for your CoinGecko API key (optional)
  5. Configure your server port

Manual Setup

If you prefer setting up manually:

# Clone the repository
git clone https://github.com/GaplyDev01/coingecko-api-server.git
cd coingecko-api-server

# Install dependencies
npm install

# Run the setup script
npm run setup

# Start the server
npm start

Configuration

Configure the server using environment variables in the .env file:

Variable Description Default
PORT The port the server will listen on 3000
COINGECKO_API_KEY Your CoinGecko Pro API key -

API Endpoints

The server provides access to essential CoinGecko API endpoints:

Basic Endpoints

  • GET /api/ping - Check CoinGecko API status

Price Data

  • GET /api/simple/price - Get price data for specified coins

    • Query params: ids, vs_currencies, include_market_cap, include_24hr_vol, include_24hr_change, include_last_updated_at, precision
  • GET /api/simple/supported_vs_currencies - Get list of supported vs currencies

Coin Data

  • GET /api/coins/markets - Get market data for coins
    • Query params: vs_currency, ids, category, order, per_page, page, sparkline, price_change_percentage

Market Data

  • GET /api/global - Get global cryptocurrency data
  • GET /api/search/trending - Get trending coins

MCP Integration

To use this server with Claude Desktop:

  1. Start the CoinGecko API server locally
  2. In Claude Desktop, install the MCP by providing the server URL (e.g., http://localhost:3000)
  3. Claude can now access cryptocurrency data through the MCP interface

The server implements the MCP specification with JSON-RPC 2.0:

  • JSON-RPC 2.0 Endpoint: /rpc - Handles all method calls from AI clients
  • Schema Definition: /mcp/schema - Defines available tools and parameters

Pro API vs Free API

This server supports both CoinGecko APIs:

  • Pro API: Higher rate limits, no throttling, additional endpoints. Requires an API key.
  • Free API: Limited to ~30 calls/minute with potential rate limiting.

The server automatically detects if an API key is provided and uses the appropriate API. Without a key, it falls back to the free API, which is suitable for development or personal use.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "coingecko-api-server" '{"command":"npx","args":["coingecko-api-server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "coingecko-api-server": {
            "command": "npx",
            "args": [
                "coingecko-api-server"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "coingecko-api-server": {
            "command": "npx",
            "args": [
                "coingecko-api-server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later