api-football-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@api-football-mcp-serverShow me the top scorers in the Premier League this season"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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: FPL MCP Server
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
This server cannot be deployed
Maintenance
Related MCP Connectors
Football fixtures, standings, and odds intelligence for AI agents.
API-Football MCP — comprehensive soccer/football data
Historical football results, teams, competitions and draw/streak statistics via 10 read-only tools.
- NFL MCPOAuthcom.nflmcp
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-
- AlicenseBqualityDmaintenanceEnables interaction with Fantasy Premier League data through natural language queries. Supports retrieving fixtures, league standings, player performance, and other FPL statistics via the official FPL API.1612 npm3MIT
- FlicenseNot gradedqualityDmaintenanceProvides tools to query football match data, odds, standings, and team statistics via natural language, integrating with the football-scraper-api.-
- AlicenseNot gradedqualityCmaintenanceEnables fetching football fixtures, match details, league tables, and squad information from the matchday app through natural language.6 npmMIT