This Node.js Express server provides a comprehensive interface to the CoinGecko cryptocurrency data API, supporting both free and Pro API versions with automatic fallback functionality. It serves as an MCP (Marketplace Component Program) server that can be integrated with AI systems like Claude.
# 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
This is the fastest way to get started:
npx coingecko-api-server
The interactive setup will:
If you prefer to set 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
The server can be configured 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 | - |
The server provides access to all essential CoinGecko API endpoints:
GET /api/ping
- Check CoinGecko API 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/simple/supported_vs_currencies
- Get list of supported vs currencies
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 coinsThis server is compatible with AI systems like Claude as an MCP. To use it with Claude Desktop:
http://localhost:3000
)The server implements the full MCP specification with JSON-RPC 2.0:
/rpc
- Handles all method calls from AI clients/mcp/schema
- Defines available tools and parametersThis server supports both the CoinGecko Pro API and the free API:
The server automatically detects if an API key is provided and uses the appropriate API. If no key is provided, it will fall back to the free API, which is ideal for development or personal use.
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.
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.
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"
]
}
}
}
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.
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.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.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