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"):

    For Windows:

    {
      "claude.mcpServers": {
        "crypto-memory": {
          "command": "python",
          "args": ["-m", "crypto_memory_mcp"],
          "env": {
            "OPENAI_API_KEY": "your_openai_api_key_here"
          }
        }
      }
    }
    

    For Linux/macOS:

    {
      "claude.mcpServers": {
        "crypto-memory": {
          "command": "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.1.tar.gz (12.2 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.1-py3-none-any.whl (10.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: crypto_memory_mcp-1.0.1.tar.gz
  • Upload date:
  • Size: 12.2 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.1.tar.gz
Algorithm Hash digest
SHA256 2c62af4ab45128c31627d0db898ed50d21693259ef0ba06410511bcbd60984a4
MD5 a853cad85cb9be8cd884d2ec9dadf847
BLAKE2b-256 cade9056bf1d391001d469d7d5304f91ffeb807d82484090d43e6a674c780fc4

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for crypto_memory_mcp-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f367d9989064a137de786063ba160d11f4be9cd0be6889d6485ff62f8673b618
MD5 1de46eea822132730781c9deea3196d2
BLAKE2b-256 01c1f3a594466d481d39b3b982d6575f5e07a1b1d1c3c1beeabbe872baa70216

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