Skip to content

MCP Servers Overview

This document provides a comprehensive overview of all Model Context Protocol (MCP) servers integrated into the Inttrest platform for AI-powered event discovery.

๐ŸŽฏ Platform Integration

The Inttrest platform leverages four specialized MCP servers to provide comprehensive event discovery across multiple platforms:

graph TB
    subgraph "Inttrest AI Platform"
        A[Vercel AI SDK] --> B[MCP Client Manager]
        B --> C[Event Aggregation Engine]
        C --> D[AI Analysis & Recommendations]
        D --> E[User Interface]
    end

    subgraph "MCP Server Ecosystem"
        F[Eventbrite MCP] --> B
        G[Instagram MCP] --> B
        H[LinkedIn MCP] --> B
        I[Meetup MCP] --> B
    end

    subgraph "Data Sources"
        J[Eventbrite API] --> F
        K[Instagram Web Scraping] --> G
        L[LinkedIn API/Scraping] --> H
        M[Meetup API] --> I
    end

    subgraph "User Experience"
        E --> N[Chat Interface]
        E --> O[Map Visualization]
        E --> P[Event Recommendations]
        E --> Q[Professional Networking]
    end

    style A fill:#e3f2fd
    style B fill:#e8f5e8
    style C fill:#fff3e0
    style D fill:#fce4ec

๐Ÿ“‹ Server Comparison

Server Primary Focus Data Source Use Cases Strengths
Eventbrite Professional Events Eventbrite API Conferences, Workshops, Ticketed Events Official API, Rich metadata, Payment info
Instagram Social Events Web Scraping + AI Parties, Social gatherings, Trendy events Visual content, Social buzz, Real-time discovery
LinkedIn Business Events LinkedIn API + Scraping Networking, Professional development Professional context, Industry insights, Quality networking
Meetup Community Events Meetup API Local meetups, Interest groups, Recurring events Community-driven, Group health analysis, Local focus

๐Ÿ› ๏ธ Technical Architecture

Common MCP Framework

All servers follow the same architectural pattern:

// Standard MCP server structure
interface MCPServer {
  // Core server setup
  server: Server
  apiClient: APIClient
  contentAnalyzer: ContentAnalyzer

  // Tool handlers
  setupToolHandlers(): void

  // Lifecycle management
  start(): Promise<void>
  stop(): Promise<void>
}

Shared Components

1. Authentication Management

// OAuth 2.0 flow for API access
interface AuthConfig {
  clientId: string
  clientSecret: string
  redirectUri: string
  accessToken?: string
  refreshToken?: string
}

2. Rate Limiting

// Consistent rate limiting across all servers
interface RateLimitConfig {
  requests: number
  window: number // milliseconds
  burst?: number
  backoff?: 'exponential' | 'linear'
}

3. Caching Strategy

// Multi-tier caching for optimal performance
interface CacheConfig {
  redis?: RedisConfig     // Distributed cache
  memory: MemoryConfig    // Local cache
  ttl: number            // Time to live
}

4. AI Integration

// OpenAI integration for content analysis
interface AIAnalysisConfig {
  provider: 'openai' | 'anthropic'
  model: string
  temperature: number
  maxTokens: number
}

๐Ÿ”ง Installation & Setup

Quick Start

# Clone the repository
git clone https://github.com/FilippTrigub/inttrest
cd inttrest

# Install dependencies
npm install

# Set up environment variables
cp .env.example .env
# Edit .env with your API keys

# Build all MCP servers
npm run build:mcp

# Start the platform
npm run dev

Environment Configuration

Create a comprehensive .env file:

# ===== EVENTBRITE MCP =====
EVENTBRITE_API_KEY=your_eventbrite_oauth_token
EVENTBRITE_API_BASE_URL=https://www.eventbriteapi.com/v3

# ===== INSTAGRAM MCP =====
INSTAGRAM_USERNAME=your_instagram_username
INSTAGRAM_PASSWORD=your_instagram_password
OPENAI_API_KEY=your_openai_api_key

# ===== LINKEDIN MCP =====
LINKEDIN_CLIENT_ID=your_linkedin_client_id
LINKEDIN_CLIENT_SECRET=your_linkedin_client_secret
LINKEDIN_ACCESS_TOKEN=your_linkedin_access_token

