🚀 Deployment Guide
This guide covers deploying the EU AI Act Compliance Suite for the MCP 1st Birthday Hackathon.
📋 Table of Contents
- Deployment Options
- Hugging Face Spaces (Recommended)
- Manual Deployment
- GitHub Actions CI/CD
- Environment Variables
- Hackathon Submission Checklist
🎯 Deployment Options
| Option | Best For | Difficulty |
|---|---|---|
| Hugging Face Spaces | Hackathon submission, public demos | ⭐ Easy |
| Docker | Self-hosted, production | ⭐⭐ Medium |
| Local Development | Testing, development | ⭐ Easy |
🤗 Hugging Face Spaces (Recommended)
The easiest way to deploy for the hackathon is using Hugging Face Spaces.
Method 1: Automated Deployment (GitHub Actions)
Fork this repository to your GitHub account
Add GitHub Secrets:
- Go to your repo → Settings → Secrets and variables → Actions
- Add
HF_TOKEN: Your Hugging Face token with write access
# Get your HF token from: https://huggingface.co/settings/tokens # Required scopes: write access to spacesJoin the Hackathon Organization:
- Go to MCP-1st-Birthday
- Click "Request to join this org"
- Wait for approval
Trigger Deployment:
- Push to
mainbranch (auto-deploys on changes tospaces/directory) - Or manually trigger via GitHub Actions → "Deploy to Hugging Face Spaces" → "Run workflow"
- Push to
Configure Space Secrets:
- Go to your Space settings:
https://huggingface.co/spaces/MCP-1st-Birthday/eu-ai-act-compliance/settings - Add secrets:
XAI_API_KEY(required) - Get from x.aiTAVILY_API_KEY(optional) - Get from tavily.com
- Go to your Space settings:
Method 2: Manual Upload
Create a new Space:
# Install huggingface_hub pip install huggingface_hub # Login huggingface-cli login # Create space huggingface-cli repo create eu-ai-act-compliance --type space --space-sdk gradioUpload files:
cd spaces/eu-ai-act-compliance # Clone the space git clone https://huggingface.co/spaces/YOUR_USERNAME/eu-ai-act-compliance # Copy files cp -r . eu-ai-act-compliance/ # Push cd eu-ai-act-compliance git add . git commit -m "Initial deployment" git pushTransfer to hackathon org (for submission):
- Go to Space Settings → Transfer
- Transfer to
MCP-1st-Birthdayorganization
Method 3: Using the Deploy Script
# Run the deployment script
./scripts/deploy-hf.sh
# With custom org/name
./scripts/deploy-hf.sh --org MCP-1st-Birthday --name eu-ai-act-compliance
🐳 Docker Deployment
Build and Run
# Build the image
docker build -t eu-ai-act-compliance -f Dockerfile .
# Run with environment variables
docker run -p 7860:7860 \
-e XAI_API_KEY=your-key \
-e TAVILY_API_KEY=your-key \
eu-ai-act-compliance
Docker Compose
version: '3.8'
services:
eu-ai-act-agent:
build: .
ports:
- "7860:7860"
environment:
- XAI_API_KEY=${XAI_API_KEY}
- TAVILY_API_KEY=${TAVILY_API_KEY}
restart: unless-stopped
🔧 Manual Deployment
Prerequisites
- Node.js 18+
- Python 3.9+
- pnpm 8+
Steps
# 1. Clone the repository
git clone https://github.com/your-org/eu-ai-act-compliance.git
cd eu-ai-act-compliance
# 2. Install dependencies
pnpm install
# 3. Set up environment variables
cp .env.example .env
# Edit .env and add your API keys
# 4. Build the MCP server
pnpm --filter @eu-ai-act/mcp-server build
# 5. Start the agent (API + Gradio)
cd apps/eu-ai-act-agent
./start.sh
Production Mode
# Build everything
pnpm build
# Start in production
cd apps/eu-ai-act-agent
NODE_ENV=production node dist/server.js &
python src/gradio_app.py
🔄 GitHub Actions CI/CD
Workflows
| Workflow | Trigger | Purpose |
|---|---|---|
ci.yml |
Push/PR | Lint, typecheck, build |
deploy-hf-space.yml |
Push to main + spaces/ changes |
Deploy to HF Spaces |
Required Secrets
| Secret | Required | Description |
|---|---|---|
HF_TOKEN |
Yes | Hugging Face token with write access |
Manual Deployment Trigger
- Go to Actions → "Deploy to Hugging Face Spaces"
- Click "Run workflow"
- Select branch and environment
- Click "Run workflow"
🔐 Environment Variables
Required
| Variable | Description | Where to Get |
|---|---|---|
XAI_API_KEY |
xAI API key for Grok model | console.x.ai |
Optional
| Variable | Description | Where to Get |
|---|---|---|
TAVILY_API_KEY |
Tavily API for web research | app.tavily.com |
PORT |
API server port (default: 3001) | - |
Setting Secrets in Hugging Face Spaces
- Go to your Space:
https://huggingface.co/spaces/ORG/SPACE_NAME - Click ⚙️ Settings
- Scroll to "Repository secrets"
- Add each secret:
- Name:
XAI_API_KEY - Value: Your API key
- Click "Add"
- Name:
✅ Hackathon Submission Checklist
Before Submission (Nov 30, 2025 11:59 PM UTC)
- Join the organization: Request to join MCP-1st-Birthday
- Deploy your Space: Make sure it's running and accessible
- Configure secrets: Add
XAI_API_KEY(and optionallyTAVILY_API_KEY) - Test the demo: Verify all features work
README Requirements
Your Space README must include:
Hackathon tags in frontmatter:
tags: - mcp - agents - track-1-mcp-servers - track-2-agentic-applicationsSocial media link: Share your project and include the link
[🐦 Twitter Post](https://twitter.com/your-post-link)
Track Tags
| Track | Tags |
|---|---|
| Track 1: Building MCP | track-1-mcp-servers, mcp |
| Track 2: MCP in Action | track-2-agentic-applications, agents |
Social Media Post Template
🇪🇺 Excited to share my #MCPHackathon submission!
EU AI Act Compliance Agent - AI-powered compliance assessment with MCP tools
✅ Discover organization profiles
✅ Classify AI systems by risk
✅ Generate compliance documentation
Try it: [HF Space Link]
#MCP #AIAct #Gradio @huggingface
🔍 Troubleshooting
Space Not Building
- Check
requirements.txtfor valid packages - Verify Python version compatibility
- Check build logs in Space settings
API Key Errors
- Verify secrets are set in Space settings
- Check secret names match exactly (case-sensitive)
- Ensure API keys are valid and have required permissions
Deployment Failing
- Check GitHub Actions logs
- Verify
HF_TOKENhas write access - Ensure you're a member of the target organization
Space Sleeping
Free HF Spaces sleep after inactivity. To wake:
- Visit the Space URL
- Wait for it to build/start
- Consider upgrading for persistent uptime
📞 Support
- Hackathon Discord: #agents-mcp-hackathon-winter25🏆
- GitHub Issues: Create an issue
- Email: gradio-team@huggingface.co
📚 Additional Resources
Good luck with your submission! 🎂