Update mcp-servers/eventbrite-scraper-mcp/README.md
Browse files
mcp-servers/eventbrite-scraper-mcp/README.md
CHANGED
|
@@ -1,331 +1,337 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
- β
|
| 23 |
-
- β
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
-
|
| 29 |
-
-
|
| 30 |
-
|
| 31 |
-
##
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
|
| 36 |
-
|
| 37 |
-
#
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
#
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
```
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
```
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
#
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
|
| 70 |
-
|
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
``
|
| 75 |
-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
"
|
| 94 |
-
"
|
| 95 |
-
"
|
| 96 |
-
"
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
```
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
|
| 114 |
-
|
| 115 |
-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
#
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
```
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
#
|
| 146 |
-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
|
| 151 |
-
|
| 152 |
-
|
| 153 |
-
#
|
| 154 |
-
|
| 155 |
-
|
| 156 |
-
#
|
| 157 |
-
|
| 158 |
-
```
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
|
| 164 |
-
|
| 165 |
-
|
| 166 |
-
#
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
#
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
#
|
| 173 |
-
|
| 174 |
-
|
| 175 |
-
|
| 176 |
-
|
| 177 |
-
|
| 178 |
-
|
| 179 |
-
|
| 180 |
-
|
| 181 |
-
|
| 182 |
-
###
|
| 183 |
-
-
|
| 184 |
-
-
|
| 185 |
-
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
-
|
| 190 |
-
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
|
| 200 |
-
|
| 201 |
-
|
| 202 |
-
β
|
| 203 |
-
|
| 204 |
-
β
|
| 205 |
-
|
| 206 |
-
β
|
| 207 |
-
|
| 208 |
-
β
|
| 209 |
-
|
| 210 |
-
|
| 211 |
-
|
| 212 |
-
|
| 213 |
-
|
| 214 |
-
|
| 215 |
-
|
| 216 |
-
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
|
| 225 |
-
|
| 226 |
-
|
| 227 |
-
|
| 228 |
-
|
| 229 |
-
|
| 230 |
-
|
| 231 |
-
|
| 232 |
-
|
| 233 |
-
-
|
| 234 |
-
-
|
| 235 |
-
|
| 236 |
-
|
| 237 |
-
|
| 238 |
-
|
| 239 |
-
-
|
| 240 |
-
|
| 241 |
-
|
| 242 |
-
|
| 243 |
-
|
| 244 |
-
|
| 245 |
-
-
|
| 246 |
-
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
|
| 250 |
-
|
| 251 |
-
-
|
| 252 |
-
|
| 253 |
-
|
| 254 |
-
|
| 255 |
-
β οΈ **
|
| 256 |
-
-
|
| 257 |
-
-
|
| 258 |
-
-
|
| 259 |
-
|
| 260 |
-
|
| 261 |
-
|
| 262 |
-
|
| 263 |
-
|
| 264 |
-
|
| 265 |
-
|
| 266 |
-
|
| 267 |
-
|
| 268 |
-
###
|
| 269 |
-
1.
|
| 270 |
-
2.
|
| 271 |
-
3.
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
| 277 |
-
|
| 278 |
-
|
| 279 |
-
|
| 280 |
-
``
|
| 281 |
-
|
| 282 |
-
|
| 283 |
-
|
| 284 |
-
|
| 285 |
-
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
|
| 290 |
-
|
| 291 |
-
|
| 292 |
-
|
| 293 |
-
-
|
| 294 |
-
|
| 295 |
-
|
| 296 |
-
|
| 297 |
-
|
| 298 |
-
###
|
| 299 |
-
|
| 300 |
-
|
| 301 |
-
|
| 302 |
-
|
| 303 |
-
|
| 304 |
-
|
| 305 |
-
|
| 306 |
-
|
| 307 |
-
|
| 308 |
-
|
| 309 |
-
|
| 310 |
-
|
| 311 |
-
|
| 312 |
-
|
| 313 |
-
|
| 314 |
-
|
| 315 |
-
|
| 316 |
-
|
| 317 |
-
|
| 318 |
-
|
| 319 |
-
|
| 320 |
-
|
| 321 |
-
|
| 322 |
-
|
| 323 |
-
|
| 324 |
-
|
| 325 |
-
|
| 326 |
-
|
| 327 |
-
|
| 328 |
-
|
| 329 |
-
|
| 330 |
-
|
| 331 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
tags:
|
| 2 |
+
- building-mcp-track-enterprise
|
| 3 |
+
- building-mcp-track-consumer
|
| 4 |
+
- building-mcp-track-creative
|
| 5 |
+
|
| 6 |
+
----
|
| 7 |
+
# Eventbrite Scraper MCP Server
|
| 8 |
+
|
| 9 |
+
A Model Context Protocol (MCP) server for scraping and searching events from Eventbrite with comprehensive input validation and error handling.
|
| 10 |
+
|
| 11 |
+
## Overview
|
| 12 |
+
|
| 13 |
+
This server provides real-time event discovery from Eventbrite through web scraping. It's designed to be lightweight, fast, and robust with built-in security measures to prevent injection attacks and malformed queries.
|
| 14 |
+
|
| 15 |
+
**Server Type:** Web Scraper
|
| 16 |
+
**Framework:** FastMCP + FastAPI
|
| 17 |
+
**Deployment:** Blaxel, Docker, Local
|
| 18 |
+
**Response Time:** ~2-5 seconds per search
|
| 19 |
+
|
| 20 |
+
## Features
|
| 21 |
+
|
| 22 |
+
- β
Real-time Eventbrite event searching
|
| 23 |
+
- β
Multi-parameter filtering (location, date, price, categories)
|
| 24 |
+
- β
Input validation and sanitization
|
| 25 |
+
- β
Rate limiting (respectful to Eventbrite servers)
|
| 26 |
+
- β
Fallback HTML selectors for robustness
|
| 27 |
+
- β
Structured JSON responses
|
| 28 |
+
- β
User-Agent rotation
|
| 29 |
+
- β
Error handling and logging
|
| 30 |
+
|
| 31 |
+
## Installation
|
| 32 |
+
|
| 33 |
+
### Prerequisites
|
| 34 |
+
- Python 3.10+
|
| 35 |
+
- pip or Poetry
|
| 36 |
+
|
| 37 |
+
### Setup
|
| 38 |
+
|
| 39 |
+
```bash
|
| 40 |
+
# Clone/navigate to the server directory
|
| 41 |
+
cd eventbrite-scraper-mcp
|
| 42 |
+
|
| 43 |
+
# Install dependencies
|
| 44 |
+
pip install -e .
|
| 45 |
+
# OR
|
| 46 |
+
poetry install
|
| 47 |
+
```
|
| 48 |
+
|
| 49 |
+
### Configuration
|
| 50 |
+
|
| 51 |
+
Create a `.env` file in the root directory:
|
| 52 |
+
|
| 53 |
+
```env
|
| 54 |
+
# Optional: Configure logging level
|
| 55 |
+
LOG_LEVEL=INFO
|
| 56 |
+
|
| 57 |
+
# Optional: Request timeout (seconds)
|
| 58 |
+
REQUEST_TIMEOUT=10
|
| 59 |
+
```
|
| 60 |
+
|
| 61 |
+
## Tools
|
| 62 |
+
|
| 63 |
+
### `search_eventbrite`
|
| 64 |
+
|
| 65 |
+
Search and filter events on Eventbrite.
|
| 66 |
+
|
| 67 |
+
**Parameters:**
|
| 68 |
+
|
| 69 |
+
| Parameter | Type | Required | Constraints | Description |
|
| 70 |
+
|-----------|------|----------|-------------|-------------|
|
| 71 |
+
| `location` | string | β
Yes | 2-100 chars, no special chars | City or region (e.g., "New York", "San Francisco") |
|
| 72 |
+
| `start_date` | string | β No | YYYY-MM-DD format | Filter events from this date onwards |
|
| 73 |
+
| `end_date` | string | β No | YYYY-MM-DD format | Filter events up to this date |
|
| 74 |
+
| `min_price` | float | β No | β₯ 0 | Minimum ticket price filter |
|
| 75 |
+
| `max_price` | float | β No | β₯ 0 | Maximum ticket price filter |
|
| 76 |
+
| `categories` | list[string] | β No | Max 10 items | Event categories (e.g., ["music", "food", "sports"]) |
|
| 77 |
+
|
| 78 |
+
**Response Structure:**
|
| 79 |
+
|
| 80 |
+
```json
|
| 81 |
+
{
|
| 82 |
+
"success": true,
|
| 83 |
+
"query": {
|
| 84 |
+
"location": "New York",
|
| 85 |
+
"start_date": "2025-06-01",
|
| 86 |
+
"end_date": "2025-06-30",
|
| 87 |
+
"min_price": 0,
|
| 88 |
+
"max_price": 100,
|
| 89 |
+
"categories": []
|
| 90 |
+
},
|
| 91 |
+
"events": [
|
| 92 |
+
{
|
| 93 |
+
"title": "Summer Music Festival",
|
| 94 |
+
"date": "2025-06-15",
|
| 95 |
+
"location": "New York, NY",
|
| 96 |
+
"venue": "Central Park",
|
| 97 |
+
"price_min": 25.0,
|
| 98 |
+
"price_max": 75.0,
|
| 99 |
+
"is_free": false,
|
| 100 |
+
"url": "https://www.eventbrite.com/e/...",
|
| 101 |
+
"source": "Eventbrite",
|
| 102 |
+
"category": "music"
|
| 103 |
+
}
|
| 104 |
+
],
|
| 105 |
+
"count": 1,
|
| 106 |
+
"timestamp": "2025-06-01T12:00:00Z"
|
| 107 |
+
}
|
| 108 |
+
```
|
| 109 |
+
|
| 110 |
+
## Usage Examples
|
| 111 |
+
|
| 112 |
+
### Basic Search
|
| 113 |
+
|
| 114 |
+
```python
|
| 115 |
+
from client import EventbriteScraperClient
|
| 116 |
+
|
| 117 |
+
client = EventbriteScraperClient()
|
| 118 |
+
|
| 119 |
+
# Search for all events in a location
|
| 120 |
+
result = await client.search_eventbrite(
|
| 121 |
+
location="New York"
|
| 122 |
+
)
|
| 123 |
+
```
|
| 124 |
+
|
| 125 |
+
### Advanced Search with Filters
|
| 126 |
+
|
| 127 |
+
```python
|
| 128 |
+
# Search with multiple filters
|
| 129 |
+
result = await client.search_eventbrite(
|
| 130 |
+
location="San Francisco",
|
| 131 |
+
start_date="2025-07-01",
|
| 132 |
+
end_date="2025-07-31",
|
| 133 |
+
min_price=0,
|
| 134 |
+
max_price=50,
|
| 135 |
+
categories=["music", "tech"]
|
| 136 |
+
)
|
| 137 |
+
|
| 138 |
+
# Process results
|
| 139 |
+
for event in result['events']:
|
| 140 |
+
print(f"{event['title']} - {event['date']} at {event['venue']}")
|
| 141 |
+
```
|
| 142 |
+
|
| 143 |
+
## Running the Server
|
| 144 |
+
|
| 145 |
+
### Local Development
|
| 146 |
+
|
| 147 |
+
```bash
|
| 148 |
+
# Start the server
|
| 149 |
+
python src/server.py
|
| 150 |
+
|
| 151 |
+
# Server will be available at:
|
| 152 |
+
# http://localhost:8000
|
| 153 |
+
# MCP endpoint: http://localhost:8000/mcp
|
| 154 |
+
```
|
| 155 |
+
|
| 156 |
+
### Docker
|
| 157 |
+
|
| 158 |
+
```bash
|
| 159 |
+
# Build container
|
| 160 |
+
docker build -t eventbrite-scraper-mcp .
|
| 161 |
+
|
| 162 |
+
# Run container
|
| 163 |
+
docker run -p 8000:8000 eventbrite-scraper-mcp
|
| 164 |
+
```
|
| 165 |
+
|
| 166 |
+
### Blaxel Deployment
|
| 167 |
+
|
| 168 |
+
```bash
|
| 169 |
+
# Deploy via Blaxel CLI
|
| 170 |
+
blaxel deploy
|
| 171 |
+
|
| 172 |
+
# Configuration in blaxel.toml:
|
| 173 |
+
# - Function timeout: 900 seconds
|
| 174 |
+
# - Memory: 2048 MB
|
| 175 |
+
# - HTTP trigger: /mcp (public)
|
| 176 |
+
```
|
| 177 |
+
|
| 178 |
+
## Input Validation
|
| 179 |
+
|
| 180 |
+
All inputs are validated before processing:
|
| 181 |
+
|
| 182 |
+
### Location Validation
|
| 183 |
+
- Length: 2-100 characters
|
| 184 |
+
- Blocks path traversal attempts (`../`, `..\\`)
|
| 185 |
+
- Blocks SQL injection patterns
|
| 186 |
+
- Allows spaces and hyphens only
|
| 187 |
+
|
| 188 |
+
### Date Validation
|
| 189 |
+
- Format: `YYYY-MM-DD`
|
| 190 |
+
- Must be valid calendar dates
|
| 191 |
+
- Supports past, current, and future dates
|
| 192 |
+
|
| 193 |
+
### Price Validation
|
| 194 |
+
- Must be non-negative numbers
|
| 195 |
+
- Supports floating-point values
|
| 196 |
+
- `max_price` must be β₯ `min_price`
|
| 197 |
+
|
| 198 |
+
## Architecture
|
| 199 |
+
|
| 200 |
+
```
|
| 201 |
+
User Request
|
| 202 |
+
β
|
| 203 |
+
Input Validation
|
| 204 |
+
β
|
| 205 |
+
Build Eventbrite URL
|
| 206 |
+
β
|
| 207 |
+
HTTP Request (with User-Agent)
|
| 208 |
+
β
|
| 209 |
+
Parse HTML with BeautifulSoup
|
| 210 |
+
β
|
| 211 |
+
Try Fallback Selectors
|
| 212 |
+
β
|
| 213 |
+
Extract Event Data
|
| 214 |
+
β
|
| 215 |
+
Return JSON Response
|
| 216 |
+
```
|
| 217 |
+
|
| 218 |
+
## Error Handling
|
| 219 |
+
|
| 220 |
+
| Error | Status | Solution |
|
| 221 |
+
|-------|--------|----------|
|
| 222 |
+
| Invalid location | 400 | Provide valid 2-100 char location |
|
| 223 |
+
| Invalid date format | 400 | Use YYYY-MM-DD format |
|
| 224 |
+
| Network timeout | 503 | Retry after 10 seconds |
|
| 225 |
+
| No events found | 200 | Returns empty events array |
|
| 226 |
+
| Eventbrite blocked | 429 | Rate limiter activated, wait 60 seconds |
|
| 227 |
+
|
| 228 |
+
## Performance
|
| 229 |
+
|
| 230 |
+
- **Average Response Time:** 2-5 seconds
|
| 231 |
+
- **Timeout:** 30 seconds per request
|
| 232 |
+
- **Rate Limiting:** 1 second sleep between requests
|
| 233 |
+
- **Concurrent Requests:** Single-threaded (async compatible)
|
| 234 |
+
- **Memory Usage:** ~50 MB
|
| 235 |
+
|
| 236 |
+
## Security Measures
|
| 237 |
+
|
| 238 |
+
β
**Input Sanitization**
|
| 239 |
+
- Blocks path traversal (`../`)
|
| 240 |
+
- Blocks SQL injection patterns
|
| 241 |
+
- Character whitelist enforcement
|
| 242 |
+
|
| 243 |
+
β
**Rate Limiting**
|
| 244 |
+
- 1-second delay between requests
|
| 245 |
+
- Respectful to Eventbrite servers
|
| 246 |
+
|
| 247 |
+
β
**User-Agent Rotation**
|
| 248 |
+
- Appears as legitimate browser requests
|
| 249 |
+
|
| 250 |
+
β
**Error Suppression**
|
| 251 |
+
- No sensitive information in error messages
|
| 252 |
+
|
| 253 |
+
## Limitations
|
| 254 |
+
|
| 255 |
+
β οΈ **Web Scraping Constraints**
|
| 256 |
+
- Depends on Eventbrite HTML structure
|
| 257 |
+
- May break if Eventbrite changes selectors
|
| 258 |
+
- Subject to rate limiting from Eventbrite
|
| 259 |
+
- Cannot access Eventbrite API (requires authentication)
|
| 260 |
+
|
| 261 |
+
β οΈ **Coverage**
|
| 262 |
+
- Only searches Eventbrite.com
|
| 263 |
+
- Limited to 20 results per location search
|
| 264 |
+
- May not include all event details
|
| 265 |
+
|
| 266 |
+
## Troubleshooting
|
| 267 |
+
|
| 268 |
+
### No events returned
|
| 269 |
+
1. Verify location spelling
|
| 270 |
+
2. Check date range validity
|
| 271 |
+
3. Try without category filters
|
| 272 |
+
4. Ensure Eventbrite isn't blocking requests
|
| 273 |
+
|
| 274 |
+
### Timeout errors
|
| 275 |
+
1. Increase timeout in configuration
|
| 276 |
+
2. Reduce search scope (narrower dates/location)
|
| 277 |
+
3. Check network connectivity
|
| 278 |
+
|
| 279 |
+
### Invalid JSON responses
|
| 280 |
+
1. Check server logs: `tail -f logs/server.log`
|
| 281 |
+
2. Verify input parameters
|
| 282 |
+
3. Ensure Eventbrite is accessible
|
| 283 |
+
|
| 284 |
+
## Dependencies
|
| 285 |
+
|
| 286 |
+
```
|
| 287 |
+
fastmcp >= 2.0.0
|
| 288 |
+
fastapi >= 0.104.0
|
| 289 |
+
uvicorn >= 0.24.0
|
| 290 |
+
requests >= 2.31.0
|
| 291 |
+
beautifulsoup4 >= 4.12.0
|
| 292 |
+
lxml >= 4.9.0
|
| 293 |
+
python-dotenv >= 1.0.0
|
| 294 |
+
```
|
| 295 |
+
|
| 296 |
+
## Maintenance
|
| 297 |
+
|
| 298 |
+
### Regular Tasks
|
| 299 |
+
- Monitor HTML selector changes on Eventbrite
|
| 300 |
+
- Update User-Agent strings quarterly
|
| 301 |
+
- Test with latest Python 3.10+ versions
|
| 302 |
+
- Review error logs weekly
|
| 303 |
+
|
| 304 |
+
### Updating Selectors
|
| 305 |
+
If Eventbrite changes their HTML structure:
|
| 306 |
+
|
| 307 |
+
1. Open https://www.eventbrite.com/search/
|
| 308 |
+
2. Inspect event card HTML
|
| 309 |
+
3. Update selectors in `src/server.py`
|
| 310 |
+
4. Run tests: `pytest tests/`
|
| 311 |
+
|
| 312 |
+
## Contributing
|
| 313 |
+
|
| 314 |
+
To improve this server:
|
| 315 |
+
|
| 316 |
+
1. Test thoroughly before committing
|
| 317 |
+
2. Add input validation for new parameters
|
| 318 |
+
3. Follow existing error handling patterns
|
| 319 |
+
4. Document new features in this README
|
| 320 |
+
5. Maintain backwards compatibility
|
| 321 |
+
|
| 322 |
+
## License
|
| 323 |
+
|
| 324 |
+
Same as parent project (MCP Security Hackathon)
|
| 325 |
+
|
| 326 |
+
## Support
|
| 327 |
+
|
| 328 |
+
For issues or questions:
|
| 329 |
+
1. Check the Troubleshooting section above
|
| 330 |
+
2. Review server logs in `logs/`
|
| 331 |
+
3. File an issue in the main repository
|
| 332 |
+
4. Contact the MCP Security team
|
| 333 |
+
|
| 334 |
+
---
|
| 335 |
+
|
| 336 |
+
**Last Updated:** 2025-06-01
|
| 337 |
+
**Maintainer:** MCP Security Team
|