Skip to main content

A Memory-Enhanced MCP Server for Cryptocurrency Analysis using mem0

Project description

Crypto Memory MCP Server

A Memory-Enhanced MCP Server for Cryptocurrency Analysis that solves the context window limitation problem when analyzing multiple cryptocurrencies.

🎯 Problem Solved

When analyzing multiple cryptocurrencies with AI models, the context window gets filled up with tool calls and data, causing the AI to "forget" previous analysis. This MCP server provides persistent memory storage using mem0 to maintain analysis history across sessions.

✨ Features

  • 🧠 Persistent Memory: Store cryptocurrency analysis using mem0's advanced memory system
  • 🔍 Smart Retrieval: Search and retrieve previous analysis by symbol, type, or natural language queries
  • 📊 Multi-Symbol Comparison: Compare analysis across multiple cryptocurrencies without losing context
  • 📈 Analysis Categorization: Organize analysis by type (technical, fundamental, sentiment, etc.)
  • 📋 Memory Statistics: Track your analysis history and memory usage
  • 🗑️ Memory Management: Clean up old or irrelevant analysis data

🚀 Installation

pip install crypto-memory-mcp

Or install from source:

git clone <repository-url>
cd crypto-memory-mcp
pip install -e .

⚙️ Configuration

Quick VS Code Setup

  1. Install the package:

    pip install crypto-memory-mcp
    
  2. Get your OpenAI API key from https://platform.openai.com/api-keys

  3. Add to VS Code settings (Ctrl+, → search "claude mcp" → "Edit in settings.json"):

    Option 1: uvx (Modern, Recommended):

    {
      "claude.mcpServers": {
        "crypto-memory": {
          "command": "uvx",
          "args": ["crypto-memory-mcp"],
          "env": {
            "OPENAI_API_KEY": "your_openai_api_key_here"
          }
        }
      }
    }
    

    Option 2: Python Module (Windows/Fallback):

    {
      "claude.mcpServers": {
        "crypto-memory": {
          "command": "python",
          "args": ["-m", "crypto_memory_mcp"],
          "env": {
            "OPENAI_API_KEY": "your_openai_api_key_here"
          }
        }
      }
    }
    
  4. Restart VS Code and start using persistent memory for crypto analysis!

📖 Detailed setup guide: See VSCODE_SETUP.md for complete configuration instructions.

General MCP Configuration

For other MCP clients, add to your configuration:

{
  "mcpServers": {
    "crypto-memory": {
      "command": "crypto-memory-mcp",
      "env": {
        "OPENAI_API_KEY": "your_openai_api_key_here"
      }
    }
  }
}

🛠️ Available Tools

1. store_crypto_analysis

Store cryptocurrency analysis in persistent memory.

Parameters:

  • symbol: Cryptocurrency symbol (e.g., "BTCUSDT")
  • analysis_type: Type of analysis ("technical", "fundamental", "price_action", etc.)
  • data: JSON string containing analysis data
  • summary: Brief summary of the analysis
  • metadata: Optional JSON string with additional metadata

2. retrieve_crypto_analysis

Retrieve stored cryptocurrency analysis from memory.

Parameters:

  • symbol: Optional symbol to filter by
  • analysis_type: Optional analysis type to filter by
  • limit: Maximum number of results (default: 10)

3. compare_crypto_symbols

Compare analysis across multiple cryptocurrency symbols.

Parameters:

  • symbols: Comma-separated list of symbols (e.g., "BTCUSDT,ETHUSDT,ADAUSDT")
  • analysis_type: Optional analysis type to focus on

4. search_crypto_insights

Search for specific insights across all stored analysis.

Parameters:

  • query: Natural language search query (e.g., "bullish trends", "resistance levels")
  • limit: Maximum number of results (default: 5)

5. get_memory_stats

Get statistics about stored cryptocurrency analysis memories.

6. delete_crypto_analysis

Delete stored analysis for a specific symbol.

Parameters:

  • symbol: Cryptocurrency symbol to delete analysis for
  • analysis_type: Optional specific analysis type to delete

📋 Usage Examples

