The Soccer MCP Server provides a comprehensive interface to football (soccer) statistics and live match data using the API-Football service. It allows applications to access league standings, team information, player statistics, and real-time match data through a standardized Model Context Protocol implementation.
Clone the repository:
git clone https://github.com/obinopaul/soccer-mcp-server.git
cd soccer-mcp-server
Install dependencies:
pip install -r requirements.txt
Build the Docker image:
docker build -t soccer_server .
Run the Docker container:
docker run -d -p 5000:5000 -e RAPID_API_KEY_FOOTBALL=your_api_key_here --name soccer_server soccer_server
Clone the repository:
git clone https://github.com/obinopaul/soccer-mcp-server.git
cd soccer-mcp-server
Install dependencies:
pip install -r requirements.txt
Set the API key environment variable:
export RAPID_API_KEY_FOOTBALL=your_api_key_here
Start the server using one of these commands:
python soccer_server.py
# or
mcp run soccer-server.py
Add this to your claude_desktop_config.json
:
{
"mcpServers": {
"soccer_server": {
"command": "docker",
"args": [
"exec",
"-i",
"soccer_server",
"python",
"soccer_server.py"
],
"env": {
"RAPID_API_KEY_FOOTBALL": "your_api_key_here"
}
}
}
}
Add this to your claude_desktop_config.json
:
{
"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.
# Get a league ID by name
get_league_id_by_name(league_name="Premier League")
# Get all leagues (optionally filtered by country)
get_all_leagues_id(country=["England", "Spain"])
# Get detailed league information
get_league_info(league_name="Champions League")
# Get standings for multiple leagues and seasons
get_standings(league_id=[39, 140], season=[2022, 2023])
# Get all fixtures for a league and season
get_league_fixtures(league_id=39, season=2023)
# Get league schedule for specific dates
get_league_schedule_by_date(
league_name="Premier League",
date=["2024-03-08", "2024-03-09"],
season="2023"
)
# Find player IDs by name
get_player_id(player_name="Messi")
# Get a player's profile
get_player_profile(player_name="Messi")
# Get player statistics by 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
)
# Get basic team information
get_team_info(team_name="Real Madrid")
# Get past or upcoming fixtures
get_team_fixtures(
team_name="Manchester United",
type="past",
limit=3
)
# Get fixtures within a date range
get_team_fixtures_by_date_range(
team_name="Liverpool",
from_date="2023-09-01",
to_date="2023-09-30",
season="2023"
)
# Get detailed match statistics
get_fixture_statistics(fixture_id=867946)
# Get all match events (goals, cards, substitutions)
get_fixture_events(fixture_id=867946)
# Get statistics for multiple fixtures
get_multiple_fixtures_stats(fixture_ids=[867946, 867947, 867948])
# Check if a team is currently playing
get_live_match_for_team(team_name="Chelsea")
# Get live match statistics
get_live_stats_for_team(team_name="Liverpool")
# Get real-time match event timeline
get_live_match_timeline(team_name="Manchester City")
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "soccer_server" '{"command":"docker","args":["exec","-i","soccer_server","python","soccer_server.py"],"env":{"RAPID_API_KEY_FOOTBALL":"your_api_key_here"}}'
See the official Claude Code MCP documentation for more details.
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.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"soccer_server": {
"command": "docker",
"args": [
"exec",
"-i",
"soccer_server",
"python",
"soccer_server.py"
],
"env": {
"RAPID_API_KEY_FOOTBALL": "your_api_key_here"
}
}
}
}
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.
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 explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration file:
{
"mcpServers": {
"soccer_server": {
"command": "docker",
"args": [
"exec",
"-i",
"soccer_server",
"python",
"soccer_server.py"
],
"env": {
"RAPID_API_KEY_FOOTBALL": "your_api_key_here"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect