CoinMarketCap Portfolio MCP Server

CoinMarketCap Portfolio MCP Server

Transforms Claude AI into a personal crypto portfolio analyst, enabling wallet analysis, AI-powered recommendations, and portfolio tracking across 8+ blockchains through natural conversation.

Category
Visit Server

README

CoinMarketCap Portfolio MCP Server πŸš€

Transform Claude AI into your personal crypto portfolio analyst.

Analyze wallets, get AI-powered recommendations, and track portfolios across 8+ blockchainsβ€”all through natural conversation with Claude.


🎯 What This Does

  • πŸ’Ό Portfolio Analysis - Analyze any crypto wallet with one command
  • πŸ“Š Market Data - Get real-time prices and trends for 1000+ tokens
  • πŸ€– AI Recommendations - Get personalized investment advice from Claude
  • 🌐 Multi-Chain - Supports Ethereum, Base, Solana, Polygon, Arbitrum, Optimism, Avalanche, BNB

πŸ—οΈ Architecture

Architecture

How it works:

  1. You ask Claude to analyze a wallet
  2. Claude calls the MCP server
  3. Server fetches data from Moralis & CoinMarketCap
  4. Claude provides insights with charts and recommendations

πŸ“Έ Example Output

Portfolio Analysis Portfolio Analysis

Claude analyzes your wallet and provides:

  • βœ… Total portfolio value
  • βœ… Asset allocation breakdown
  • βœ… Risk assessment with alerts
  • βœ… Rebalancing recommendations
  • βœ… Visual charts and graphs

πŸš€ Quick Start (5 Minutes)

Prerequisites

Step 1: Clone & Install

# Clone repository
git clone https://github.com/vibhudixit123/coinmarketcap_mcp.git
cd coinmarketcap_mcp

# Create virtual environment
python3 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Step 2: Configure API Key

# Copy environment template
cp .env.example .env

# Add your Moralis API key
nano .env

Add this line:

MORALIS_API_KEY=your_api_key_here

Get your free API key at moralis.io β†’ Dashboard β†’ Web3 APIs

Step 3: Test the Server

python -m src.server

You should see:

============================================================
CoinMarketCap MCP Server (Multi-Chain + Portfolio Edition)
Supported Chains: ethereum, base, polygon, arbitrum...
Total Tools: 12 (8 market + 4 portfolio)
============================================================
Moralis client initialized βœ…

Press Ctrl+C if it works. Now configure Claude Desktop!


πŸ–₯️ Configure Claude Desktop

Step 1: Find Your Paths

# Get your Python path
which python3
# Example output: /Users/yourname/coinmarketcap_mcp/venv/bin/python3

# Get your project path
pwd
# Example output: /Users/yourname/coinmarketcap_mcp

Step 2: Edit Claude Desktop Config

On Mac:

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

On Windows:

notepad %APPDATA%\Claude\claude_desktop_config.json

Step 3: Add This Configuration

{
  "mcpServers": {
    "coinmarketcap-portfolio": {
      "command": "/Users/yourname/coinmarketcap_mcp/venv/bin/python3",
      "args": ["-m", "src.server"],
      "cwd": "/Users/yourname/coinmarketcap_mcp",
      "env": {
        "PYTHONPATH": "/Users/yourname/coinmarketcap_mcp",
        "MORALIS_API_KEY": "your_moralis_api_key_here"
      }
    }
  }
}

Replace:

  • /Users/yourname/... with YOUR paths from Step 1
  • your_moralis_api_key_here with YOUR Moralis API key

Step 4: Restart Claude Desktop

  1. Quit Claude Desktop completely (Cmd+Q on Mac, close on Windows)
  2. Open Claude Desktop
  3. Look for πŸ”¨ hammer icon at the bottom

βœ… If you see the hammer icon, it worked!


πŸ’¬ Try It Out

Ask Claude:

"What blockchain networks do you support?"

"What's the price of ETH?"

"Analyze wallet 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb on Ethereum"

