Newsletter
Join the Community
Subscribe to our newsletter for the latest news and updates
CoinGecko API Server MCP: Node.js Express server providing a comprehensive interface to the CoinGecko cryptocurrency data API for AI systems.
The CoinGecko API Server MCP is a Node.js solution providing access to cryptocurrency market data via a RESTful API and MCP interface, bridging AI systems with real-time crypto data.
npx coingecko-api-server
This will:
npx coingecko-api-server
git clone https://github.com/yourusername/coingecko-api-server.git
cd coingecko-api-server
npm install
npm run setup
npm start
The server is configured using environment variables in the .env
file:
Variable | Description | Default |
---|---|---|
PORT | Server port | 3000 |
COINGECKO_API_KEY | CoinGecko Pro API key (optional) | - |
CACHE_DURATION | Cache duration in seconds | 60 |
LOG_LEVEL | Logging level (error, warn, info, debug) | info |
GET /api/ping
- Check API server statusGET /api/simple/price
- Get price data for specified coins
ids
, vs_currencies
, include_market_cap
, include_24hr_vol
, include_24hr_change
, include_last_updated_at
, precision
GET /api/coins/markets
- Get market data for coins
vs_currency
, ids
, category
, order
, per_page
, page
, sparkline
, price_change_percentage
GET /api/global
- Get global cryptocurrency dataGET /api/search/trending
- Get trending coinsGet Bitcoin Price in USD:
curl "http://localhost:3000/api/simple/price?ids=bitcoin&vs_currencies=usd"
Response:
{
"bitcoin": {
"usd": 45678.12
}
}
Get Top 5 Cryptocurrencies by Market Cap:
curl "http://localhost:3000/api/coins/markets?vs_currency=usd&order=market_cap_desc&per_page=5&page=1"
This server implements the Marketplace Component Program (MCP) protocol, enabling AI systems like Claude to access cryptocurrency data.
/rpc
- Handles method calls from AI clients/mcp/schema
- Defines available tools and parametersping
- Check API statusgetPrice
- Get price data for specified cryptocurrenciesgetSupportedVsCurrencies
- Get list of supported currenciesgetCoinMarkets
- Get market data for coinsgetGlobal
- Get global cryptocurrency datagetTrending
- Get trending coinsFor detailed integration instructions, see MCP_INTEGRATION.md.
This server supports both the CoinGecko Pro API and the free API:
Feature | Free API | Pro API |
---|---|---|
Rate Limit | ~30 calls/minute | ~500 calls/minute |
API Throttling | Yes | No |
Support | Community | Priority |
Data Freshness | 10-30 minutes | 1-2 minutes |
Price | Free | Subscription |
For more details about the Pro API setup, see USING_COINGECKO_PRO.md.
Issue | Solution |
---|---|
Rate limiting errors | Consider upgrading to Pro API or adjust your request frequency |
Connection refused | Ensure the server is running on the specified port |
Authentication errors | Check your API key in the .env file |
Missing data | Verify the parameters in your request |
# Run in development mode with hot reload
npm run dev
# Run tests
npm test
# Build for production
npm run build
The server acts as a middleware between your applications and the CoinGecko API:
This project is licensed under the MIT License - see the LICENSE file for details.
Made with โค๏ธ by [Your Organization]