# ===== MEETUP MCP =====
MEETUP_API_KEY=your_meetup_api_key
MEETUP_CLIENT_ID=your_oauth_client_id
MEETUP_CLIENT_SECRET=your_oauth_client_secret

# ===== SHARED CONFIGURATION =====
# AI Analysis
OPENAI_API_KEY=your_openai_api_key
OPENAI_MODEL=gpt-4-turbo-preview

# Cache & Performance
REDIS_URL=redis://localhost:6379
CACHE_TTL=3600000
RATE_LIMIT_REQUESTS=100
RATE_LIMIT_WINDOW=3600000

# Logging
LOG_LEVEL=info
LOG_FILE=inttrest-mcp.log

# Geographic Defaults
DEFAULT_LOCATION=37.7749,-122.4194  # San Francisco
DEFAULT_RADIUS=25

๐Ÿ“Š Usage Examples

// Search across all platforms simultaneously
async function searchAllPlatforms(query: string, location: string) {
  const mcpClient = await setupMCPClients()

  const [eventbriteEvents, instagramEvents, linkedinEvents, meetupEvents] = 
    await Promise.all([
      mcpClient.eventbrite.callTool({
        name: 'search_events',
        arguments: { q: query, location }
      }),

      mcpClient.instagram.callTool({
        name: 'search_instagram_events',
        arguments: { hashtags: [query], location }
      }),

      mcpClient.linkedin.callTool({
        name: 'search_professional_events',
        arguments: { keywords: [query], location }
      }),

      mcpClient.meetup.callTool({
        name: 'search_meetup_events',
        arguments: { keywords: [query], location }
      })
    ])

  return {
    professional: [...eventbriteEvents._meta.events, ...linkedinEvents._meta.events],
    social: instagramEvents._meta.events,
    community: meetupEvents._meta.events,
    total: eventbriteEvents._meta.events.length + 
           instagramEvents._meta.events.length + 
           linkedinEvents._meta.events.length + 
           meetupEvents._meta.events.length
  }
}

AI-Powered Event Analysis

// Cross-platform event analysis with AI
async function analyzeEventLandscape(location: string, interests: string[]) {
  const events = await searchAllPlatforms(interests.join(' '), location)

  const analysis = await openai.chat.completions.create({
    model: 'gpt-4-turbo-preview',
    messages: [{
      role: 'system',
      content: 'Analyze the event landscape and provide insights about trends, opportunities, and recommendations.'
    }, {
      role: 'user',
      content: `
Analyze these events in ${location}:
- Professional Events: ${events.professional.length}
- Social Events: ${events.social.length}  
- Community Events: ${events.community.length}

User interests: ${interests.join(', ')}

Provide insights about:
1. Event trends in this location
2. Best networking opportunities
3. Personalized recommendations
4. Optimal timing for attendance
`
    }]
  })

  return {
    events,
    insights: analysis.choices[0].message.content,
    recommendations: await generatePersonalizedRecommendations(events, interests)
  }
}

Real-time Event Monitoring

// Set up monitoring across all platforms
async function setupEventMonitoring(userPreferences: UserPreferences) {
  const mcpClients = await setupMCPClients()

  // Monitor professional events
  await mcpClients.eventbrite.callTool({
    name: 'monitor_events',
    arguments: {
      categories: userPreferences.professionalInterests,
      location: userPreferences.location
    }
  })

  // Monitor social events  
  await mcpClients.instagram.callTool({
    name: 'monitor_instagram_accounts',
    arguments: {
      usernames: userPreferences.followedAccounts,
      keywords: userPreferences.socialInterests
    }
  })

  // Monitor networking events
  await mcpClients.linkedin.callTool({
    name: 'monitor_professional_networks', 
    arguments: {
      companies: userPreferences.companiesOfInterest,
      industries: userPreferences.industries
    }
  })

  // Monitor community events
  await mcpClients.meetup.callTool({
    name: 'monitor_group_activities',
    arguments: {
      groups: userPreferences.meetupGroups,
      notification_types: ['new_events', 'event_updates']
    }
  })
}

๐Ÿงช Testing Strategy

Comprehensive Test Suite

