api-football-mcp-server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
API-Football MCP Server
A Model Context Protocol (MCP) server that provides access to football/soccer data through the API-Football service. This creates a standardised way for language models to interact with this API, and users a way to query in natural language.

Architecture
graph TD
LLM["`**LLM with MCP Client**
Claude/GPT-4/etc.`"]
subgraph Server ["`**MCP Server**
Football Data Gateway`"]
direction TB
MCP["`**MCP Protocol Handler**
Request Router & Response Manager`"]
subgraph Functions ["`**Available Functions**`"]
direction LR
API1["`**get_leagues**
Fetch league data`"]
API2["`**get_teams**
Fetch team data`"]
API3["`**get_players**
Fetch player data`"]
API4["`**get_fixtures**
Fetch match data`"]
end
MCP --> Functions
end
ExtAPI["`**API-Football**
External Sports Data API`"]
%% Main connections
LLM <===> MCP
%% Function connections to external API
API1 <--> ExtAPI
API2 <--> ExtAPI
API3 <--> ExtAPI
API4 <--> ExtAPI
%% Styling with improved colors
classDef llm fill:#4CAF50,stroke:#2E7D32,stroke-width:3px,color:#fff
classDef mcp fill:#2196F3,stroke:#1565C0,stroke-width:2px,color:#fff
classDef functions fill:#FF9800,stroke:#F57C00,stroke-width:2px,color:#fff
classDef external fill:#9C27B0,stroke:#6A1B9A,stroke-width:3px,color:#fff
classDef server fill:#E3F2FD,stroke:#1976D2,stroke-width:2px,color:#1976D2
class LLM llm
class MCP mcp
class API1,API2,API3,API4 functions
class ExtAPI external
class Server serverRelated MCP server: football-scraper-mcp
1. Clone and Setup
Clone the repository:
git clone https://github.com/danknight/api-football-mcp-server.git
cd api-football-mcp-serverInstall dependencies:
pip install -r requirements.txt2. Get Your API Key and Set Environment
Create a .env file with your credentials:
API_FOOTBALL_KEY=your_api_key_hereSign up on API-Football to get an API key.
3. Configure MCP Client
Register this server in your MCP client (e.g. Cursor, Claude for Desktop).
{
"mcpServers": {
"api-football": {
"command": "python",
"args": ["absolute/path/to/server.py"],
"env": {
"API_FOOTBALL_KEY": "YOUR_API_KEY"
}
}
}
}
Or run directly from the command line and explore with Inspector:
python server.pyTools
The following tools are exposed to MCP clients:
League Information
Tool Name | Description | Parameters |
| Get available leagues |
|
| Get detailed league information |
|
| Get available countries | None |
| Get league standings |
|
Team Information
Tool Name | Description | Parameters |
| Get teams in a league |
|
| Get statistics for a team |
|
| Get team ID by team name |
|
| Get transfer information for a team |
|
Player Information
Tool Name | Description | Parameters |
| Get players in a team |
|
| Get statistics for a player |
|
Match/Fixture Information
Tool Name | Description | Parameters |
| Get fixtures/matches |
|
| Get statistics for a fixture |
|
| Get predictions for a fixture |
|
| Get head-to-head statistics between teams |
|
Player Statistics
Tool Name | Description | Parameters |
| Get top scorers in a league |
|
| Get top assisters in a league |
|
Other Information
Tool Name | Description | Parameters |
| Get venue information |
|
| Get injury information |
|
Usage Examples
Get leagues in a specific country
get_leagues(country="England")Get teams in a specific league
get_teams(league_id=39, season=2023) # Premier League 2023Get team statistics
get_team_stats(team_id=42, league_id=39, season=2023) # Arsenal statsGet fixtures for a team
get_fixtures(team_id=42, next=5) # Next 5 Arsenal matchesGet top scorers in a league
get_top_scorers(league_id=39, season=2023) # Premier League top scorersDevelopment
Running Tests
Currently, no tests are implemented. To add tests:
Create a
tests/directoryAdd test files following the naming convention
test_*.pyRun tests with
python -m pytest
Adding New Tools
To add a new tool:
Add a new function in
main.pydecorated with@mcp.tool()Implement the API call using
make_api_request()Update this README with the new tool information
Test the tool with the MCP Inspector
Related MCP Connectors
Football fixtures, standings, and odds intelligence for AI agents.
API-Football MCP — comprehensive soccer/football data
Historical football results, draws and no-draw streaks. 11 read-only tools, 6 need no API key.
NFL analytics tools for AI agents: stats, fantasy, injuries, schedules, and advanced analysis.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceProvides programmatic access to comprehensive football statistics and live match data via API-Football, enabling applications to retrieve league standings, team fixtures, player statistics, and real-time match events.6-
- FlicenseNot gradedqualityDmaintenanceProvides tools to query football match data, odds, standings, and team statistics via natural language, integrating with the football-scraper-api.-
- AlicenseNot gradedqualityDmaintenanceEnables fetching football fixtures, match details, league tables, and squad information from the matchday app through natural language.6 npmMIT
- AlicenseNot gradedqualityBmaintenanceProvides comprehensive soccer/football data including standings, team search, league search, match predictions, and head-to-head records via the API-Football service.301 npmMIT