pratyushkr9420/crypto_python_mcp
If you are the rightful owner of crypto_python_mcp and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A Model Context Protocol (MCP) server providing AI agents with real-time cryptocurrency data from CoinGecko.
Crypto Python MCP Server
A Model Context Protocol (MCP) server that provides AI agents with access to real-time cryptocurrency data from CoinGecko. This server offers two powerful tools for fetching cryptocurrency prices and exchange information.
Features
- Real-time Cryptocurrency Prices: Get current prices for any supported cryptocurrency in USD
- Exchange Information: Retrieve detailed information about cryptocurrency exchanges including trust scores, trading volumes, and more
- Async Operations: Built with async/await for optimal performance
- Robust Error Handling: Comprehensive error handling with informative messages
- AI-Optimized: Extensive docstrings designed specifically for AI agent consumption
Tools Available
1. get_coin_price
Fetches the current price of any cryptocurrency in USD using CoinGecko's professional API.
Parameters:
coin_name(str): The name or symbol of the cryptocurrency (e.g., "bitcoin", "ethereum", "BTC", "ETH")
Example Usage:
# Get Bitcoin price
get_coin_price("bitcoin")
# Returns: "bitcoin: $45,230.50 USD"
# Get Ethereum price using symbol
get_coin_price("ETH")
# Returns: "ETH: $2,890.75 USD"
2. get_crypto_exchange_info
Retrieves comprehensive information about cryptocurrency exchanges.
Parameters:
exchange_name(str): The name/identifier of the exchange (e.g., "binance", "coinbase", "kraken")
Example Usage:
# Get Binance exchange information
get_crypto_exchange_info("binance")
# Returns detailed info including trust score, volume, country, etc.
Installation
Method 1: Using uvx (Recommended)
Install and run the MCP server directly using uvx:
# Install and run the server
uvx --from git+https://github.com/pratyushkr9420/crypto_python_mcp crypto-python-mcp
Method 2: Local Development
- Clone the repository:
git clone https://github.com/pratyushkr9420/crypto_python_mcp.git
cd crypto_python_mcp
- Install dependencies using uv:
uv sync
- Run the server:
uv run crypto-python-mcp
Method 3: Install as Package
# Install from GitHub
uv add git+https://github.com/pratyushkr9420/crypto_python_mcp
# Or install locally
uv add -e .
MCP Client Configuration
To use this server with MCP clients like Claude Desktop, add the following configuration to your MCP settings file:
For uvx installation:
{
"mcpServers": {
"crypto_python_mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/pratyushkr9420/crypto_python_mcp",
"crypto-python-mcp"
]
}
}
}
For local development:
{
"mcpServers": {
"crypto_python_mcp": {
"command": "uv",
"args": ["run", "crypto-python-mcp"],
"cwd": "/path/to/crypto_python_mcp"
}
}
}
Claude Desktop Integration
Windows
Add the configuration to:
%APPDATA%\Claude\claude_desktop_config.json
macOS
Add the configuration to:
~/Library/Application Support/Claude/claude_desktop_config.json
Linux
Add the configuration to:
~/.config/claude/claude_desktop_config.json
Sample Configuration File
Create a file named mcp.json with the following content for easy integration:
{
"mcpServers": {
"crypto_python_mcp": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/pratyushkr9420/crypto_python_mcp",
"crypto-python-mcp"
],
"env": {}
}
}
}
Usage Examples
Once configured with your MCP client, you can use natural language to interact with the tools:
Getting cryptocurrency prices:
- "What's the current price of Bitcoin?"
- "Show me the price of Ethereum and Dogecoin"
- "Get the current BTC price in USD"
Getting exchange information:
- "Tell me about Binance exchange"
- "What's the trust score for Coinbase?"
- "Give me information about Kraken exchange"
API Endpoints Used
- CoinGecko Pro API:
https://pro-api.coingecko.com/api/v3/simple/price(for price data) - CoinGecko Public API:
https://api.coingecko.com/api/v3/exchanges/{id}(for exchange data)
Requirements
- Python 3.13+
- httpx >= 0.25.0
- mcp[cli] >= 1.14.1
Error Handling
The server includes comprehensive error handling for:
- Invalid cryptocurrency names
- Non-existent exchanges
- API timeouts and rate limits
- Network connectivity issues
- Malformed API responses
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
License
This project is open source and available under the MIT License.
Support
For issues, questions, or contributions, please visit the GitHub repository.
Note: This server is for informational purposes only. Always conduct your own research before making any cryptocurrency-related decisions.