Spaces:
Build error
Build error
initial commit
Browse files- docs/HOW_TO_RUN.md +74 -0
docs/HOW_TO_RUN.md
CHANGED
|
@@ -195,3 +195,77 @@ curl -X POST https://YOUR-MODAL-URL/ask \
|
|
| 195 |
- **Logs**: `modal app logs mcp-hack::finetune-phi3-modal`
|
| 196 |
- **Volumes**: `modal volume list`
|
| 197 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 195 |
- **Logs**: `modal app logs mcp-hack::finetune-phi3-modal`
|
| 196 |
- **Volumes**: `modal volume list`
|
| 197 |
|
| 198 |
+
---
|
| 199 |
+
|
| 200 |
+
## 🌐 Deploying to Hugging Face Spaces
|
| 201 |
+
|
| 202 |
+
Deploy your MCP Server to Hugging Face Spaces for public access.
|
| 203 |
+
|
| 204 |
+
### Prerequisites
|
| 205 |
+
- Hugging Face account ([sign up here](https://huggingface.co))
|
| 206 |
+
- Git configured locally
|
| 207 |
+
|
| 208 |
+
### Step 1: Create a Space
|
| 209 |
+
|
| 210 |
+
1. Go to [huggingface.co/new-space](https://huggingface.co/new-space)
|
| 211 |
+
2. Configure the Space:
|
| 212 |
+
- **Owner**: Select your username or organization (e.g., `MCP-1st-Birthday`)
|
| 213 |
+
- **Space name**: Choose a name (e.g., `sdlc-agent`)
|
| 214 |
+
- **License**: MIT
|
| 215 |
+
- **SDK**: Gradio
|
| 216 |
+
- **Space hardware**: CPU basic (free)
|
| 217 |
+
- **Visibility**: Public
|
| 218 |
+
3. Click **Create Space**
|
| 219 |
+
|
| 220 |
+
### Step 2: Push Your Code
|
| 221 |
+
|
| 222 |
+
```bash
|
| 223 |
+
# Navigate to project root
|
| 224 |
+
cd /Users/veeru/agents/mcp-hack
|
| 225 |
+
|
| 226 |
+
# Add Hugging Face as a remote (replace ORG and SPACE_NAME)
|
| 227 |
+
git remote add hf https://huggingface.co/spaces/ORG/SPACE_NAME
|
| 228 |
+
|
| 229 |
+
# Ensure .env is ignored
|
| 230 |
+
grep -q "mcp/.env" .gitignore || echo "mcp/.env" >> .gitignore
|
| 231 |
+
|
| 232 |
+
# Pull initial Space files
|
| 233 |
+
git pull hf main --allow-unrelated-histories
|
| 234 |
+
|
| 235 |
+
# Resolve any conflicts (usually just README)
|
| 236 |
+
git checkout --ours README.md
|
| 237 |
+
git add README.md
|
| 238 |
+
git commit -m "Merge Hugging Face Space initial files"
|
| 239 |
+
|
| 240 |
+
# Push to Hugging Face
|
| 241 |
+
git push hf main
|
| 242 |
+
```
|
| 243 |
+
|
| 244 |
+
### Step 3: Configure Secrets
|
| 245 |
+
|
| 246 |
+
1. Go to your Space's **Settings** tab
|
| 247 |
+
2. Scroll to **Repository secrets**
|
| 248 |
+
3. Add these secrets:
|
| 249 |
+
- `JIRA_URL`
|
| 250 |
+
- `JIRA_EMAIL`
|
| 251 |
+
- `JIRA_API_TOKEN`
|
| 252 |
+
- `JIRA_PROJECT_KEY`
|
| 253 |
+
- `RAG_ENABLED` = `true`
|
| 254 |
+
- `RAG_API_URL`
|
| 255 |
+
- `FINETUNED_MODEL_API_URL`
|
| 256 |
+
|
| 257 |
+
### Step 4: Monitor Deployment
|
| 258 |
+
|
| 259 |
+
1. Check the **Logs** tab to monitor the build
|
| 260 |
+
2. Once complete, your app will be live at:
|
| 261 |
+
```
|
| 262 |
+
https://huggingface.co/spaces/ORG/SPACE_NAME
|
| 263 |
+
```
|
| 264 |
+
|
| 265 |
+
### Important Notes
|
| 266 |
+
|
| 267 |
+
⚠️ **Limitations**:
|
| 268 |
+
- Only the MCP Server (`mcp/mcp_server.py`) will be deployed
|
| 269 |
+
- The Dashboard requires a separate deployment (use Render, Railway, or Fly.io)
|
| 270 |
+
|
| 271 |
+
✅ **Your Space is now live and accessible to anyone!**
|