#!/bin/bash
# π Medical Research MCP Suite - Setup Script
echo "π₯ Setting up Medical Research MCP Suite..."
# Check if Node.js is installed
if ! command -v node &> /dev/null; then
echo "β Node.js is not installed. Please install Node.js 18+ and try again."
exit 1
fi
# Check Node.js version
NODE_VERSION=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
if [ "$NODE_VERSION" -lt 18 ]; then
echo "β Node.js version 18+ required. Current version: $(node -v)"
exit 1
fi
echo "β
Node.js $(node -v) detected"
# Install dependencies
echo "π¦ Installing dependencies..."
npm install
if [ $? -ne 0 ]; then
echo "β Failed to install dependencies"
exit 1
fi
echo "β
Dependencies installed successfully"
# Create environment file if it doesn't exist
if [ ! -f .env ]; then
echo "π§ Creating .env file from template..."
cp .env.example .env
echo "β
.env file created. Please edit it with your API keys if needed."
else
echo "β
.env file already exists"
fi
# Create logs directory if it doesn't exist
mkdir -p logs
# Build the project
echo "π¨ Building the project..."
npm run build
if [ $? -ne 0 ]; then
echo "β Build failed"
exit 1
fi
echo "β
Build completed successfully"
# Run tests
echo "π§ͺ Running tests..."
npm test
if [ $? -ne 0 ]; then
echo "β οΈ Some tests failed, but setup is complete"
else
echo "β
All tests passed"
fi
echo ""
echo "π Setup complete! Your Medical Research MCP Suite is ready to use."
echo ""
echo "Next steps:"
echo "1. Edit .env file with your API keys (optional - APIs work without keys but with rate limits)"
echo "2. Run 'npm run dev' to start the development server"
echo "3. Test with: echo '{\"method\":\"tools/list\",\"params\":{}}' | npm run dev"
echo ""
echo "For Claude Desktop integration, add this to your claude_desktop_config.json:"
echo '{'
echo ' "mcpServers": {'
echo ' "medical-research": {'
echo ' "command": "node",'
echo " \"args\": [\"$(pwd)/dist/index.js\"]"
echo ' }'
echo ' }'
echo '}'
echo ""
echo "π Read README.md for full documentation and examples"
echo "π Happy researching!"