fpl-mcp-server 0.1.5__tar.gz → 0.1.7__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/.github/workflows/publish-docker.yml +2 -0
- fpl_mcp_server-0.1.7/.pre-commit-config.yaml +15 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/CONTRIBUTING.md +18 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/Dockerfile +2 -1
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/PKG-INFO +67 -58
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/README.md +66 -57
- fpl_mcp_server-0.1.7/docs/configuration.md +146 -0
- fpl_mcp_server-0.1.7/docs/fpl-api-swagger.json +1004 -0
- fpl_mcp_server-0.1.7/docs/installation.md +185 -0
- fpl_mcp_server-0.1.7/docs/releasing.md +159 -0
- fpl_mcp_server-0.1.7/docs/tool-selection-guide.md +132 -0
- fpl_mcp_server-0.1.7/docs/usage-examples.md +37 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/pyproject.toml +1 -1
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/client.py +31 -14
- fpl_mcp_server-0.1.7/src/constants.py +34 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/models.py +15 -30
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/prompts/__init__.py +2 -0
- fpl_mcp_server-0.1.7/src/prompts/captain_recommendation.py +149 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/prompts/league_analysis.py +12 -5
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/prompts/player_analysis.py +2 -3
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/prompts/squad_analysis.py +1 -1
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/prompts/team_analysis.py +2 -1
- fpl_mcp_server-0.1.7/src/prompts/team_selection.py +105 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/prompts/transfers.py +4 -3
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/resources/bootstrap.py +7 -1
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/state.py +10 -4
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/tools/__init__.py +0 -2
- fpl_mcp_server-0.1.7/src/tools/fixtures.py +342 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/tools/gameweeks.py +0 -198
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/tools/leagues.py +365 -14
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/tools/players.py +256 -295
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/tools/teams.py +1 -189
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/tools/transfers.py +248 -126
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/conftest.py +62 -7
- fpl_mcp_server-0.1.7/tests/test_tools_advanced.py +341 -0
- fpl_mcp_server-0.1.7/tests/test_tools_coverage.py +126 -0
- fpl_mcp_server-0.1.7/tests/test_tools_coverage_extra.py +119 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_tools_integration.py +82 -213
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/uv.lock +1 -1
- fpl_mcp_server-0.1.5/src/constants.py +0 -118
- fpl_mcp_server-0.1.5/src/tools/fixtures.py +0 -162
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/.dockerignore +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/.env.example +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/.github/workflows/lint.yml +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/.github/workflows/publish-pypi.yml +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/.github/workflows/test.yml +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/.gitignore +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/LICENSE +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/docs/fpl-api.md +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/pytest.ini +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/cache.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/config.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/exceptions.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/formatting.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/main.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/prompts/chips.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/rate_limiter.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/resources/__init__.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/utils.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/src/validators.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_cache.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_client.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_client_advanced.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_exceptions.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_formatting.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_models.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_rate_limiter.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_resources.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_state.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_state_advanced.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_utils.py +0 -0
- {fpl_mcp_server-0.1.5 → fpl_mcp_server-0.1.7}/tests/test_validators.py +0 -0
|
@@ -13,6 +13,7 @@ env:
|
|
|
13
13
|
|
|
14
14
|
jobs:
|
|
15
15
|
build-and-push:
|
|
16
|
+
name: Build and push Docker image
|
|
16
17
|
runs-on: ubuntu-latest
|
|
17
18
|
permissions:
|
|
18
19
|
contents: read
|
|
@@ -45,6 +46,7 @@ jobs:
|
|
|
45
46
|
type=semver,pattern={{major}}.{{minor}}
|
|
46
47
|
type=semver,pattern={{major}}
|
|
47
48
|
type=raw,value=latest,enable={{is_default_branch}}
|
|
49
|
+
type=sha,format=short
|
|
48
50
|
|
|
49
51
|
- name: Build and push Docker image
|
|
50
52
|
uses: docker/build-push-action@v6
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
repos:
|
|
2
|
+
- repo: https://github.com/pre-commit/pre-commit-hooks
|
|
3
|
+
rev: v6.0.0
|
|
4
|
+
hooks:
|
|
5
|
+
- id: check-yaml
|
|
6
|
+
- id: end-of-file-fixer
|
|
7
|
+
- id: trailing-whitespace
|
|
8
|
+
- repo: https://github.com/astral-sh/ruff-pre-commit
|
|
9
|
+
rev: v0.14.14
|
|
10
|
+
hooks:
|
|
11
|
+
# Run the linter.
|
|
12
|
+
- id: ruff
|
|
13
|
+
args: [--fix]
|
|
14
|
+
# Run the formatter.
|
|
15
|
+
- id: ruff-format
|
|
@@ -57,6 +57,24 @@ uv run ruff check --fix src tests
|
|
|
57
57
|
uv run ruff format src tests
|
|
58
58
|
```
|
|
59
59
|
|
|
60
|
+
### Pre-commit Hooks
|
|
61
|
+
|
|
62
|
+
We use `pre-commit` to verify code quality before committing changes.
|
|
63
|
+
|
|
64
|
+
Setup:
|
|
65
|
+
```bash
|
|
66
|
+
# Install pre-commit (if not already installed)
|
|
67
|
+
pip install pre-commit
|
|
68
|
+
|
|
69
|
+
# Install the git hooks
|
|
70
|
+
pre-commit install
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Now checks will run automatically on commit. To run them manually on all files:
|
|
74
|
+
```bash
|
|
75
|
+
pre-commit run --all-files
|
|
76
|
+
```
|
|
77
|
+
|
|
60
78
|
### Running Locally
|
|
61
79
|
|
|
62
80
|
```bash
|
|
@@ -31,7 +31,8 @@ LABEL maintainer="nguyenanhducs"
|
|
|
31
31
|
LABEL description="Fantasy Premier League MCP Server"
|
|
32
32
|
LABEL org.opencontainers.image.source="https://github.com/nguyenanhducs/fpl-mcp"
|
|
33
33
|
LABEL org.opencontainers.image.title="FPL MCP Server"
|
|
34
|
-
LABEL org.opencontainers.image.description="Fantasy Premier League
|
|
34
|
+
LABEL org.opencontainers.image.description="A comprehensive Model Context Protocol (MCP) server for Fantasy Premier League analysis and strategy. Provides AI assistants with powerful tools, resources, and prompts for data-driven FPL insights."
|
|
35
|
+
LABEL org.opencontainers.image.licenses="MIT"
|
|
35
36
|
|
|
36
37
|
WORKDIR /app
|
|
37
38
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fpl-mcp-server
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.7
|
|
4
4
|
Summary: Fantasy Premier League MCP Server
|
|
5
5
|
Project-URL: Homepage, https://github.com/nguyenanhducs/fpl-mcp
|
|
6
6
|
Project-URL: Repository, https://github.com/nguyenanhducs/fpl-mcp
|
|
@@ -29,81 +29,100 @@ Requires-Dist: pytest>=7.0.0; extra == 'dev'
|
|
|
29
29
|
Requires-Dist: ruff>=0.14.0; extra == 'dev'
|
|
30
30
|
Description-Content-Type: text/markdown
|
|
31
31
|
|
|
32
|
-
#
|
|
32
|
+
# Fantasy Premier League MCP Server
|
|
33
33
|
|
|
34
34
|
A comprehensive **Model Context Protocol (MCP)** server for Fantasy Premier League analysis and strategy. This server provides AI assistants with powerful tools, resources, and prompts to help you dominate your FPL mini-leagues with data-driven insights.
|
|
35
35
|
|
|
36
36
|
[](https://opensource.org/licenses/MIT)
|
|
37
|
-
[](https://www.python.org/downloads/)
|
|
38
38
|
[](https://modelcontextprotocol.io)
|
|
39
39
|
|
|
40
|
-
##
|
|
40
|
+
## Features
|
|
41
41
|
|
|
42
42
|
This MCP server provides comprehensive FPL analysis capabilities through:
|
|
43
43
|
|
|
44
|
-
- **
|
|
45
|
-
- **
|
|
46
|
-
- **
|
|
44
|
+
- **17 Interactive Tools** - Search players, analyze fixtures, compare managers, track transfers, and more
|
|
45
|
+
- **4 Data Resources** - access to players, teams, and gameweeks bootstrap data
|
|
46
|
+
- **8 Strategy Prompts** - Structured templates for squad analysis, transfer planning, chip strategy, and captain selection
|
|
47
47
|
- **Smart Caching** - 4-hour cache for bootstrap data to minimize API calls while keeping data fresh
|
|
48
48
|
- **Fuzzy Matching** - Find players even with spelling variations or nicknames
|
|
49
49
|
- **Live Transfer Trends** - Track the most transferred in/out players for current gameweek
|
|
50
50
|
- **Manager Insights** - Analyze squads, transfers, and chip usage (supports 2025/26 half-season system)
|
|
51
51
|
- **Fixture Analysis** - Assess team fixtures and plan transfers around favorable runs
|
|
52
52
|
|
|
53
|
-
##
|
|
53
|
+
## Quick Start
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
### Option 1: uvx (Recommended)
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
The fastest way to get started - no installation required:
|
|
58
58
|
|
|
59
59
|
```json
|
|
60
60
|
{
|
|
61
61
|
"mcpServers": {
|
|
62
62
|
"fpl": {
|
|
63
|
-
"command": "
|
|
64
|
-
"args": ["
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
"command": "uvx",
|
|
64
|
+
"args": ["fpl-mcp-server"],
|
|
65
|
+
"type": "stdio"
|
|
66
|
+
}
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
```
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
### Option 2: Docker
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
Use the official Docker image from GitHub Container Registry:
|
|
74
74
|
|
|
75
|
-
|
|
75
|
+
```json
|
|
76
|
+
{
|
|
77
|
+
"mcpServers": {
|
|
78
|
+
"fpl": {
|
|
79
|
+
"command": "docker",
|
|
80
|
+
"args": [
|
|
81
|
+
"run",
|
|
82
|
+
"--rm",
|
|
83
|
+
"-i",
|
|
84
|
+
"ghcr.io/nguyenanhducs/fpl-mcp:latest"
|
|
85
|
+
],
|
|
86
|
+
"type": "stdio"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
76
91
|
|
|
77
|
-
|
|
78
|
-
git clone https://github.com/nguyenanhducs/fpl-mcp.git
|
|
79
|
-
cd fpl-mcp
|
|
80
|
-
uv sync
|
|
81
|
-
```
|
|
92
|
+
### Option 3: From Source
|
|
82
93
|
|
|
83
|
-
|
|
94
|
+
For development or local customization:
|
|
84
95
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
"args": [
|
|
91
|
-
"--directory",
|
|
92
|
-
"/absolute/path/to/fpl-mcp",
|
|
93
|
-
"run",
|
|
94
|
-
"python",
|
|
95
|
-
"-m",
|
|
96
|
-
"src.main"
|
|
97
|
-
],
|
|
98
|
-
"type": "stdio"
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
```
|
|
96
|
+
```bash
|
|
97
|
+
git clone https://github.com/nguyenanhducs/fpl-mcp.git
|
|
98
|
+
cd fpl-mcp
|
|
99
|
+
uv sync
|
|
100
|
+
```
|
|
103
101
|
|
|
104
|
-
|
|
102
|
+
Then configure:
|
|
105
103
|
|
|
106
|
-
|
|
104
|
+
```json
|
|
105
|
+
{
|
|
106
|
+
"mcpServers": {
|
|
107
|
+
"fpl": {
|
|
108
|
+
"command": "uv",
|
|
109
|
+
"args": [
|
|
110
|
+
"--directory",
|
|
111
|
+
"/absolute/path/to/fpl-mcp",
|
|
112
|
+
"run",
|
|
113
|
+
"python",
|
|
114
|
+
"-m",
|
|
115
|
+
"src.main"
|
|
116
|
+
],
|
|
117
|
+
"type": "stdio"
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
For detailed installation instructions and more options, see **[Installation Guide](./docs/installation.md)**.
|
|
124
|
+
|
|
125
|
+
## Usage & Documentation
|
|
107
126
|
|
|
108
127
|
Once configured, you can interact with the FPL MCP server through Claude Desktop using natural language.
|
|
109
128
|
|
|
@@ -112,26 +131,16 @@ For detailed guidance, see:
|
|
|
112
131
|
- **[Usage Examples](./docs/usage-examples.md)** - Natural language query examples for player analysis, fixtures, leagues, and strategy
|
|
113
132
|
- **[Tool Selection Guide](./docs/tool-selection-guide.md)** - Choose the right tool for your analysis task
|
|
114
133
|
|
|
115
|
-
##
|
|
134
|
+
## Configuration
|
|
116
135
|
|
|
117
136
|
The server works out-of-the-box with sensible defaults, but you can customize cache durations, timeouts, and logging levels through environment variables.
|
|
118
137
|
|
|
119
138
|
For detailed configuration instructions for both Docker and uv deployments, see **[Configuration Guide](./docs/configuration.md)**.
|
|
120
139
|
|
|
121
|
-
##
|
|
140
|
+
## Data Sources
|
|
122
141
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
**Quick contribution checklist:**
|
|
126
|
-
|
|
127
|
-
- Fork the repository
|
|
128
|
-
- Create a feature branch
|
|
129
|
-
- Write tests for new features
|
|
130
|
-
- Ensure all tests pass
|
|
131
|
-
- Follow PEP 8 style guidelines
|
|
132
|
-
- Use conventional commit messages
|
|
133
|
-
- Submit a pull request
|
|
142
|
+
This server uses the official **Fantasy Premier League API**, see [here](./docs/fpl-api.md) for more details.
|
|
134
143
|
|
|
135
|
-
##
|
|
144
|
+
## Contributing
|
|
136
145
|
|
|
137
|
-
|
|
146
|
+
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
@@ -1,78 +1,97 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Fantasy Premier League MCP Server
|
|
2
2
|
|
|
3
3
|
A comprehensive **Model Context Protocol (MCP)** server for Fantasy Premier League analysis and strategy. This server provides AI assistants with powerful tools, resources, and prompts to help you dominate your FPL mini-leagues with data-driven insights.
|
|
4
4
|
|
|
5
5
|
[](https://opensource.org/licenses/MIT)
|
|
6
|
-
[](https://www.python.org/downloads/)
|
|
7
7
|
[](https://modelcontextprotocol.io)
|
|
8
8
|
|
|
9
|
-
##
|
|
9
|
+
## Features
|
|
10
10
|
|
|
11
11
|
This MCP server provides comprehensive FPL analysis capabilities through:
|
|
12
12
|
|
|
13
|
-
- **
|
|
14
|
-
- **
|
|
15
|
-
- **
|
|
13
|
+
- **17 Interactive Tools** - Search players, analyze fixtures, compare managers, track transfers, and more
|
|
14
|
+
- **4 Data Resources** - access to players, teams, and gameweeks bootstrap data
|
|
15
|
+
- **8 Strategy Prompts** - Structured templates for squad analysis, transfer planning, chip strategy, and captain selection
|
|
16
16
|
- **Smart Caching** - 4-hour cache for bootstrap data to minimize API calls while keeping data fresh
|
|
17
17
|
- **Fuzzy Matching** - Find players even with spelling variations or nicknames
|
|
18
18
|
- **Live Transfer Trends** - Track the most transferred in/out players for current gameweek
|
|
19
19
|
- **Manager Insights** - Analyze squads, transfers, and chip usage (supports 2025/26 half-season system)
|
|
20
20
|
- **Fixture Analysis** - Assess team fixtures and plan transfers around favorable runs
|
|
21
21
|
|
|
22
|
-
##
|
|
22
|
+
## Quick Start
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
### Option 1: uvx (Recommended)
|
|
25
25
|
|
|
26
|
-
|
|
26
|
+
The fastest way to get started - no installation required:
|
|
27
27
|
|
|
28
28
|
```json
|
|
29
29
|
{
|
|
30
30
|
"mcpServers": {
|
|
31
31
|
"fpl": {
|
|
32
|
-
"command": "
|
|
33
|
-
"args": ["
|
|
34
|
-
|
|
35
|
-
|
|
32
|
+
"command": "uvx",
|
|
33
|
+
"args": ["fpl-mcp-server"],
|
|
34
|
+
"type": "stdio"
|
|
35
|
+
}
|
|
36
36
|
}
|
|
37
37
|
}
|
|
38
38
|
```
|
|
39
39
|
|
|
40
|
-
|
|
40
|
+
### Option 2: Docker
|
|
41
41
|
|
|
42
|
-
|
|
42
|
+
Use the official Docker image from GitHub Container Registry:
|
|
43
43
|
|
|
44
|
-
|
|
44
|
+
```json
|
|
45
|
+
{
|
|
46
|
+
"mcpServers": {
|
|
47
|
+
"fpl": {
|
|
48
|
+
"command": "docker",
|
|
49
|
+
"args": [
|
|
50
|
+
"run",
|
|
51
|
+
"--rm",
|
|
52
|
+
"-i",
|
|
53
|
+
"ghcr.io/nguyenanhducs/fpl-mcp:latest"
|
|
54
|
+
],
|
|
55
|
+
"type": "stdio"
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
```
|
|
45
60
|
|
|
46
|
-
|
|
47
|
-
git clone https://github.com/nguyenanhducs/fpl-mcp.git
|
|
48
|
-
cd fpl-mcp
|
|
49
|
-
uv sync
|
|
50
|
-
```
|
|
61
|
+
### Option 3: From Source
|
|
51
62
|
|
|
52
|
-
|
|
63
|
+
For development or local customization:
|
|
53
64
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
"args": [
|
|
60
|
-
"--directory",
|
|
61
|
-
"/absolute/path/to/fpl-mcp",
|
|
62
|
-
"run",
|
|
63
|
-
"python",
|
|
64
|
-
"-m",
|
|
65
|
-
"src.main"
|
|
66
|
-
],
|
|
67
|
-
"type": "stdio"
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
```
|
|
65
|
+
```bash
|
|
66
|
+
git clone https://github.com/nguyenanhducs/fpl-mcp.git
|
|
67
|
+
cd fpl-mcp
|
|
68
|
+
uv sync
|
|
69
|
+
```
|
|
72
70
|
|
|
73
|
-
|
|
71
|
+
Then configure:
|
|
74
72
|
|
|
75
|
-
|
|
73
|
+
```json
|
|
74
|
+
{
|
|
75
|
+
"mcpServers": {
|
|
76
|
+
"fpl": {
|
|
77
|
+
"command": "uv",
|
|
78
|
+
"args": [
|
|
79
|
+
"--directory",
|
|
80
|
+
"/absolute/path/to/fpl-mcp",
|
|
81
|
+
"run",
|
|
82
|
+
"python",
|
|
83
|
+
"-m",
|
|
84
|
+
"src.main"
|
|
85
|
+
],
|
|
86
|
+
"type": "stdio"
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
For detailed installation instructions and more options, see **[Installation Guide](./docs/installation.md)**.
|
|
93
|
+
|
|
94
|
+
## Usage & Documentation
|
|
76
95
|
|
|
77
96
|
Once configured, you can interact with the FPL MCP server through Claude Desktop using natural language.
|
|
78
97
|
|
|
@@ -81,26 +100,16 @@ For detailed guidance, see:
|
|
|
81
100
|
- **[Usage Examples](./docs/usage-examples.md)** - Natural language query examples for player analysis, fixtures, leagues, and strategy
|
|
82
101
|
- **[Tool Selection Guide](./docs/tool-selection-guide.md)** - Choose the right tool for your analysis task
|
|
83
102
|
|
|
84
|
-
##
|
|
103
|
+
## Configuration
|
|
85
104
|
|
|
86
105
|
The server works out-of-the-box with sensible defaults, but you can customize cache durations, timeouts, and logging levels through environment variables.
|
|
87
106
|
|
|
88
107
|
For detailed configuration instructions for both Docker and uv deployments, see **[Configuration Guide](./docs/configuration.md)**.
|
|
89
108
|
|
|
90
|
-
##
|
|
109
|
+
## Data Sources
|
|
91
110
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
**Quick contribution checklist:**
|
|
95
|
-
|
|
96
|
-
- Fork the repository
|
|
97
|
-
- Create a feature branch
|
|
98
|
-
- Write tests for new features
|
|
99
|
-
- Ensure all tests pass
|
|
100
|
-
- Follow PEP 8 style guidelines
|
|
101
|
-
- Use conventional commit messages
|
|
102
|
-
- Submit a pull request
|
|
111
|
+
This server uses the official **Fantasy Premier League API**, see [here](./docs/fpl-api.md) for more details.
|
|
103
112
|
|
|
104
|
-
##
|
|
113
|
+
## Contributing
|
|
105
114
|
|
|
106
|
-
|
|
115
|
+
We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
# Configuration Guide
|
|
2
|
+
|
|
3
|
+
The FPL MCP Server supports configuration through environment variables. This guide covers how to customize settings for both Docker and uv deployment methods.
|
|
4
|
+
|
|
5
|
+
## Configuration Options
|
|
6
|
+
|
|
7
|
+
| Variable | Description | Default | Type |
|
|
8
|
+
| ---------------------------------- | --------------------------------------- | ----------------------------------- | ------- |
|
|
9
|
+
| `FPL_MCP_FPL_BASE_URL` | FPL API base URL | `https://fantasy.premierleague.com` | string |
|
|
10
|
+
| `FPL_MCP_FPL_API_TIMEOUT` | API request timeout (seconds) | `30` | integer |
|
|
11
|
+
| `FPL_MCP_BOOTSTRAP_CACHE_TTL` | Bootstrap data cache duration (seconds) | `14400` (4 hours) | integer |
|
|
12
|
+
| `FPL_MCP_FIXTURES_CACHE_TTL` | Fixtures cache duration (seconds) | `14400` (4 hours) | integer |
|
|
13
|
+
| `FPL_MCP_PLAYER_SUMMARY_CACHE_TTL` | Player summary cache duration (seconds) | `300` (5 minutes) | integer |
|
|
14
|
+
| `FPL_MCP_LOG_LEVEL` | Logging level | `INFO` | string |
|
|
15
|
+
|
|
16
|
+
### Log Levels
|
|
17
|
+
|
|
18
|
+
Available log levels (from least to most verbose):
|
|
19
|
+
|
|
20
|
+
- `CRITICAL` - Only critical errors
|
|
21
|
+
- `ERROR` - Errors and critical issues
|
|
22
|
+
- `WARNING` - Warnings, errors, and critical issues
|
|
23
|
+
- `INFO` - General information (recommended)
|
|
24
|
+
- `DEBUG` - Detailed debugging information
|
|
25
|
+
|
|
26
|
+
## Docker
|
|
27
|
+
|
|
28
|
+
When running the FPL MCP server with Docker, you can pass environment variables using the `-e` flag
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"mcpServers": {
|
|
33
|
+
"fpl": {
|
|
34
|
+
"command": "docker",
|
|
35
|
+
"args": [
|
|
36
|
+
"run",
|
|
37
|
+
"--rm",
|
|
38
|
+
"-i",
|
|
39
|
+
"-e",
|
|
40
|
+
"FPL_MCP_LOG_LEVEL=INFO",
|
|
41
|
+
"-e",
|
|
42
|
+
"FPL_MCP_BOOTSTRAP_CACHE_TTL=7200",
|
|
43
|
+
"-e",
|
|
44
|
+
"FPL_MCP_FIXTURES_CACHE_TTL=7200",
|
|
45
|
+
"nguyenanhducs/fpl-mcp:latest"
|
|
46
|
+
],
|
|
47
|
+
"type": "stdio"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
## UV
|
|
54
|
+
|
|
55
|
+
When running with `uv`, the server automatically loads environment variables from a `.env` file in the project root.
|
|
56
|
+
|
|
57
|
+
### Step 1: Create Environment File
|
|
58
|
+
|
|
59
|
+
Create a `.env` file in the project root directory:
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
cd /path/to/fpl-mcp
|
|
63
|
+
cp .env.example .env
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### Step 2: Edit Configuration
|
|
67
|
+
|
|
68
|
+
Edit the `.env` file with your preferred settings:
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
# FPL API Configuration
|
|
72
|
+
FPL_MCP_FPL_BASE_URL=https://fantasy.premierleague.com
|
|
73
|
+
FPL_MCP_FPL_API_TIMEOUT=30
|
|
74
|
+
|
|
75
|
+
# Cache Configuration (in seconds)
|
|
76
|
+
FPL_MCP_BOOTSTRAP_CACHE_TTL=14400 # 4 hours
|
|
77
|
+
FPL_MCP_FIXTURES_CACHE_TTL=14400 # 4 hours
|
|
78
|
+
FPL_MCP_PLAYER_SUMMARY_CACHE_TTL=300 # 5 minutes
|
|
79
|
+
|
|
80
|
+
# Logging Configuration
|
|
81
|
+
FPL_MCP_LOG_LEVEL=INFO
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### Step 3: Run the Server
|
|
85
|
+
|
|
86
|
+
The server will automatically load the `.env` file:
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
uv run python -m src.main
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
> [!TIP]
|
|
93
|
+
> The `.env` file is ignored by git, so your configuration won't be committed to version control.
|
|
94
|
+
|
|
95
|
+
## Common Configuration Scenarios
|
|
96
|
+
|
|
97
|
+
### Scenario 1: Development/Debugging
|
|
98
|
+
|
|
99
|
+
For debugging issues, increase logging verbosity:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
FPL_MCP_LOG_LEVEL=DEBUG
|
|
103
|
+
```
|
|
104
|
+
|
|
105
|
+
### Scenario 2: Reduce API Load
|
|
106
|
+
|
|
107
|
+
Increase cache durations to reduce API calls:
|
|
108
|
+
|
|
109
|
+
```bash
|
|
110
|
+
FPL_MCP_BOOTSTRAP_CACHE_TTL=28800 # 8 hours
|
|
111
|
+
FPL_MCP_FIXTURES_CACHE_TTL=28800 # 8 hours
|
|
112
|
+
FPL_MCP_PLAYER_SUMMARY_CACHE_TTL=600 # 10 minutes
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Scenario 3: Fresh Data Priority
|
|
116
|
+
|
|
117
|
+
Reduce cache durations for more up-to-date data (may increase API load):
|
|
118
|
+
|
|
119
|
+
```bash
|
|
120
|
+
FPL_MCP_BOOTSTRAP_CACHE_TTL=1800 # 30 minutes
|
|
121
|
+
FPL_MCP_FIXTURES_CACHE_TTL=1800 # 30 minutes
|
|
122
|
+
FPL_MCP_PLAYER_SUMMARY_CACHE_TTL=60 # 1 minute
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Scenario 4: Slow Network
|
|
126
|
+
|
|
127
|
+
Increase timeout for slower connections:
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
FPL_MCP_FPL_API_TIMEOUT=60 # 60 seconds
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Verifying Configuration
|
|
134
|
+
|
|
135
|
+
To verify your configuration is loaded correctly, check the server logs when it starts. With `FPL_MCP_LOG_LEVEL=DEBUG`, you'll see the loaded settings.
|
|
136
|
+
|
|
137
|
+
## Default Behavior
|
|
138
|
+
|
|
139
|
+
If no environment variables are set, the server uses sensible defaults:
|
|
140
|
+
|
|
141
|
+
- **4-hour cache** for bootstrap data and fixtures
|
|
142
|
+
- **5-minute cache** for player summaries
|
|
143
|
+
- **30-second timeout** for API requests
|
|
144
|
+
- **INFO-level logging** for general operation information
|
|
145
|
+
|
|
146
|
+
These defaults work well for most use cases and balance data freshness with API load.
|