We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/adamkwhite/claude-memory-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
setup_environment.shโข3.64 KiB
#!/bin/bash
#
# Setup and fix environment for Claude conversation import
#
set -e # Exit on any error
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo "๐ง Claude Memory System - Environment Setup"
echo "==========================================="
# Navigate to project root
PROJECT_ROOT="$(dirname "$SCRIPT_DIR")"
cd "$PROJECT_ROOT"
# Check if we're in the right directory
if [ ! -f "src/server_fastmcp.py" ]; then
echo "โ Error: Not in the claude-memory-mcp directory"
echo "๐ก Script should be run from within the project"
echo "๐ Current directory: $(pwd)"
exit 1
fi
# Check Python version
echo "๐ Checking Python version..."
python3 --version
# Check if virtual environment exists
if [ ! -d ".venv" ]; then
echo "๐ฆ Creating virtual environment..."
python3 -m venv .venv
else
echo "โ Virtual environment found"
fi
# Activate virtual environment
echo "๐ Activating virtual environment..."
source .venv/bin/activate
# Check if we have the right dependencies
echo "๐ Checking dependencies..."
# Install/upgrade dependencies
echo "โฌ๏ธ Installing/updating dependencies..."
pip install --upgrade pip
# Install MCP dependencies if missing
if ! pip show mcp > /dev/null 2>&1; then
echo "๐ฆ Installing MCP dependencies..."
pip install mcp
fi
# Install other required packages
pip install -r requirements.txt
echo "โ Dependencies installed"
# Verify MCP import works
echo "๐งช Testing MCP import..."
python3 -c "from mcp.server.fastmcp import FastMCP; print('โ MCP import successful')"
# Check data directory and files
echo "๐ Checking data files..."
if [ -d "data" ]; then
echo "โ Data directory found"
# Show file sizes
echo "๐ Data files:"
for file in data/*.json; do
if [ -f "$file" ]; then
size=$(stat -c%s "$file" 2>/dev/null || stat -f%z "$file" 2>/dev/null)
size_mb=$((size / 1024 / 1024))
echo " โข $(basename "$file"): ${size:,} bytes (${size_mb} MB)"
fi
done
# Check for conversations.json specifically
if [ -f "data/conversations.json" ]; then
conv_size=$(stat -c%s "data/conversations.json" 2>/dev/null || stat -f%z "data/conversations.json" 2>/dev/null)
if [ "$conv_size" -gt 1000 ]; then
echo "โ conversations.json found and appears to contain data"
else
echo "โ ๏ธ conversations.json is very small - might not contain conversation data"
fi
else
echo "โ conversations.json not found in data directory"
echo "๐ก Please ensure your exported conversations are at: data/conversations.json"
fi
else
echo "โ Data directory not found"
echo "๐ก Creating data directory..."
mkdir -p data
echo "๐ฅ Please place your conversations.json file in the data/ directory"
fi
# Test the memory server
echo "๐งช Testing memory server..."
if python3 -c "
import sys
sys.path.append('./src')
from server_fastmcp import ConversationMemoryServer
print('โ Memory server import successful')
" 2>/dev/null; then
echo "โ Memory server ready"
else
echo "โ ๏ธ Memory server test failed - but this might be normal for first run"
fi
echo ""
echo "๐ฏ Environment Setup Complete!"
echo "==============================="
echo ""
echo "โ Virtual environment: activated"
echo "โ Dependencies: installed"
echo "โ MCP: working"
echo "โ Memory server: ready"
echo ""
echo "๐ก Next steps:"
echo " 1. Ensure conversations.json is in data/ directory"
echo " 2. Run: ./import_workflow.sh"
echo ""
echo "๐ง If you need to reactivate the environment later:"
echo " source .venv/bin/activate"