This guide will help you deploy Project Synapse to production environments.
- Google Generative AI API Key
- Hugging Face account (for MCP server)
- Vercel account (for frontend)
- GitHub repository (for automated deployments)
- Go to Hugging Face Spaces
- Click "Create new Space"
- Configure your space:
- Space name:
project-synapse-mcp(or your preferred name) - License: MIT
- SDK: Docker
- Visibility: Public
- Hardware: CPU basic (free tier)
- Space name:
# Clone your repository
git clone https://github.com/your-username/project-synapse.git
cd project-synapse
# Add Hugging Face remote
git remote add hf https://huggingface.co/spaces/your-username/project-synapse-mcpIn your Hugging Face Space settings, add:
GOOGLE_API_KEY=your_google_generative_ai_api_key
PORT=7860# Push to Hugging Face
git push hf mainYour MCP server will be available at: https://your-username-project-synapse-mcp.hf.space
cd frontend
# Install dependencies
npm install
# Test build locally
npm run build# Install Vercel CLI
npm install -g vercel
# Deploy
vercel
# Follow prompts and configure:
# - Project name: project-synapse-frontend
# - Framework: Next.js
# - Root directory: ./In your Vercel project settings, add:
NEXT_PUBLIC_MCP_SERVER_URL=https://your-username-project-synapse-mcp.hf.spaceFor automatic deployments:
- Go to Vercel Dashboard
- Click "Import Project"
- Connect your GitHub repository
- Set build configuration:
- Framework: Next.js
- Root Directory:
frontend - Build Command:
npm run build - Output Directory:
.next
-
Add secrets to your GitHub repository:
HF_TOKEN: Your Hugging Face tokenHF_SPACE_NAME: Your space name (e.g.,username/project-synapse-mcp)
-
The workflow in
.github/workflows/deploy-hf.ymlwill automatically deploy to Hugging Face on pushes to main.
Dockerfile- Container configuration.dockerignore- Files to exclude from Docker buildrequirements.txt- Python dependenciesREADME_HF.md- Hugging Face Space README
frontend/vercel.json- Vercel configurationfrontend/.env.example- Environment variables templatefrontend/package.json- Node.js dependencies
After successful deployment:
- MCP Server:
https://your-username-project-synapse-mcp.hf.space - API Documentation:
https://your-username-project-synapse-mcp.hf.space/docs - Frontend Dashboard:
https://your-project-name.vercel.app
# Health check
curl https://your-username-project-synapse-mcp.hf.space/health
# List tools
curl https://your-username-project-synapse-mcp.hf.space/tools
# Test a tool
curl -X POST "https://your-username-project-synapse-mcp.hf.space/tools/get_merchant_status" \
-H "Content-Type: application/json" \
-d '{"merchant_name": "Pizza Palace"}'- Open your Vercel URL
- Check dashboard loads correctly
- Test agent interface with sample scenarios
- Verify MCP server connection
MCP Server not starting:
- Check
GOOGLE_API_KEYis set correctly - Verify Dockerfile builds successfully locally
- Check Hugging Face Space logs
Frontend can't connect to MCP server:
- Verify
NEXT_PUBLIC_MCP_SERVER_URLenvironment variable - Check CORS settings in MCP server
- Test MCP server endpoints directly
Build failures:
- Check all dependencies are in
requirements.txt - Verify Node.js version compatibility
- Check for missing environment variables
- Hugging Face: Check Space logs and metrics
- Vercel: Monitor function logs and analytics
- Frontend: Check browser console for errors
git push hf main- Vercel automatically deploys on git push (if connected to GitHub)
- Or use
vercel --prodfor manual deployment