Basic Workflow

  1. Analyze a cryptocurrency using your Binance MCP server
  2. Store the analysis using store_crypto_analysis
  3. Analyze another cryptocurrency
  4. Compare them using compare_crypto_symbols or retrieve previous analysis with retrieve_crypto_analysis

Example Analysis Storage

{
  "symbol": "BTCUSDT",
  "analysis_type": "technical",
  "data": "{\"price\": 45000, \"rsi\": 65, \"macd\": \"bullish\", \"support\": 44000, \"resistance\": 47000}",
  "summary": "Bitcoin showing bullish momentum with RSI at 65, MACD crossover confirmed. Strong support at $44k.",
  "metadata": "{\"timeframe\": \"4h\", \"confidence\": 0.8}"
}

Example Multi-Symbol Comparison

{
  "symbols": "BTCUSDT,ETHUSDT,ADAUSDT,SOLUSDT",
  "analysis_type": "technical"
}

🔧 Integration with Binance MCP

This memory server is designed to work alongside your existing Binance MCP server:

  1. Use Binance MCP for real-time data and trading operations
  2. Use Crypto Memory MCP to store and retrieve analysis results
  3. AI can now analyze multiple cryptocurrencies without losing context

🤝 Workflow Integration

1. AI calls Binance MCP → Get BTCUSDT data
2. AI analyzes data → Technical analysis complete  
3. AI calls Memory MCP → Store analysis
4. AI calls Binance MCP → Get ETHUSDT data
5. AI analyzes data → Technical analysis complete
6. AI calls Memory MCP → Store analysis  
7. AI calls Memory MCP → Compare BTCUSDT vs ETHUSDT
8. AI provides comprehensive comparison without losing previous analysis

🧠 Memory Features

  • Semantic Search: Find analysis by meaning, not just keywords
  • Temporal Tracking: Maintain analysis timeline and history
  • Metadata Support: Rich context and categorization
  • Efficient Storage: Optimized for cryptocurrency analysis patterns

📊 Benefits

  • No More Context Loss: AI retains all previous analysis
  • Faster Analysis: Retrieve instead of re-calculating
  • Better Comparisons: Compare multiple cryptocurrencies easily
  • Analysis History: Track analysis over time
  • Improved Insights: Search across all stored analysis for patterns

🔐 Privacy & Security

  • All data stored locally by default (depending on mem0 configuration)
  • No sensitive trading keys required
  • Analysis data can be encrypted
  • User isolation supported

🛠️ Technical Details

  • Built with MCP (Model Context Protocol)
  • Uses mem0 for advanced memory management
  • Async/await support for high performance
  • Comprehensive error handling and validation

📈 Roadmap

  • Advanced analysis templates
  • Integration with more data sources
  • Analysis export/import functionality
  • Advanced search filters
  • Analysis trend detection
  • Automated memory cleanup

🤝 Contributing

Contributions welcome! Please read our contributing guidelines and submit pull requests.

📄 License

MIT License - see LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

crypto_memory_mcp-1.0.2.tar.gz (12.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

crypto_memory_mcp-1.0.2-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

Details for the file crypto_memory_mcp-1.0.2.tar.gz.

File metadata

  • Download URL: crypto_memory_mcp-1.0.2.tar.gz
  • Upload date:
  • Size: 12.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for crypto_memory_mcp-1.0.2.tar.gz
Algorithm Hash digest
SHA256 0d76d3771c34bf1c086f583edbeb4c9a350394c9c1888cb4ec5bfa373b2cb0c4
MD5 274a12c2bc38d788dcb789558e438c02
BLAKE2b-256 772a59855e55610c27e17580e0fbc22fa485019d10c7aed49aaacfd18eac07e0

See more details on using hashes here.

File details

Details for the file crypto_memory_mcp-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for crypto_memory_mcp-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 53ad769b555b1721ebddd68ab553be7dd75a8863c7f396f897e0d00ae2523276
MD5 b483a54df054a6b36b601ad46b25b8dc
BLAKE2b-256 b464c04fa2b3b9b7203be37e6b278b3ef3d6d2eb0af7aca9cbc9b20fffae187f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page