SaqibHussain44/MCP_coingecko

โ˜… 0Forks 0JavaScriptGitHub โ†—Compare

README

๐Ÿช™ Crypto Tracker MCP Server Example

A Model Context Protocol (MCP) server that connects AI agents (like Claude Desktop or other MCP clients) to real-time cryptocurrency market data using the CoinGecko API.

This project demonstrates how to build and run a complete MCP server in Node.js, featuring:

  • ๐Ÿงฐ Tools for interacting with crypto data
  • ๐Ÿ“š (Optional) Resources for reusable info sets
  • ๐Ÿ’ฌ (Optional) Prompt Templates for AI-assisted responses

๐Ÿš€ Features

โœ… Get Real-Time Prices โ€” Fetch live prices, market cap, and 24h change for any cryptocurrency
โœ… Detailed Coin Info โ€” Retrieve full metadata for a specific coin
โœ… Market Data โ€” Paginated list of coins ranked by market cap
โœ… Search Coins โ€” Find coins by name or symbol
โœ… Trending Coins โ€” Get currently trending cryptocurrencies on CoinGecko


๐Ÿง  What Is MCP?

MCP (Model Context Protocol) is a new open standard that connects Large Language Models (LLMs) to external tools, APIs, and data sources through a single unified interface.

Each MCP Server can expose:

Category Description
๐Ÿงฐ Tools Functions or APIs that an LLM can call (like get_price)
๐Ÿ“š Resources Static or dynamic data references (like coin lists, config files)
๐Ÿ’ฌ Prompt Templates Predefined prompts or instruction templates

Your LLM can then access and execute these capabilities safely and consistently.


๐Ÿงฉ Project Structure


crypto-mcp-server/
โ”œโ”€โ”€ server.js          # Main MCP server implementation
โ”œโ”€โ”€ package.json       # Dependencies and module config
โ””โ”€โ”€ README.md          # Documentation (this file)


โš™๏ธ Setup

1๏ธโƒฃ Clone the repository

git clone https://github.com/<your-username>/crypto-mcp-server.git
cd crypto-mcp-server

2๏ธโƒฃ Install dependencies

npm install

Make sure your package.json includes "type": "module"

3๏ธโƒฃ Run the server manually

node server.js

You should see:

CoinGecko MCP Server running on stdio

๐Ÿงฉ Integration with Claude Desktop

To connect this MCP server with Claude Desktop, edit your configuration file:

nano ~/Library/Application\ Support/Claude/claude_desktop_config.json

Add the following entry under mcpServers:

{
  "mcpServers": {
    "coingecko": {
      "command": "/Users/<your-username>/.nvm/versions/node/v22.17.1/bin/node",
      "args": ["/Users/<your-username>/work/crypto-mcp-server/server.js"]
    }
  }
}

Then restart Claude Desktop. Youโ€™ll now be able to call this server using /mcp commands like:

/mcp coingecko get_price { "ids": "bitcoin", "vs_currencies": "usd" }

๐Ÿงฐ Available Tools

Tool Description Example
get_price Get current price, market cap, and 24h change { "ids": "bitcoin", "vs_currencies": "usd" }
get_coin_details Get metadata about a specific coin { "id": "ethereum" }
get_market_data Paginated market cap data { "vs_currency": "usd", "per_page": 10, "page": 1 }
search_coins Search for cryptocurrencies { "query": "solana" }
get_trending Get trending cryptocurrencies {}

๐Ÿ› ๏ธ Tech Stack

  • Node.js 22+
  • @modelcontextprotocol/sdk
  • CoinGecko REST API
  • ES Modules (import/export syntax)

๐Ÿ’ก Future Enhancements

  • Add Resources to store coin metadata or cached lookups
  • Add Prompt Templates for summarizing market trends
  • Add Persistent local caching for performance optimization
  • Integrate with other APIs (Binance, CoinMarketCap, etc.)

๐Ÿง‘โ€๐Ÿ’ป Author

Saqib Hussain ๐Ÿš€ Software Engineer | DevOps | AI Integrations ๐Ÿ”— LinkedIn ๐Ÿข Founder โ€” DevInspect

Contributors

SaqibHussain44

Issues