// Cross-platform integration tests
describe('MCP Server Integration', () => {
  test('all servers start successfully', async () => {
    const servers = await Promise.all([
      startEventbriteMCP(),
      startInstagramMCP(), 
      startLinkedInMCP(),
      startMeetupMCP()
    ])

    servers.forEach(server => {
      expect(server.status).toBe('running')
    })
  })

  test('unified event search works', async () => {
    const results = await searchAllPlatforms('tech conference', 'San Francisco')

    expect(results.total).toBeGreaterThan(0)
    expect(results.professional.length).toBeGreaterThan(0)
    expect(results.community.length).toBeGreaterThan(0)
  })

  test('AI analysis provides meaningful insights', async () => {
    const analysis = await analyzeEventLandscape('New York', ['technology', 'networking'])

    expect(analysis.insights).toBeDefined()
    expect(analysis.recommendations.length).toBeGreaterThan(0)
  })
})

Load Testing

# Test MCP server performance under load
npm run test:load -- --servers=all --concurrent=50 --duration=60s

๐Ÿ“ˆ Performance Optimization

Caching Hierarchy

graph TD
    A[Client Request] --> B{Memory Cache}
    B -->|Hit| C[Return Cached Data]
    B -->|Miss| D{Redis Cache}
    D -->|Hit| E[Update Memory & Return]
    D -->|Miss| F[MCP Server Call]
    F --> G[API/Scraping]
    G --> H[Cache in Redis & Memory]
    H --> I[Return Fresh Data]

Performance Metrics

// Monitor performance across all servers
interface PerformanceMetrics {
  eventbrite: {
    avgResponseTime: number
    successRate: number
    cacheHitRate: number
  }
  instagram: {
    avgResponseTime: number
    successRate: number
    scrapingSuccessRate: number
  }
  linkedin: {
    avgResponseTime: number
    successRate: number
    apiQuotaUsage: number
  }
  meetup: {
    avgResponseTime: number
    successRate: number
    communityAnalysisTime: number
  }
}

๐Ÿ”’ Security & Privacy

Data Protection

// Consistent data anonymization
interface PrivacyConfig {
  anonymizeUserData: boolean
  retentionPeriodDays: number
  encryptSensitiveData: boolean
  auditLogging: boolean
}

// GDPR compliance
function anonymizeEventData(event: any): any {
  return {
    ...event,
    attendees: event.attendees?.map(anonymizeUser),
    organizer: anonymizeUser(event.organizer),
    sensitiveFields: undefined
  }
}

Rate Limiting & Abuse Prevention

// Multi-layered rate limiting
const rateLimits = {
  perUser: { requests: 100, window: 3600000 },
  perIP: { requests: 1000, window: 3600000 },
  perServer: { requests: 10000, window: 3600000 }
}

๐Ÿš€ Deployment

Docker Configuration

# docker-compose.yml
version: '3.8'
services:
  inttrest-app:
    build: .
    ports:
      - "3000:3000"
    environment:
      - NODE_ENV=production
    depends_on:
      - redis
      - postgres

  eventbrite-mcp:
    build: ./mcp_servers/eventbrite-mcp
    environment:
      - EVENTBRITE_API_KEY=${EVENTBRITE_API_KEY}

  instagram-mcp:
    build: ./mcp_servers/instagram-server-next-mcp
    environment:
      - OPENAI_API_KEY=${OPENAI_API_KEY}

  linkedin-mcp:
    build: ./mcp_servers/linkedin-mcp-server
    environment:
      - LINKEDIN_CLIENT_ID=${LINKEDIN_CLIENT_ID}

  meetup-mcp:
    build: ./mcp_servers/mcp-meetup
    environment:
      - MEETUP_API_KEY=${MEETUP_API_KEY}

  redis:
    image: redis:7-alpine

  postgres:
    image: postgres:15-alpine
    environment:
      - POSTGRES_DB=inttrest

Production Monitoring

// Health checks for all MCP servers
async function healthCheck(): Promise<SystemHealth> {
  const checks = await Promise.allSettled([
    checkEventbriteHealth(),
    checkInstagramHealth(),
    checkLinkedInHealth(),
    checkMeetupHealth()
  ])

  return {
    overall: checks.every(check => check.status === 'fulfilled') ? 'healthy' : 'degraded',
    servers: {
      eventbrite: checks[0].status,
      instagram: checks[1].status,
      linkedin: checks[2].status,
      meetup: checks[3].status
    },
    timestamp: new Date().toISOString()
  }
}

๐Ÿ“š Additional Resources

This comprehensive MCP server ecosystem powers the Inttrest platform's AI-driven event discovery capabilities across multiple platforms! ๐Ÿš€