API-Football MCP server

Provides a bridge to API-Football for accessing soccer data including league standings, team fixtures, player statistics, and live match information through specialized tools that retrieve both historical and real-time data.
Back to servers
Provider
Obino Paul
Release date
Mar 20, 2025
Language
Python
Stats
3 stars

The Soccer MCP Server implements the Model Context Protocol for accessing football (soccer) statistics and live match data through the API-Football service. It serves as a bridge between your applications and comprehensive football data, offering everything from league standings to real-time match events.

Installation

Prerequisites

You'll need:

  • Python installed on your system
  • An API key from RapidAPI for the API-Football service

Getting an API Key

  1. Create an account on RapidAPI
  2. Subscribe to the API-Football API
  3. Copy your API key from the dashboard

Setup Options

Using Docker (Recommended)

  1. Clone the repository:

    git clone https://github.com/obinopaul/soccer-mcp-server.git
    cd soccer-mcp-server
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Build the Docker image:

    docker build -t soccer_server .
    
  4. Run the Docker container with your API key:

    docker run -d -p 5000:5000 -e RAPID_API_KEY_FOOTBALL=your_api_key_here --name soccer_server soccer_server
    

Direct Python Execution

  1. Clone the repository:

    git clone https://github.com/obinopaul/soccer-mcp-server.git
    cd soccer-mcp-server
    
  2. Install dependencies:

    pip install -r requirements.txt
    
  3. Set the API key environment variable:

    export RAPID_API_KEY_FOOTBALL=your_api_key_here
    

Usage

Starting the Server

Run the server using one of these commands:

python soccer_server.py
# or
mcp run soccer-server.py

Integrating with Claude Desktop

To use the server with Claude Desktop, add one of these configurations to your claude_desktop_config.json file:

For Docker setup:

{
  "mcpServers": {
    "soccer_server": {
      "command": "docker",
      "args": [
        "exec",
        "-i",
        "soccer_server",
        "python",
        "soccer_server.py"
      ],
      "env": {
        "RAPID_API_KEY_FOOTBALL": "your_api_key_here"
      }
    }
  }
}

For direct Python execution:

{
  "mcpServers": {
    "soccer_server": {
      "command": "/path/to/your/python",
      "args": [
        "/path/to/soccer_server.py"
      ],
      "env": {
        "RAPID_API_KEY_FOOTBALL": "your_api_key_here"
      }
    }
  }
}

After adding your configuration, restart Claude Desktop to load the soccer server.

Available Tools

League Data Tools

  • Get league ID by name:

    get_league_id_by_name(league_name="Premier League")
    
  • Get all leagues with IDs:

    get_all_leagues_id(country=["England", "Spain"])
    
  • Get league standings:

    get_standings(league_id=[39, 140], season=[2022, 2023])
    
  • Get league information:

    get_league_info(league_name="Champions League")
    
  • Get league fixtures:

    get_league_fixtures(league_id=39, season=2023)
    
  • Get league schedule by date:

    get_league_schedule_by_date(league_name="Premier League", date=["2024-03-08", "2024-03-09"], season="2023")
    

Player Data Tools

  • Find player IDs:

    get_player_id(player_name="Messi")
    
  • Get player profile:

    get_player_profile(player_name="Messi")
    
  • Get player statistics by league name:

    get_player_statistics(player_id=154, seasons=[2022, 2023], league_name="La Liga")
    
  • Get player statistics by league ID:

    get_player_statistics_2(player_id=154, seasons=[2022, 2023], league_id=140)
    

Team Data Tools

  • Get team fixtures:

    get_team_fixtures(team_name="Manchester United", type="past", limit=3)
    
  • Get team fixtures by date range:

    get_team_fixtures_by_date_range(team_name="Liverpool", from_date="2023-09-01", to_date="2023-09-30", season="2023")
    
  • Get team information:

    get_team_info(team_name="Real Madrid")
    

Match Data Tools

  • Get fixture statistics:

    get_fixture_statistics(fixture_id=867946)
    
  • Get fixture events:

    get_fixture_events(fixture_id=867946)
    
  • Get multiple fixtures statistics:

    get_multiple_fixtures_stats(fixture_ids=[867946, 867947, 867948])
    

Live Match Tools

  • Check if a team is playing live:

    get_live_match_for_team(team_name="Chelsea")
    
  • Get live match statistics:

    get_live_stats_for_team(team_name="Liverpool")
    
  • Get live match timeline:

    get_live_match_timeline(team_name="Manchester City")
    

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later