"Give me investment recommendations for my portfolio"

πŸ› οΈ Available Tools

Market Data (8 tools)

  • get_token_info - Get token details
  • list_tokens - Top tokens on any chain
  • compare_tokens - Compare multiple tokens
  • search_token_across_chains - Find token everywhere

Portfolio Analysis (4 tools)

  • analyze_wallet - Complete portfolio breakdown
  • get_portfolio_recommendations - AI investment advice
  • compare_portfolio_to_market - Benchmark performance
  • get_portfolio_summary - Quick overview

🐳 Docker

If you prefer Docker:

# Build
docker build -t coinmarketcap-mcp .

# Run
docker run -e MORALIS_API_KEY=your_key coinmarketcap-mcp

# Or use docker-compose
docker-compose up

🌐 Host it as a remote MCP server (multi-user)

You can run this as a public, hosted MCP server that anyone can connect to. It runs the MCP Streamable HTTP transport at /mcp and is multi-user by design: the server stores no Moralis key. Each user supplies their own Moralis API key on every request via the X-Moralis-Key header β€” so you never pay for their usage and there's nothing to abuse.

The market-data tools use a public CoinMarketCap endpoint and need no key. Only the 4 portfolio tools need a Moralis key, taken from the caller's header.

Run the HTTP transport locally

MCP_TRANSPORT=http PORT=8000 python -m src.server
# Health check:  curl http://localhost:8000/health
# MCP endpoint:  http://localhost:8000/mcp

Deploy to Render (free tier)

  1. Push this repo to GitHub.
  2. In Render: New β†’ Blueprint, select the repo. The included render.yaml builds the Dockerfile and sets MCP_TRANSPORT=http. (No MORALIS_API_KEY is set on the server β€” that's intentional.)
  3. Deploy. Your server is live at https://<your-app>.onrender.com/mcp.

Any Docker host (Railway, Fly.io, a VPS) works too β€” just set MCP_TRANSPORT=http and expose the port. Render injects PORT automatically.

How users connect (with their own key)

Clients that support remote MCP servers with custom headers (e.g. Cursor, Cline):

{
  "mcpServers": {
    "coinmarketcap": {
      "url": "https://<your-app>.onrender.com/mcp",
      "headers": { "X-Moralis-Key": "THEIR_OWN_MORALIS_KEY" }
    }
  }
}

For Claude Desktop, connect through the mcp-remote bridge:

{
  "mcpServers": {
    "coinmarketcap": {
      "command": "npx",
      "args": [
        "mcp-remote", "https://<your-app>.onrender.com/mcp",
        "--header", "X-Moralis-Key:THEIR_OWN_MORALIS_KEY"
      ]
    }
  }
}

Each user gets their own free Moralis key at moralis.io.


πŸ› Troubleshooting

"Module not found" error

Add PYTHONPATH to your Claude config:

"env": {
  "PYTHONPATH": "/full/path/to/coinmarketcap_mcp"
}

No hammer icon in Claude Desktop

  1. Check config file location is correct
  2. Verify Python path: which python3
  3. Test server manually: python -m src.server
  4. View logs: tail -f ~/Library/Logs/Claude/mcp*.log

"MORALIS_API_KEY not found"

Make sure the key is in both:

  • .env file in project directory
  • Claude Desktop config JSON

πŸ“¦ What You Get

βœ… 12 AI Tools for Claude to use
βœ… 8 Blockchain Networks supported
βœ… Real-time Data from Moralis & CoinMarketCap
βœ… Portfolio Analysis with risk assessment
βœ… AI Recommendations for rebalancing
βœ… Visual Dashboards with charts
βœ… Docker Support for easy deployment


🀝 Contributing

Pull requests welcome! For major changes, please open an issue first.


πŸ“„ License

MIT License - see LICENSE file


πŸ™ Credits


<div align="center">

Built by Vibhu Dixit

⭐ Star this repo if you find it useful!

Report Bug β€’ Request Feature

</div>

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured