https://github.com/lucianoayres/mcp-crypto-ticker
The MCP Crypto Ticker tool integrates real-time cryptocurrency data into AI-powered IDEs like Cursor AI. It uses the Coinpaprika API, allowing developers to fetch crypto prices and 24-hour changes through natural language commands within their coding environment, simplifying crypto-related development workflows.
https://github.com/lucianoayres/mcp-crypto-ticker
ai bitcoin cursor cursorai mcp nodejs
Last synced: 2 months ago
JSON representation
The MCP Crypto Ticker tool integrates real-time cryptocurrency data into AI-powered IDEs like Cursor AI. It uses the Coinpaprika API, allowing developers to fetch crypto prices and 24-hour changes through natural language commands within their coding environment, simplifying crypto-related development workflows.
- Host: GitHub
- URL: https://github.com/lucianoayres/mcp-crypto-ticker
- Owner: lucianoayres
- License: mit
- Created: 2025-03-21T19:08:04.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2025-03-21T20:55:28.000Z (2 months ago)
- Last Synced: 2025-03-21T21:29:30.841Z (2 months ago)
- Topics: ai, bitcoin, cursor, cursorai, mcp, nodejs
- Language: JavaScript
- Homepage:
- Size: 2.93 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Below is the updated README file with the new configuration instructions:
---
# MCP Crypto Ticker Tool
## Overview
**MCP (Model Context Protocol)** is a framework that allows you to integrate custom tools into AI-assisted development environments—such as Cursor AI. MCP servers expose functionality (like data retrieval or code analysis) so that an LLM-based IDE can call these tools on demand. Learn more about MCP in the [Model Context Protocol Introduction](https://modelcontextprotocol.io/introduction).
This project demonstrates an MCP server that provides a crypto ticker tool. It uses the [Coinpaprika API Node.js client](https://github.com/coinpaprika-api-nodejs-client) to fetch real-time cryptocurrency data from [Coinpaprika API](https://api.coinpaprika.com/). Users pass the full coin name (e.g., "bitcoin") and the tool returns its current price in USD along with the 24-hour percentage change.
## Requirements
- **Node.js:** Version 20 or higher is required.
## Features
- **MCP Integration:** Exposes tool functionality to LLM-based IDEs.
- **Crypto Ticker Data:** Retrieves current ticker information for a given coin.
- **Input Validation:** Uses [Zod](https://github.com/colinhacks/zod) for schema validation.
- **Standard I/O Transport:** Connects via `StdioServerTransport` for integration with development environments.## Installation
1. **Clone the Repository**
```bash
git clone
cd
```2. **Install Dependencies**
```bash
npm install @modelcontextprotocol/sdk @coinpaprika/api-nodejs-client zod
```3. **Enable ES Modules**
After installing dependencies, edit your `package.json` to include:
```json
"type": "module"
```4. **Ensure Node.js Version 20+**
Confirm your Node.js version by running:
```bash
node -v
```Update Node.js if necessary.
## Integrating with Cursor AI
This project now includes a `.cursor` subdirectory that contains an `mcp.json` file for configuring the MCP server. Open the file and update the following fields:
- **command:** Replace this field with the absolute path to your Node.js executable. For example:
```
/home/john/.nvm/versions/node/v20.13.1/bin/node
```- **argument:** Replace this field with the absolute path to your MCP server JavaScript file. For example:
```
/home/john/mcp-crypto-ticker/mcp-crypto-ticker.js
```You can verify the absolute path to your Node.js executable by running `which node` in your terminal.
### Optional: Global Configuration
If you prefer, you can move the `mcp.json` file from the `.cursor` subdirectory to your global Cursor AI configuration directory located at `~/.cursor`. This allows Cursor AI to recognize your MCP server configuration globally.
## Using the MCP Tool in Cursor Composer (Agent Mode)
With the MCP server integrated into Cursor AI and with Agent mode enabled in Cursor Composer, simply use a natural language prompt like:
```
get the bitcoin price
```The AI agent will infer the available `getTicker` tool from your MCP server and execute it to retrieve the current ticker data for Bitcoin.
## Code Overview
The project comprises the following key parts:
- **MCP Server Initialization:**
The MCP server is instantiated using `McpServer` from the MCP SDK and connected via `StdioServerTransport`.- **Tool Definition:**
The `getTicker` tool is defined with a Zod schema that accepts a coin’s full name (defaulting to "bitcoin"). The tool fetches the list of coins from the Coinpaprika API to map the friendly coin name to the corresponding coin ID. It then calls `getAllTickers` with `quotes: ['USD']` to retrieve ticker data in USD, extracts the price and 24-hour change, and returns the information.## What is MCP?
**Model Context Protocol (MCP)** provides a standardized approach to integrate custom tools into AI-assisted development environments. With MCP, you can define tools that perform specific tasks—such as retrieving external data, validating code, or enforcing coding standards—and the AI assistant in your IDE can call these tools automatically based on context. This helps improve developer productivity, ensures consistent quality, and streamlines workflows.
## Reference
[Use Your Own MCP on Cursor in 5 Minutes](https://dev.to/andyrewlee/use-your-own-mcp-on-cursor-in-5-minutes-1ag4)
## License
This project is licensed under the [MIT License](LICENSE).