sipap-intelligence-mcp

sipap-intelligence-mcp

AI-powered MCP server for sports predictions providing news sentiment analysis, injury impact assessment, and weather intelligence using Claude (Bedrock) and OpenWeatherMap.

Category
Visit Server

README

sipap-intelligence-mcp

AI-Powered Intelligence MCP Server for SIPAP - News sentiment analysis, injury impact assessment, and weather intelligence using Claude (Bedrock) and OpenWeatherMap.

Overview

This MCP server provides AI-powered intelligence tools that enhance sports predictions with:

  • News Sentiment Analysis: Claude-powered analysis of recent news for teams
  • Injury Impact Assessment: AI-driven evaluation of injury impact on performance
  • Weather Intelligence: Real-time weather forecasts and AI-assessed impact on matches
  • Historical Weather Performance: Team performance patterns in specific weather conditions

Architecture

Unlike sipap-data-mcp (database reads only), this MCP server:

  • Makes on-demand API calls (OpenWeatherMap, NewsAPI)
  • Uses Claude via AWS Bedrock for AI analysis
  • Has higher latency (<2s vs <100ms) due to AI processing
  • Implements aggressive caching (6h-24h TTL) to minimize API costs

Tools

Weather Tools (3 tools)

  1. get_match_weather(match_id: str)

    • Fetches weather forecast for match time and location
    • Source: OpenWeatherMap API
    • Returns: Temperature, precipitation, wind, visibility
    • Cache TTL: 1 hour
  2. assess_weather_impact(weather_conditions: dict, match_type: str)

    • AI analysis of weather impact on match outcome
    • Uses: Claude via Bedrock
    • Returns: Impact level, factors, betting implications
    • Cache TTL: 6 hours
  3. get_historical_weather_performance(team_id: str, weather_type: str)

    • Analyzes team's historical performance in specific weather
    • Uses: Aurora database + Claude analysis
    • Returns: Performance insights, statistical patterns
    • Cache TTL: 24 hours

News Tools (2 tools)

  1. analyze_team_news(team_id: str, days_back: int)

    • Sentiment analysis of recent news headlines
    • Uses: NewsAPI + Claude
    • Returns: Sentiment score, key topics, impact assessment
    • Cache TTL: 6 hours
  2. get_injury_reports(team_id: str, severity_filter: str)

    • Injury reports with AI-powered impact assessment
    • Uses: Database + Claude
    • Returns: Injuries with AI-assessed impact scores
    • Cache TTL: 24 hours

Installation

# Install from wheel
pip install sipap_intelligence_mcp-0.1.0-py3-none-any.whl

# Or install in editable mode for development
cd sipap-intelligence-mcp
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'

Requirements

  • Python 3.12+
  • AWS credentials with Bedrock access
  • OpenWeatherMap API key (free tier: 60 calls/min)
  • sipap-common >= 0.1.0
  • sipap-serverlesshandler-mcp >= 0.1.0

Usage

Direct Tool Usage

from sipap_intelligence_mcp.tools.weather import get_match_weather, assess_weather_impact

# Get weather forecast for match
weather = await get_match_weather(match_id="match-123")
# Returns: {
#     'temperature': 15.2,
#     'precipitation': 'light_rain',
#     'wind_speed': 12.5,
#     'visibility': 8000
# }

# Assess impact on match
impact = await assess_weather_impact(weather, match_type="soccer")
# Returns: {
#     'impact_level': 'medium',
#     'factors': ['Light rain favors defensive play', 'Wind affects long passes'],
#     'betting_implications': 'Consider under 2.5 goals',
#     'confidence': 0.78
# }

MCP Protocol Usage (JSON-RPC 2.0)

from sipap_intelligence_mcp.server import get_mcp_server

# Initialize MCP server
server = get_mcp_server()

# List available tools
request = {
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/list"
}
response = await server.handle_request(request)
# Returns list of 5 tools

# Call a tool
request = {
    "jsonrpc": "2.0",
    "id": 2,
    "method": "tools/call",
    "params": {
        "name": "get_match_weather",
        "arguments": {
            "match_id": "match-123"
        }
    }
}
response = await server.handle_request(request)

Configuration

Environment Variables

# AWS Bedrock (required for AI analysis)
AWS_REGION=us-east-1
BEDROCK_MODEL_ID=anthropic.claude-3-haiku-20240307-v1:0

# OpenWeatherMap API (required for weather)
OPENWEATHER_API_KEY=your_api_key_here

# NewsAPI (optional, for news sentiment)
NEWS_API_KEY=your_api_key_here

# Redis cache (required)
REDIS_ENDPOINT=sipap-dev-cache.cache.amazonaws.com:6379

# Database (required for historical analysis)
DB_ENDPOINT=sipap-dev-aurora.cluster-xxx.us-east-1.rds.amazonaws.com
DB_NAME=sipap_dev
DB_USER=sipap_admin
DB_PASSWORD=stored_in_secrets_manager

Testing

# Run all tests
pytest

# Run with coverage
pytest --cov=src/sipap_intelligence_mcp --cov-report=html

# Run type checking
mypy src/sipap_intelligence_mcp --strict

# Run linting
ruff check src/ tests/

# Run all quality gates
pytest && mypy src/sipap_intelligence_mcp --strict && ruff check src/ tests/

Performance

  • Latency: <2s average (AI processing overhead)
  • Cache Hit Rate: 85%+ target (weather/news change infrequently)
  • Cost: ~$10/month (Claude analysis + API calls)
  • Rate Limits:
    • OpenWeatherMap: 60 calls/min (free tier)
    • NewsAPI: 100 requests/day (free tier)
    • Claude/Bedrock: Pay-as-you-go (~$0.01 per analysis)

Architecture Patterns

Sentinel Pattern Adoption

  • Pattern #9: Structured output enforcement (JSON Schema for AI responses)
  • Pattern #19: Lambda warm start optimization (global variables for API clients)
  • Pattern #20: Cache-aside with TTL strategy (6h-24h based on volatility)

AI Integration

  • Claude Haiku: Fast, cost-effective for simple analyses (<$0.003 per call)
  • Claude Sonnet: Complex reasoning for injury impact (<$0.015 per call)
  • Prompt Engineering: Sport-specific prompts optimized for accuracy
  • Structured Output: Force JSON schema to eliminate parsing errors

Examples

See examples/ directory for:

  1. weather_analysis.py - Weather forecast + impact assessment
  2. news_sentiment.py - News sentiment analysis for teams
  3. injury_impact.py - Injury report with AI assessment
  4. mcp_client.py - Full MCP protocol usage example

Development

# Setup development environment
python -m venv .venv
source .venv/bin/activate
pip install -e '.[dev]'

# Run quality gates before committing
pytest && mypy src/sipap_intelligence_mcp --strict && ruff check src/ tests/

License

MIT License - See LICENSE file for details

Support

For issues or questions: charles@sipap.com

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured