fpl-mcp-server 0.1.3__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.
Files changed (57) hide show
  1. fpl_mcp_server-0.1.3/.dockerignore +45 -0
  2. fpl_mcp_server-0.1.3/.env.example +15 -0
  3. fpl_mcp_server-0.1.3/.github/workflows/lint.yml +44 -0
  4. fpl_mcp_server-0.1.3/.github/workflows/publish-pypi.yml +41 -0
  5. fpl_mcp_server-0.1.3/.github/workflows/test.yml +42 -0
  6. fpl_mcp_server-0.1.3/.gitignore +35 -0
  7. fpl_mcp_server-0.1.3/CONTRIBUTING.md +131 -0
  8. fpl_mcp_server-0.1.3/Dockerfile +56 -0
  9. fpl_mcp_server-0.1.3/LICENSE +21 -0
  10. fpl_mcp_server-0.1.3/PKG-INFO +137 -0
  11. fpl_mcp_server-0.1.3/README.md +106 -0
  12. fpl_mcp_server-0.1.3/docs/fpl-api.md +39 -0
  13. fpl_mcp_server-0.1.3/pyproject.toml +105 -0
  14. fpl_mcp_server-0.1.3/pytest.ini +17 -0
  15. fpl_mcp_server-0.1.3/src/cache.py +162 -0
  16. fpl_mcp_server-0.1.3/src/client.py +273 -0
  17. fpl_mcp_server-0.1.3/src/config.py +33 -0
  18. fpl_mcp_server-0.1.3/src/constants.py +118 -0
  19. fpl_mcp_server-0.1.3/src/exceptions.py +114 -0
  20. fpl_mcp_server-0.1.3/src/formatting.py +299 -0
  21. fpl_mcp_server-0.1.3/src/main.py +41 -0
  22. fpl_mcp_server-0.1.3/src/models.py +526 -0
  23. fpl_mcp_server-0.1.3/src/prompts/__init__.py +18 -0
  24. fpl_mcp_server-0.1.3/src/prompts/chips.py +127 -0
  25. fpl_mcp_server-0.1.3/src/prompts/league_analysis.py +250 -0
  26. fpl_mcp_server-0.1.3/src/prompts/player_analysis.py +141 -0
  27. fpl_mcp_server-0.1.3/src/prompts/squad_analysis.py +136 -0
  28. fpl_mcp_server-0.1.3/src/prompts/team_analysis.py +121 -0
  29. fpl_mcp_server-0.1.3/src/prompts/transfers.py +167 -0
  30. fpl_mcp_server-0.1.3/src/rate_limiter.py +101 -0
  31. fpl_mcp_server-0.1.3/src/resources/__init__.py +13 -0
  32. fpl_mcp_server-0.1.3/src/resources/bootstrap.py +183 -0
  33. fpl_mcp_server-0.1.3/src/state.py +443 -0
  34. fpl_mcp_server-0.1.3/src/tools/__init__.py +25 -0
  35. fpl_mcp_server-0.1.3/src/tools/fixtures.py +162 -0
  36. fpl_mcp_server-0.1.3/src/tools/gameweeks.py +392 -0
  37. fpl_mcp_server-0.1.3/src/tools/leagues.py +590 -0
  38. fpl_mcp_server-0.1.3/src/tools/players.py +840 -0
  39. fpl_mcp_server-0.1.3/src/tools/teams.py +397 -0
  40. fpl_mcp_server-0.1.3/src/tools/transfers.py +629 -0
  41. fpl_mcp_server-0.1.3/src/utils.py +226 -0
  42. fpl_mcp_server-0.1.3/src/validators.py +290 -0
  43. fpl_mcp_server-0.1.3/tests/conftest.py +473 -0
  44. fpl_mcp_server-0.1.3/tests/test_cache.py +225 -0
  45. fpl_mcp_server-0.1.3/tests/test_client.py +353 -0
  46. fpl_mcp_server-0.1.3/tests/test_client_advanced.py +359 -0
  47. fpl_mcp_server-0.1.3/tests/test_exceptions.py +322 -0
  48. fpl_mcp_server-0.1.3/tests/test_formatting.py +428 -0
  49. fpl_mcp_server-0.1.3/tests/test_models.py +449 -0
  50. fpl_mcp_server-0.1.3/tests/test_rate_limiter.py +108 -0
  51. fpl_mcp_server-0.1.3/tests/test_resources.py +70 -0
  52. fpl_mcp_server-0.1.3/tests/test_state.py +212 -0
  53. fpl_mcp_server-0.1.3/tests/test_state_advanced.py +484 -0
  54. fpl_mcp_server-0.1.3/tests/test_tools_integration.py +652 -0
  55. fpl_mcp_server-0.1.3/tests/test_utils.py +413 -0
  56. fpl_mcp_server-0.1.3/tests/test_validators.py +200 -0
  57. fpl_mcp_server-0.1.3/uv.lock +758 -0
@@ -0,0 +1,45 @@
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ *.egg-info/
8
+ dist/
9
+ build/
10
+
11
+ # Virtual environments
12
+ .venv/
13
+ venv/
14
+ ENV/
15
+
16
+ # Testing
17
+ .coverage
18
+ htmlcov/
19
+ .pytest_cache/
20
+ coverage.xml
21
+
22
+ # IDE
23
+ .vscode/
24
+ .idea/
25
+ *.swp
26
+ *.swo
27
+
28
+ # Git
29
+ .git/
30
+ .gitignore
31
+
32
+ # Docs
33
+ docs/
34
+
35
+ # Tests
36
+ tests/
37
+
38
+ # CI/CD
39
+ .github/
40
+
41
+ # Other
42
+ CONTRIBUTING.md
43
+ .DS_Store
44
+ .env
45
+ .env.example
@@ -0,0 +1,15 @@
1
+ # FPL MCP Server Configuration
2
+ # Copy this file to .env and customize as needed
3
+
4
+ # FPL API Configuration
5
+ FPL_MCP_FPL_BASE_URL=https://fantasy.premierleague.com
6
+ FPL_MCP_FPL_API_TIMEOUT=30
7
+
8
+ # Cache Configuration (in seconds)
9
+ FPL_MCP_BOOTSTRAP_CACHE_TTL=14400 # 4 hours
10
+ FPL_MCP_FIXTURES_CACHE_TTL=14400 # 4 hours
11
+ FPL_MCP_PLAYER_SUMMARY_CACHE_TTL=300 # 5 minutes
12
+
13
+ # Logging Configuration
14
+ # Options: DEBUG, INFO, WARNING, ERROR, CRITICAL
15
+ FPL_MCP_LOG_LEVEL=INFO
@@ -0,0 +1,44 @@
1
+ name: Lint
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ paths-ignore:
8
+ - "*.md"
9
+
10
+ pull_request:
11
+ branches:
12
+ - main
13
+ paths-ignore:
14
+ - "*.md"
15
+
16
+ jobs:
17
+ lint:
18
+ runs-on: ubuntu-latest
19
+
20
+ steps:
21
+ - uses: actions/checkout@v6
22
+
23
+ - name: Set up Python
24
+ uses: actions/setup-python@v5
25
+ with:
26
+ python-version: "3.13"
27
+
28
+ - name: Install uv
29
+ uses: astral-sh/setup-uv@v7
30
+ with:
31
+ cache-dependency-glob: |
32
+ **/uv.lock
33
+
34
+ - name: Install dependencies
35
+ run: |
36
+ uv sync --locked --all-extras --dev
37
+
38
+ - name: Run ruff linter
39
+ run: |
40
+ uv run ruff check src tests
41
+
42
+ - name: Run ruff formatter check
43
+ run: |
44
+ uv run ruff format --check src tests
@@ -0,0 +1,41 @@
1
+ name: Publish to PyPI
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - "v*"
7
+
8
+ release:
9
+ types: [published]
10
+
11
+ workflow_dispatch:
12
+
13
+ jobs:
14
+ build-and-publish:
15
+ name: Build and publish to PyPI
16
+ runs-on: ubuntu-latest
17
+ environment:
18
+ name: pypi
19
+ url: https://pypi.org/p/fpl-mcp-server
20
+ permissions:
21
+ contents: read
22
+
23
+ steps:
24
+ - name: Checkout repository
25
+ uses: actions/checkout@v6
26
+
27
+ - name: Set up Python
28
+ uses: actions/setup-python@v6
29
+ with:
30
+ python-version: "3.13"
31
+
32
+ - name: Install uv
33
+ uses: astral-sh/setup-uv@v7
34
+
35
+ - name: Build package
36
+ run: uv build
37
+
38
+ - name: Publish to PyPI
39
+ env:
40
+ UV_PUBLISH_TOKEN: ${{ secrets.PYPI_API_TOKEN }}
41
+ run: uv publish dist/*
@@ -0,0 +1,42 @@
1
+ name: Tests
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ paths-ignore:
8
+ - "*.md"
9
+
10
+ pull_request:
11
+ branches:
12
+ - main
13
+ paths-ignore:
14
+ - "*.md"
15
+
16
+ jobs:
17
+ test:
18
+ runs-on: ${{ matrix.os }}
19
+ strategy:
20
+ fail-fast: false
21
+ matrix:
22
+ os: [ubuntu-latest]
23
+ python-version: ["3.13"]
24
+
25
+ steps:
26
+ - uses: actions/checkout@v6
27
+
28
+ - name: Set up Python ${{ matrix.python-version }}
29
+ uses: actions/setup-python@v5
30
+ with:
31
+ python-version: ${{ matrix.python-version }}
32
+
33
+ - name: Install uv
34
+ uses: astral-sh/setup-uv@v7
35
+
36
+ - name: Install dependencies
37
+ run: |
38
+ uv sync --locked --extra dev
39
+
40
+ - name: Run tests with pytest
41
+ run: |
42
+ uv run pytest
@@ -0,0 +1,35 @@
1
+ __pycache__
2
+ *.py[cod]
3
+ *.pyo
4
+ *.pyd
5
+ *.db
6
+ *.sqlite
7
+ *.log
8
+ *.pot
9
+ *.pyc
10
+ *.pdb
11
+ *.egg-info/
12
+ dist/
13
+ build/
14
+ .DS_Store
15
+
16
+ # Environment files
17
+ .env
18
+ .env.*
19
+ !.env.example
20
+
21
+ # Test artifacts
22
+ .pytest_cache/
23
+ .coverage
24
+ coverage.xml
25
+ htmlcov/
26
+ *.png
27
+ *.jpg
28
+
29
+ # Virtual environment
30
+ .venv/
31
+ venv/
32
+
33
+ # AIs
34
+ .claude
35
+ .agent
@@ -0,0 +1,131 @@
1
+ # Contributing to FPL MCP Server
2
+
3
+ Thank you for considering contributing to the FPL MCP Server! This document provides guidelines and instructions for contributing.
4
+
5
+ ## Getting Started
6
+
7
+ ### Prerequisites
8
+
9
+ - Python 3.13 or higher
10
+ - `uv` package manager ([installation instructions](https://github.com/astral-sh/uv))
11
+
12
+ ### Development Setup
13
+
14
+ 1. **Fork and Clone**
15
+
16
+ ```bash
17
+ git clone https://github.com/nguyenanhducs/fpl-mcp.git
18
+ cd fpl-mcp
19
+ ```
20
+
21
+ 2. **Install Dependencies**
22
+
23
+ ```bash
24
+ uv sync --extra dev
25
+ ```
26
+
27
+ ## Development Workflow
28
+
29
+ ### Running Tests
30
+
31
+ ```bash
32
+ # Run all tests
33
+ uv run pytest
34
+
35
+ # Run with coverage
36
+ uv run pytest --cov=src --cov-report=html
37
+
38
+ # Run specific test file
39
+ uv run pytest tests/test_state.py
40
+
41
+ # Run only unit tests
42
+ uv run pytest -m unit
43
+ ```
44
+
45
+ ### Code Quality
46
+
47
+ **Linting and Formatting:**
48
+
49
+ ```bash
50
+ # Run ruff linter
51
+ uv run ruff check src tests
52
+
53
+ # Auto-fix issues
54
+ uv run ruff check --fix src tests
55
+
56
+ # Format code
57
+ uv run ruff format src tests
58
+ ```
59
+
60
+ ### Running Locally
61
+
62
+ ```bash
63
+ # Start the server (it will wait for MCP protocol messages on stdin)
64
+ uv run python -m src.main
65
+
66
+ # You should see:
67
+ # Starting FPL MCP Server...
68
+ # Imports successful. Initializing MCP server...
69
+ # Starting MCP Server (Stdio)...
70
+ #
71
+ # This means it's working! The server is now listening for MCP messages.
72
+ # Press Ctrl+C to stop it.
73
+ ```
74
+
75
+ **To actually use the server**, configure it in Claude Desktop (see README.md) or use the [MCP Inspector](https://github.com/modelcontextprotocol/inspector) for debugging:
76
+
77
+ ```bash
78
+ # Install MCP Inspector
79
+ npx @modelcontextprotocol/inspector uv --directory <path-to-repo> run python -m src.main
80
+ ```
81
+
82
+ ## Code Style Guidelines
83
+
84
+ ### Python Style
85
+
86
+ - Follow PEP 8
87
+ - Use type hints for all function parameters and return values
88
+ - Maximum line length: 100 characters
89
+ - Use meaningful variable and function names
90
+
91
+ ### Documentation
92
+
93
+ - Add docstrings to all public functions and classes
94
+ - Use Google-style docstrings
95
+ - Include examples in docstrings for complex functions
96
+
97
+ ### Testing
98
+
99
+ - Write tests for all new features
100
+ - Maintain >80% code coverage
101
+ - Use descriptive test names
102
+ - Group related tests in classes
103
+
104
+ ## Reporting Bugs
105
+
106
+ When reporting bugs, please include:
107
+
108
+ - Python version
109
+ - Operating system
110
+ - Steps to reproduce
111
+ - Expected vs actual behavior
112
+ - Relevant logs or error messages
113
+
114
+ ## Feature Requests
115
+
116
+ For feature requests:
117
+
118
+ - Describe the use case
119
+ - Explain why it would be useful
120
+ - Suggest possible implementation (optional)
121
+
122
+ ## Questions?
123
+
124
+ - Check existing issues and discussions
125
+ - Create a new issue with the `question` label
126
+
127
+ ## License
128
+
129
+ By contributing, you agree that your contributions will be licensed under the same license as the project.
130
+
131
+ Thank you for contributing! 🎉
@@ -0,0 +1,56 @@
1
+ # ============================================
2
+ # Builder Stage: Install dependencies with uv
3
+ # ============================================
4
+ FROM ghcr.io/astral-sh/uv:python3.13-alpine AS builder
5
+
6
+ WORKDIR /app
7
+
8
+ # Enable bytecode compilation
9
+ ENV UV_COMPILE_BYTECODE=1
10
+
11
+ # Copy from cache instead of linking
12
+ ENV UV_LINK_MODE=copy
13
+
14
+ # Copy dependency files
15
+ COPY pyproject.toml uv.lock README.md ./
16
+
17
+ # Install dependencies to /app/.venv
18
+ RUN --mount=type=cache,target=/root/.cache/uv \
19
+ uv sync --frozen --no-dev
20
+
21
+ # Copy application code
22
+ COPY src ./src
23
+
24
+ # ============================================
25
+ # Runtime Stage: Minimal Python runtime
26
+ # ============================================
27
+ FROM python:3.13-alpine AS runtime
28
+
29
+ # Metadata labels
30
+ LABEL maintainer="nguyenanhducs"
31
+ LABEL description="Fantasy Premier League MCP Server"
32
+ LABEL org.opencontainers.image.source="https://github.com/nguyenanhducs/fpl-mcp"
33
+ LABEL org.opencontainers.image.title="FPL MCP Server"
34
+ LABEL org.opencontainers.image.description="Fantasy Premier League Model Context Protocol Server"
35
+
36
+ WORKDIR /app
37
+
38
+ # Create non-root user for security
39
+ RUN addgroup -g 1000 fplmcp && \
40
+ adduser -D -u 1000 -G fplmcp fplmcp
41
+
42
+ # Copy virtual environment and source code from builder
43
+ COPY --from=builder --chown=fplmcp:fplmcp /app/.venv /app/.venv
44
+ COPY --from=builder --chown=fplmcp:fplmcp /app/src /app/src
45
+
46
+ # Switch to non-root user
47
+ USER fplmcp
48
+
49
+ # Set Python to unbuffered mode for proper stdio
50
+ ENV PYTHONUNBUFFERED=1
51
+
52
+ # Add .venv/bin to PATH
53
+ ENV PATH="/app/.venv/bin:$PATH"
54
+
55
+ # Run with stdio transport (default)
56
+ CMD ["python", "-m", "src.main"]
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Anh Duc Nguyen
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,137 @@
1
+ Metadata-Version: 2.4
2
+ Name: fpl-mcp-server
3
+ Version: 0.1.3
4
+ Summary: Fantasy Premier League MCP Server
5
+ Project-URL: Homepage, https://github.com/nguyenanhducs/fpl-mcp
6
+ Project-URL: Repository, https://github.com/nguyenanhducs/fpl-mcp
7
+ Project-URL: Issues, https://github.com/nguyenanhducs/fpl-mcp/issues
8
+ Project-URL: Documentation, https://github.com/nguyenanhducs/fpl-mcp#readme
9
+ Author: Anh Duc Nguyen
10
+ License-Expression: MIT
11
+ License-File: LICENSE
12
+ Keywords: fantasy-premier-league,fpl,mcp,model-context-protocol
13
+ Classifier: License :: OSI Approved :: MIT License
14
+ Classifier: Programming Language :: Python :: 3
15
+ Classifier: Programming Language :: Python :: 3.13
16
+ Classifier: Topic :: Games/Entertainment :: Simulation
17
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
18
+ Requires-Python: >=3.13
19
+ Requires-Dist: httpx>=0.28.0
20
+ Requires-Dist: mcp>=1.20.0
21
+ Requires-Dist: pydantic-settings>=2.12.0
22
+ Requires-Dist: pydantic>=2.12.0
23
+ Requires-Dist: python-dotenv>=1.0.0
24
+ Provides-Extra: dev
25
+ Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
26
+ Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
27
+ Requires-Dist: pytest-mock>=3.10.0; extra == 'dev'
28
+ Requires-Dist: pytest>=7.0.0; extra == 'dev'
29
+ Requires-Dist: ruff>=0.14.0; extra == 'dev'
30
+ Description-Content-Type: text/markdown
31
+
32
+ # FPL MCP Server 🏆⚽
33
+
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
+
36
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
37
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
38
+ [![MCP](https://img.shields.io/badge/MCP-compatible-green.svg)](https://modelcontextprotocol.io)
39
+
40
+ ## 🌟 Features
41
+
42
+ This MCP server provides comprehensive FPL analysis capabilities through:
43
+
44
+ - **26 Interactive Tools** - Search players, analyze fixtures, compare managers, track transfers, and more
45
+ - **16 Data Resources** - Efficient URI-based access to players, teams, gameweeks, and manager data
46
+ - **7 Strategy Prompts** - Structured templates for squad analysis, transfer planning, and chip strategy
47
+ - **Smart Caching** - 4-hour cache for bootstrap data to minimize API calls while keeping data fresh
48
+ - **Fuzzy Matching** - Find players even with spelling variations or nicknames
49
+ - **Live Transfer Trends** - Track the most transferred in/out players for current gameweek
50
+ - **Manager Insights** - Analyze squads, transfers, and chip usage (supports 2025/26 half-season system)
51
+ - **Fixture Analysis** - Assess team fixtures and plan transfers around favorable runs
52
+
53
+ ## 🚀 Quick Start
54
+
55
+ You have **two options** to run the FPL MCP server:
56
+
57
+ ### Option 1: Run with Docker (Recommended)
58
+
59
+ ```json
60
+ {
61
+ "mcpServers": {
62
+ "fpl": {
63
+ "command": "docker",
64
+ "args": ["run", "--rm", "-i", "yourusername/fpl-mcp:latest"]
65
+ },
66
+ "type": "stdio"
67
+ }
68
+ }
69
+ ```
70
+
71
+ ---
72
+
73
+ ### Option 2: Run with uv
74
+
75
+ 1. **Clone and install**:
76
+
77
+ ```bash
78
+ git clone https://github.com/nguyenanhducs/fpl-mcp.git
79
+ cd fpl-mcp
80
+ uv sync
81
+ ```
82
+
83
+ 2. **Configure MCP Servers**:
84
+
85
+ ```json
86
+ {
87
+ "mcpServers": {
88
+ "fpl": {
89
+ "command": "uv",
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
+ ```
103
+
104
+ Replace `/absolute/path/to/fpl-mcp` with the actual path.
105
+
106
+ ## 📖 Usage & Documentation
107
+
108
+ Once configured, you can interact with the FPL MCP server through Claude Desktop using natural language.
109
+
110
+ For detailed guidance, see:
111
+
112
+ - **[Usage Examples](./docs/usage-examples.md)** - Natural language query examples for player analysis, fixtures, leagues, and strategy
113
+ - **[Tool Selection Guide](./docs/tool-selection-guide.md)** - Choose the right tool for your analysis task
114
+
115
+ ## ⚙️ Configuration
116
+
117
+ The server works out-of-the-box with sensible defaults, but you can customize cache durations, timeouts, and logging levels through environment variables.
118
+
119
+ For detailed configuration instructions for both Docker and uv deployments, see **[Configuration Guide](./docs/configuration.md)**.
120
+
121
+ ## Contributing
122
+
123
+ We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
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
134
+
135
+ ## 📊 Data Sources
136
+
137
+ This server uses the official **Fantasy Premier League API**, see [here](./docs/fpl-api.md) for more details.
@@ -0,0 +1,106 @@
1
+ # FPL MCP Server 🏆⚽
2
+
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
+
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![Python 3.10+](https://img.shields.io/badge/python-3.10+-blue.svg)](https://www.python.org/downloads/)
7
+ [![MCP](https://img.shields.io/badge/MCP-compatible-green.svg)](https://modelcontextprotocol.io)
8
+
9
+ ## 🌟 Features
10
+
11
+ This MCP server provides comprehensive FPL analysis capabilities through:
12
+
13
+ - **26 Interactive Tools** - Search players, analyze fixtures, compare managers, track transfers, and more
14
+ - **16 Data Resources** - Efficient URI-based access to players, teams, gameweeks, and manager data
15
+ - **7 Strategy Prompts** - Structured templates for squad analysis, transfer planning, and chip strategy
16
+ - **Smart Caching** - 4-hour cache for bootstrap data to minimize API calls while keeping data fresh
17
+ - **Fuzzy Matching** - Find players even with spelling variations or nicknames
18
+ - **Live Transfer Trends** - Track the most transferred in/out players for current gameweek
19
+ - **Manager Insights** - Analyze squads, transfers, and chip usage (supports 2025/26 half-season system)
20
+ - **Fixture Analysis** - Assess team fixtures and plan transfers around favorable runs
21
+
22
+ ## 🚀 Quick Start
23
+
24
+ You have **two options** to run the FPL MCP server:
25
+
26
+ ### Option 1: Run with Docker (Recommended)
27
+
28
+ ```json
29
+ {
30
+ "mcpServers": {
31
+ "fpl": {
32
+ "command": "docker",
33
+ "args": ["run", "--rm", "-i", "yourusername/fpl-mcp:latest"]
34
+ },
35
+ "type": "stdio"
36
+ }
37
+ }
38
+ ```
39
+
40
+ ---
41
+
42
+ ### Option 2: Run with uv
43
+
44
+ 1. **Clone and install**:
45
+
46
+ ```bash
47
+ git clone https://github.com/nguyenanhducs/fpl-mcp.git
48
+ cd fpl-mcp
49
+ uv sync
50
+ ```
51
+
52
+ 2. **Configure MCP Servers**:
53
+
54
+ ```json
55
+ {
56
+ "mcpServers": {
57
+ "fpl": {
58
+ "command": "uv",
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
+ ```
72
+
73
+ Replace `/absolute/path/to/fpl-mcp` with the actual path.
74
+
75
+ ## 📖 Usage & Documentation
76
+
77
+ Once configured, you can interact with the FPL MCP server through Claude Desktop using natural language.
78
+
79
+ For detailed guidance, see:
80
+
81
+ - **[Usage Examples](./docs/usage-examples.md)** - Natural language query examples for player analysis, fixtures, leagues, and strategy
82
+ - **[Tool Selection Guide](./docs/tool-selection-guide.md)** - Choose the right tool for your analysis task
83
+
84
+ ## ⚙️ Configuration
85
+
86
+ The server works out-of-the-box with sensible defaults, but you can customize cache durations, timeouts, and logging levels through environment variables.
87
+
88
+ For detailed configuration instructions for both Docker and uv deployments, see **[Configuration Guide](./docs/configuration.md)**.
89
+
90
+ ## Contributing
91
+
92
+ We welcome contributions! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
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
103
+
104
+ ## 📊 Data Sources
105
+
106
+ This server uses the official **Fantasy Premier League API**, see [here](./docs/fpl-api.md) for more details.