fpl-intelligence 0.2.0__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 (36) hide show
  1. fpl_intelligence-0.2.0/.claude/commands/engineer.md +30 -0
  2. fpl_intelligence-0.2.0/.claude/commands/fpl-researcher.md +31 -0
  3. fpl_intelligence-0.2.0/.claude/commands/marketing.md +35 -0
  4. fpl_intelligence-0.2.0/.claude/commands/monetizer.md +30 -0
  5. fpl_intelligence-0.2.0/.claude/commands/reviewer.md +28 -0
  6. fpl_intelligence-0.2.0/.env.example +22 -0
  7. fpl_intelligence-0.2.0/.gitignore +22 -0
  8. fpl_intelligence-0.2.0/.python-version +1 -0
  9. fpl_intelligence-0.2.0/CLAUDE.md +99 -0
  10. fpl_intelligence-0.2.0/LICENSE +21 -0
  11. fpl_intelligence-0.2.0/MARKETING_DRAFTS.md +76 -0
  12. fpl_intelligence-0.2.0/PKG-INFO +80 -0
  13. fpl_intelligence-0.2.0/PLAN.md +128 -0
  14. fpl_intelligence-0.2.0/README.md +53 -0
  15. fpl_intelligence-0.2.0/app/__init__.py +0 -0
  16. fpl_intelligence-0.2.0/app/algorithms/__init__.py +0 -0
  17. fpl_intelligence-0.2.0/app/algorithms/captain.py +318 -0
  18. fpl_intelligence-0.2.0/app/algorithms/chips.py +437 -0
  19. fpl_intelligence-0.2.0/app/algorithms/compare.py +272 -0
  20. fpl_intelligence-0.2.0/app/algorithms/differentials.py +138 -0
  21. fpl_intelligence-0.2.0/app/algorithms/fixtures.py +129 -0
  22. fpl_intelligence-0.2.0/app/algorithms/hit_analyzer.py +228 -0
  23. fpl_intelligence-0.2.0/app/algorithms/live.py +127 -0
  24. fpl_intelligence-0.2.0/app/algorithms/prices.py +79 -0
  25. fpl_intelligence-0.2.0/app/algorithms/transfers.py +202 -0
  26. fpl_intelligence-0.2.0/app/config.py +36 -0
  27. fpl_intelligence-0.2.0/app/fpl_client.py +181 -0
  28. fpl_intelligence-0.2.0/app/main.py +163 -0
  29. fpl_intelligence-0.2.0/app/x402.py +253 -0
  30. fpl_intelligence-0.2.0/mcp_server.py +488 -0
  31. fpl_intelligence-0.2.0/pyproject.toml +61 -0
  32. fpl_intelligence-0.2.0/scripts/backtest.py +654 -0
  33. fpl_intelligence-0.2.0/scripts/check_wallet.py +75 -0
  34. fpl_intelligence-0.2.0/tests/__init__.py +0 -0
  35. fpl_intelligence-0.2.0/tests/test_x402.py +239 -0
  36. fpl_intelligence-0.2.0/uv.lock +2126 -0
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Software engineer agent — implements features, writes code, runs tests
3
+ ---
4
+
5
+ You are the Software Engineer for x402 FPL Intelligence. You are part of a team of agents working together to build and grow this product.
6
+
7
+ ## Your Role
8
+ You implement features, fix bugs, write tests, and ship code. You are hands-on — you read code, write code, run tests, and verify everything works before marking done.
9
+
10
+ ## Your Project
11
+ This is an MCP server + HTTP API for Fantasy Premier League intelligence. The codebase is at ~/Projects/x402-fpl-api.
12
+
13
+ Key files:
14
+ - `mcp_server.py` — MCP server with 7 tools for Claude Desktop
15
+ - `app/main.py` — FastAPI HTTP server with x402 payment middleware
16
+ - `app/x402.py` — Payment verification (USDC on Base via HTTP 402)
17
+ - `app/fpl_client.py` — FPL API wrapper with caching
18
+ - `app/algorithms/` — Captain pick, differentials, fixtures, prices, transfers, live points
19
+ - `app/config.py` — Settings and endpoint pricing
20
+ - `tests/` — Test suite
21
+
22
+ ## How You Work
23
+ 1. Read the relevant code before making changes
24
+ 2. Make focused, minimal changes — don't over-engineer
25
+ 3. Run tests after every change: `cd ~/Projects/x402-fpl-api && source .venv/bin/activate && pytest tests/ -v`
26
+ 4. If you add a new feature, add tests for it
27
+ 5. Keep the MCP server and HTTP API in sync — new algorithms should be exposed in both
28
+
29
+ ## Your Task
30
+ $ARGUMENTS
@@ -0,0 +1,31 @@
1
+ ---
2
+ description: FPL researcher agent — researches FPL strategy, data, and trends online
3
+ ---
4
+
5
+ You are the FPL Researcher for x402 FPL Intelligence. You are part of a team of agents working together to build and grow this product.
6
+
7
+ ## Your Role
8
+ You research Fantasy Premier League strategy, data sources, community trends, and competitive landscape. You find information that improves our algorithms and product decisions.
9
+
10
+ ## What You Research
11
+ 1. **FPL strategy** — What captaincy strategies work best? What transfer patterns do top managers use? What metrics correlate most with FPL points?
12
+ 2. **Algorithm improvements** — Are our scoring weights (form ×2.0, PPG ×1.0, etc.) optimal? What other models exist? What do top FPL content creators recommend?
13
+ 3. **Data sources** — Are there additional free FPL data sources beyond the official API? Community datasets? xG providers?
14
+ 4. **Community trends** — What are FPL Twitter/Reddit talking about? What tools do managers wish they had? What pain points exist?
15
+ 5. **Competitive analysis** — What other FPL tools, bots, and APIs exist? What do they charge? What features do they have that we don't?
16
+
17
+ ## How You Work
18
+ 1. Search the web for current FPL information
19
+ 2. Focus on actionable findings — things we can implement or use to improve our algorithms
20
+ 3. Cite your sources
21
+ 4. Distinguish between facts (data) and opinions (strategy advice)
22
+ 5. Always relate findings back to how they affect our product
23
+
24
+ ## Current Algorithms to Improve
25
+ - Captain pick: form ×2.0 + PPG ×1.0 + home_bonus 1.5 - FDR ×1.0 + ICT ×0.01 + bonus_pg ×0.5 - injury penalty
26
+ - Differentials: form ×3.0 + PPG ×1.0 - FDR ×0.5 + ICT ×0.01 - ownership ×0.1
27
+ - Transfer value: form ×2.0 + PPG ×1.0 - FDR ×1.0 + home 0.5
28
+ - Price predictions: net transfer volume vs threshold estimates
29
+
30
+ ## Your Task
31
+ $ARGUMENTS
@@ -0,0 +1,35 @@
1
+ ---
2
+ description: Marketing agent — handles distribution, listings, content, and growth
3
+ ---
4
+
5
+ You are the Marketing Lead for x402 FPL Intelligence. You are part of a team of agents working together to build and grow this product.
6
+
7
+ ## Your Role
8
+ You handle distribution, discovery, and growth. You get this MCP server in front of as many FPL managers and AI agent developers as possible.
9
+
10
+ ## Our Product
11
+ - **What:** An MCP server giving Claude Desktop users personalized FPL intelligence (captain picks, transfers, differentials, fixtures, price predictions, live points)
12
+ - **Where:** GitHub repo at https://github.com/dohyung1/x402-fpl-api
13
+ - **Who:** FPL managers who use Claude, AI agent developers building FPL tools
14
+ - **USP:** Only FPL MCP server. Auto-detects your team status. 7 tools covering every FPL decision.
15
+
16
+ ## Your Channels
17
+ 1. **MCP directories** — Glama (glama.ai/mcp), mcp.so, Smithery (smithery.ai), official MCP registry, awesome-mcp-servers GitHub repo
18
+ 2. **FPL community** — Reddit r/FantasyPL, FPL Twitter, FPL Discord servers, FPL content creators
19
+ 3. **Developer community** — Hacker News, Reddit r/ClaudeAI, Reddit r/MCP, Dev.to, Twitter
20
+ 4. **SEO** — GitHub repo description, tags, README optimization
21
+
22
+ ## How You Work
23
+ 1. Research each channel for submission requirements and best practices
24
+ 2. Draft listings, posts, and content — ready to publish
25
+ 3. Tailor messaging to the audience (FPL managers vs developers vs AI enthusiasts)
26
+ 4. Track what's been submitted and what hasn't
27
+ 5. Propose a content calendar if ongoing posting makes sense
28
+
29
+ ## Key Messages
30
+ - "The only FPL MCP server — get AI-powered captain picks, transfer advice, and more inside Claude"
31
+ - "Just give Claude your FPL team ID and it auto-detects your bank, free transfers, and chips"
32
+ - "7 tools covering every FPL decision: captain, transfers, differentials, fixtures, prices, live points"
33
+
34
+ ## Your Task
35
+ $ARGUMENTS
@@ -0,0 +1,30 @@
1
+ ---
2
+ description: Monetizer agent — researches and proposes monetization strategies
3
+ ---
4
+
5
+ You are the Monetizer for x402 FPL Intelligence. You are part of a team of agents working together to build and grow this product.
6
+
7
+ ## Your Role
8
+ You research monetization strategies for MCP servers and AI agent services. You find real examples of what's working, propose pricing models, and identify revenue opportunities.
9
+
10
+ ## Our Current Product
11
+ - An MCP server with 7 FPL intelligence tools (free, runs locally via Claude Desktop)
12
+ - An HTTP API with x402 micropayments (USDC on Base, $0.001-$0.005 per query) — built but not yet deployed publicly
13
+ - Target customers: AI agents, FPL chatbot developers, FPL app builders
14
+
15
+ ## What You Research
16
+ 1. **MCP monetization** — How are other MCP servers making money? Are any charging? What models exist (freemium, premium tools, hosted vs self-hosted)?
17
+ 2. **Agent economy** — How are AI agent services being monetized in 2025-2026? What payment protocols exist beyond x402?
18
+ 3. **FPL market** — How big is the FPL audience? What do existing FPL tools charge? What's the willingness to pay?
19
+ 4. **Pricing strategy** — What should our free tier include? What's worth charging for? Per-query vs subscription vs one-time?
20
+ 5. **Revenue channels** — Sponsorships, affiliate deals with FPL content creators, premium data partnerships, white-labeling?
21
+
22
+ ## How You Work
23
+ 1. Search the web for current market data and examples
24
+ 2. Focus on actionable strategies with estimated revenue potential
25
+ 3. Propose concrete pricing with reasoning
26
+ 4. Consider our constraints: solo founder, iOS engineer background, minimal infrastructure
27
+ 5. Prioritize by effort vs reward — what's the fastest path to first revenue?
28
+
29
+ ## Your Task
30
+ $ARGUMENTS
@@ -0,0 +1,28 @@
1
+ ---
2
+ description: Code reviewer agent — reviews code for quality, bugs, security, and performance
3
+ ---
4
+
5
+ You are the Code Reviewer for x402 FPL Intelligence. You are part of a team of agents working together to build and grow this product.
6
+
7
+ ## Your Role
8
+ You review code for bugs, security issues, performance problems, and maintainability. You are thorough but practical — flag real problems, not style nitpicks.
9
+
10
+ ## Your Project
11
+ This is an MCP server + HTTP API for Fantasy Premier League intelligence. The codebase is at ~/Projects/x402-fpl-api.
12
+
13
+ ## What You Review
14
+ 1. **Bugs** — Logic errors, edge cases, unhandled exceptions
15
+ 2. **Security** — Injection risks, data leaks, unsafe inputs. The x402 payment flow is security-critical (replay attacks, insufficient payment, fake tx hashes)
16
+ 3. **Performance** — Unnecessary API calls, missing caching, N+1 queries against the FPL API
17
+ 4. **Data correctness** — FPL algorithm logic (captain scoring weights, fixture difficulty ratings, transfer value calculations)
18
+ 5. **API contract** — MCP tool descriptions must be clear and accurate for AI agents to use correctly
19
+
20
+ ## How You Work
21
+ 1. Read all relevant files before giving feedback
22
+ 2. For each issue, cite the file and line number
23
+ 3. Rate severity: CRITICAL (must fix), WARNING (should fix), SUGGESTION (nice to have)
24
+ 4. If you find no issues, say so — don't invent problems
25
+ 5. After reviewing, summarize: what's good, what needs fixing, overall assessment
26
+
27
+ ## Your Task
28
+ $ARGUMENTS
@@ -0,0 +1,22 @@
1
+ # x402 FPL Intelligence API — Environment Variables
2
+ # Copy this to .env and fill in your values
3
+
4
+ # Our wallet address that receives USDC payments
5
+ PAYMENT_WALLET_ADDRESS=0xYourWalletAddressHere
6
+
7
+ # Base network RPC endpoint
8
+ # Testnet (Base Sepolia): https://sepolia.base.org
9
+ # Mainnet (Base): https://mainnet.base.org
10
+ BASE_RPC_URL=https://sepolia.base.org
11
+
12
+ # USDC contract address
13
+ # Base Sepolia testnet: 0x036CbD53842c5426634e7929541eC2318f3dCF7e
14
+ # Base mainnet: 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913
15
+ USDC_CONTRACT_ADDRESS=0x036CbD53842c5426634e7929541eC2318f3dCF7e
16
+
17
+ # Number of block confirmations required before accepting payment
18
+ REQUIRED_CONFIRMATIONS=1
19
+
20
+ # Service metadata
21
+ SERVICE_NAME=x402-fpl-api
22
+ SERVICE_DESCRIPTION=AI-agent-native Fantasy Premier League intelligence
@@ -0,0 +1,22 @@
1
+ # Python-generated files
2
+ __pycache__/
3
+ *.py[oc]
4
+ build/
5
+ dist/
6
+ wheels/
7
+ *.egg-info
8
+
9
+ # Virtual environments
10
+ .venv
11
+
12
+ # Environment variables (contains wallet address)
13
+ .env
14
+
15
+ # OS
16
+ .DS_Store
17
+
18
+ # Test cache
19
+ .pytest_cache/
20
+
21
+ # SQLite payment database
22
+ data/
@@ -0,0 +1 @@
1
+ 3.12
@@ -0,0 +1,99 @@
1
+ # x402 FPL Intelligence API
2
+
3
+ ## Project Vision
4
+ An AI-agent-native Fantasy Premier League (FPL) intelligence API. Agents pay per-query using the x402 (HTTP 402) protocol — no API keys, no subscriptions, no signup. We turn free public FPL data into actionable recommendations that AI agents can consume instantly.
5
+
6
+ The long-term play: FPL is the proving ground. Once x402 works here, we expand to other fantasy sports and eventually the client/server SDK becomes the real product — "Stripe for agent commerce."
7
+
8
+ ## Tech Stack
9
+ - **Server:** Python + FastAPI
10
+ - **Payment verification:** web3.py (USDC on Base L2)
11
+ - **Data source:** FPL public API (https://fantasy.premierleague.com/api/) — free, real-time, no auth
12
+ - **Hosting:** Single VPS or serverless (low compute)
13
+ - **Agent wallet:** Coinbase CDP SDK or standard EOA
14
+
15
+ ## The x402 Payment Flow
16
+ Every paid endpoint follows this pattern:
17
+ 1. Agent sends request (no token, no auth)
18
+ 2. Server responds **402** + JSON body: `{ price, wallet_address, service_name }`
19
+ 3. Agent pays on-chain (USDC on Base L2, sub-penny fees, <1s settlement)
20
+ 4. Agent retries with `X-Payment` header containing the tx hash
21
+ 5. Server verifies tx on-chain → delivers response
22
+
23
+ Two HTTP requests per paid call. Zero auth infrastructure.
24
+
25
+ ## Endpoints & Pricing
26
+
27
+ | Endpoint | Price | Description |
28
+ |---|---|---|
29
+ | `GET /api/fpl/captain-pick` | $0.002 | Top 5 captain recommendations with scoring breakdown |
30
+ | `GET /api/fpl/transfer-suggest` | $0.005 | Transfer in/out recommendations for a given team |
31
+ | `GET /api/fpl/differentials` | $0.001 | Underowned players outperforming their ownership |
32
+ | `GET /api/fpl/fixture-outlook` | $0.001 | Teams ranked by upcoming fixture difficulty |
33
+ | `GET /api/fpl/price-predictions` | $0.002 | Players likely to rise or fall in price tonight |
34
+ | `GET /api/fpl/live-points` | $0.001 | Live score, projected bonus, auto-sub scenarios |
35
+
36
+ ## FPL Data Sources (all free, public)
37
+ - `GET /bootstrap-static/` — All players, teams, gameweeks, scoring rules
38
+ - `GET /fixtures/` — All 380 fixtures with FDR ratings
39
+ - `GET /event/{gw}/live/` — Real-time points during matches
40
+ - `GET /element-summary/{player_id}/` — Per-player fixture history
41
+ - `GET /entry/{team_id}/event/{gw}/picks/` — Team's picks for a gameweek
42
+ - `GET /entry/{team_id}/history/` — Season history and chips used
43
+
44
+ ## Captain Score Algorithm
45
+ ```
46
+ captain_score =
47
+ form × 2.0
48
+ + points_per_game × 1.0
49
+ + home_bonus (1.5 if home, else 0)
50
+ - fixture_difficulty × 1.0 (FDR 1–5)
51
+ + ict_index × 0.01
52
+ + bonus_per_game × 0.5
53
+ - injury_penalty (0 if fit, -10 if doubtful/injured)
54
+ ```
55
+ Weights are tuned over time against actual GW results — this tuning is our core IP.
56
+
57
+ ## Build Order
58
+ - **Phase 1:** Real x402 payment flow with USDC on Base testnet
59
+ - **Phase 2:** Captain pick endpoint (easiest, highest value)
60
+ - **Phase 3:** Differential finder (proves multi-endpoint model)
61
+ - **Phase 4:** Extract client SDK as open source package (distribution)
62
+ - **Phase 5:** Remaining endpoints (transfers, fixtures, live, prices)
63
+ - **Phase 6:** Service directory listing for agent discovery
64
+ - **Phase 7:** Expand to NFL, NBA, Champions League
65
+
66
+ ## Project Structure (target)
67
+ ```
68
+ x402-fpl-api/
69
+ ├── CLAUDE.md
70
+ ├── README.md
71
+ ├── pyproject.toml
72
+ ├── app/
73
+ │ ├── main.py # FastAPI app, x402 middleware
74
+ │ ├── x402.py # Payment verification logic
75
+ │ ├── fpl_client.py # FPL API wrapper with caching
76
+ │ ├── algorithms/
77
+ │ │ ├── captain.py # Captain pick scoring
78
+ │ │ ├── differentials.py
79
+ │ │ ├── fixtures.py
80
+ │ │ ├── transfers.py
81
+ │ │ ├── prices.py
82
+ │ │ └── live.py
83
+ │ └── models.py # Pydantic response schemas
84
+ ├── tests/
85
+ └── scripts/
86
+ └── seed_testnet.py # Fund test wallet on Base Sepolia
87
+ ```
88
+
89
+ ## Revenue Model
90
+ Pay-per-query in USDC on Base L2. No subscriptions, no API keys, no billing infrastructure.
91
+
92
+ Example at scale: 50 FPL agent apps × 1,000 users × 5 queries/week × $0.002 avg = **~$19,000/season**
93
+
94
+ ## Key Principles
95
+ - **Agent-first:** Every response is JSON optimized for machine consumption, not humans
96
+ - **Zero friction:** No signup. No API key. Agent discovers, pays, gets data
97
+ - **Intelligence over data:** Return recommendations with reasoning, not raw stats
98
+ - **Minimize infra:** No frontend, no user management, no auth system
99
+ - **Start narrow:** Nail FPL before expanding to other sports
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dohyung1
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,76 @@
1
+ # Marketing Drafts — Ready to Submit
2
+
3
+ ## Glama (glama.ai/mcp)
4
+ Submit GitHub URL: https://github.com/dohyung1/x402-fpl-api via "Add Server" button.
5
+ Glama auto-indexes from the repo.
6
+
7
+ ---
8
+
9
+ ## mcp.so/submit
10
+ - **Type:** MCP Server
11
+ - **Name:** FPL Intelligence
12
+ - **URL:** https://github.com/dohyung1/x402-fpl-api
13
+
14
+ ---
15
+
16
+ ## awesome-mcp-servers PR
17
+
18
+ **Line to add under "Sports" category:**
19
+ ```
20
+ - [dohyung1/x402-fpl-api](https://github.com/dohyung1/x402-fpl-api) 🐍 🏠 - Personalized Fantasy Premier League intelligence — captain picks, transfer suggestions, differentials, fixture outlook, price predictions, live points, and a full manager hub that auto-detects bank balance, free transfers, and chips.
21
+ ```
22
+
23
+ ---
24
+
25
+ ## Reddit r/FantasyPL
26
+
27
+ **Title:** I built an AI assistant that analyzes your FPL team and gives personalized recommendations — free and open source
28
+
29
+ Been playing FPL for years and got tired of manually cross-referencing form, fixtures, ownership, and price changes every week. So I built a tool that does it all at once.
30
+
31
+ It connects to Claude Desktop (Anthropic's AI app) and gives you 7 tools you can ask in plain English:
32
+
33
+ - **Captain pick** — scores your options by form, PPG, home advantage, fixture difficulty, ICT index, and bonus rate. Gives you the top 5 with reasoning.
34
+ - **Transfer suggestions** — looks at your actual squad, identifies your weakest starters, and suggests replacements within your budget.
35
+ - **Differentials** — finds players under 10% ownership who are returning well. Good for climbing mini-leagues.
36
+ - **Fixture outlook** — ranks all 20 teams by upcoming FDR and surfaces the best players to target from favorable-fixture teams.
37
+ - **Price predictions** — flags players likely to rise or fall tonight based on net transfer volume.
38
+ - **Live points** — live scores, projected bonus, auto-sub scenarios during a gameweek.
39
+ - **Manager hub** — the big one. Give it your team ID and it auto-detects your bank, free transfers, and chips, then runs everything above in one go.
40
+
41
+ All data comes from the official FPL API in real time. No scraping, no dodgy sources.
42
+
43
+ You just tell Claude "Analyze FPL team 12345 and give me your full recommendation" and it pulls your actual squad, runs the numbers, and gives you a full briefing. Bank balance, free transfers, chips — all auto-detected. You don't need to enter anything manually.
44
+
45
+ It's open source and free: https://github.com/dohyung1/x402-fpl-api
46
+
47
+ You need Claude Desktop installed (free tier works). Setup takes about 2 minutes — clone the repo, add one config block, restart Claude.
48
+
49
+ Happy to answer questions. Would love feedback from other FPL managers on what analysis would be most useful to add.
50
+
51
+ ---
52
+
53
+ ## Reddit r/ClaudeAI
54
+
55
+ **Title:** Built an MCP server that turns Claude Desktop into a Fantasy Premier League analyst
56
+
57
+ Sharing an MCP server I built that gives Claude real-time FPL (Fantasy Premier League) intelligence. It exposes 7 tools that Claude can call to analyze any manager's team using live data from the official Premier League API.
58
+
59
+ **What it does:**
60
+ - Captain pick scoring (form, fixtures, ICT, bonus rate weighted algorithm)
61
+ - Transfer suggestions personalized to your squad and budget
62
+ - Differential finder (low-ownership outperformers)
63
+ - Fixture difficulty rankings with player targets
64
+ - Price change predictions from transfer volume
65
+ - Live gameweek points with projected bonus
66
+ - A "manager hub" tool that auto-detects bank balance, free transfers, and chips from the FPL API, then runs the full analysis in one call
67
+
68
+ **Tech:**
69
+ - Python + FastMCP
70
+ - All data from the public FPL API (no auth needed, no rate limits)
71
+ - Algorithms score players using a weighted composite of form, PPG, home advantage, FDR, ICT index, and bonus rate
72
+ - The manager hub tool runs all sub-analyses in parallel using asyncio.gather
73
+
74
+ Repo: https://github.com/dohyung1/x402-fpl-api
75
+
76
+ Setup is just clone + add to `claude_desktop_config.json`. Uses `uv` for dependency management.
@@ -0,0 +1,80 @@
1
+ Metadata-Version: 2.4
2
+ Name: fpl-intelligence
3
+ Version: 0.2.0
4
+ Summary: AI-powered Fantasy Premier League MCP server — captain picks, transfer suggestions, player comparison, chip strategy, and more
5
+ Project-URL: Homepage, https://github.com/dohyung1/x402-fpl-api
6
+ Project-URL: Repository, https://github.com/dohyung1/x402-fpl-api
7
+ Project-URL: Issues, https://github.com/dohyung1/x402-fpl-api/issues
8
+ Author: dohyung1
9
+ License: MIT
10
+ License-File: LICENSE
11
+ Keywords: ai,claude,fantasy-football,fantasy-premier-league,fpl,mcp
12
+ Classifier: Development Status :: 4 - Beta
13
+ Classifier: Intended Audience :: Developers
14
+ Classifier: License :: OSI Approved :: MIT License
15
+ Classifier: Programming Language :: Python :: 3
16
+ Classifier: Programming Language :: Python :: 3.12
17
+ Classifier: Topic :: Games/Entertainment
18
+ Requires-Python: >=3.12
19
+ Requires-Dist: fastapi>=0.128.8
20
+ Requires-Dist: httpx>=0.28.1
21
+ Requires-Dist: mcp[cli]>=1.26.0
22
+ Requires-Dist: pydantic-settings>=2.11.0
23
+ Requires-Dist: python-dotenv>=1.2.1
24
+ Requires-Dist: uvicorn[standard]>=0.39.0
25
+ Requires-Dist: web3>=7.14.1
26
+ Description-Content-Type: text/markdown
27
+
28
+ # FPL Intelligence — MCP Server
29
+
30
+ AI-powered Fantasy Premier League assistant for Claude Desktop. Get personalized captain picks, transfer suggestions, differentials, fixture analysis, price predictions, and live points — all from real FPL data.
31
+
32
+ ## Setup
33
+
34
+ ```bash
35
+ git clone https://github.com/dohyung1/x402-fpl-api.git
36
+ cd x402-fpl-api
37
+ uv sync
38
+ ```
39
+
40
+ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
41
+
42
+ ```json
43
+ {
44
+ "mcpServers": {
45
+ "fpl": {
46
+ "command": "uv",
47
+ "args": ["run", "--directory", "/path/to/x402-fpl-api", "mcp_server.py"]
48
+ }
49
+ }
50
+ }
51
+ ```
52
+
53
+ Restart Claude Desktop and ask:
54
+
55
+ > "Analyze FPL team YOUR_TEAM_ID and give me your full recommendation."
56
+
57
+ Bank balance, free transfers, and chips are all auto-detected — just provide your team ID.
58
+
59
+ ## Find Your FPL Team ID
60
+
61
+ Go to the [FPL website](https://fantasy.premierleague.com), click "Points", and look at the URL:
62
+
63
+ ```
64
+ https://fantasy.premierleague.com/entry/YOUR_TEAM_ID/event/<gw>
65
+ ```
66
+
67
+ ## Available Tools
68
+
69
+ | Tool | What it does |
70
+ |---|---|
71
+ | `fpl_manager_hub` | Full personalized analysis — captain, transfers, differentials, fixtures, price risks |
72
+ | `captain_pick` | Top 5 captain recommendations scored by xG, form, fixtures, and ICT index |
73
+ | `transfer_suggestions` | Transfer in/out recommendations based on your squad and budget |
74
+ | `player_comparison` | Head-to-head compare 2-4 players (e.g. "Salah vs Palmer vs Saka") |
75
+ | `is_hit_worth_it` | Should you take a -4 hit? Projects points over N gameweeks to decide |
76
+ | `chip_strategy` | When to use your remaining chips — optimal GW for each based on fixtures |
77
+ | `differential_finder` | Underowned players outperforming their ownership % |
78
+ | `fixture_outlook` | Teams ranked by upcoming fixture difficulty + best players to target |
79
+ | `price_predictions` | Players likely to rise or fall in price tonight |
80
+ | `live_points` | Live score, projected bonus, and auto-sub scenarios |
@@ -0,0 +1,128 @@
1
+ # FPL Intelligence — Execution Plan
2
+
3
+ ## Positioning
4
+ "Intelligence, not data." We are the only FPL MCP server that returns scored recommendations with reasoning. Competitors (rishijatia, owen-lacey) return raw data.
5
+
6
+ ## Competitors
7
+ | Competitor | Stars | Strength | Weakness |
8
+ |---|---|---|---|
9
+ | rishijatia/fantasy-pl-mcp | 69 | PyPI install, prompt templates, 11 tools | No captain scoring, no price predictions, no manager hub. Last updated Aug 2025 |
10
+ | owen-lacey/fpl-mcp | 3 | 16 tools, Glama listed, npm | Pure data wrapper. Zero intelligence |
11
+
12
+ ## Our Edge
13
+ - `fpl_manager_hub` — unique all-in-one analysis (no competitor has this)
14
+ - Scored captain picks with reasoning
15
+ - Price predictions
16
+ - Live points with auto-sub scenarios
17
+ - xG/xA-powered algorithms (v2, after engineer fix)
18
+
19
+ ---
20
+
21
+ ## Sprint 1: Harden & Ship (This Week)
22
+
23
+ ### Track A — Critical Fixes (Engineer Agent) — DONE ✅
24
+ - [x] Review complete — 5 critical, 11 warnings found
25
+ - [x] SQLite replay protection (replace in-memory set)
26
+ - [x] Thread-safe tx hash checking (atomic INSERT OR IGNORE)
27
+ - [x] Async verify_payment (asyncio.to_thread for Web3 calls)
28
+ - [x] Fix Web3 connection caching (remove lru_cache)
29
+ - [x] Double gameweek (DGW) support in fixture map
30
+ - [x] Captain/transfer endpoints default to NEXT gameweek
31
+ - [x] Refactor fpl_manager_hub to call existing algorithm functions
32
+ - [x] Fix web_name collision (use element IDs)
33
+ - [x] Upgrade captain algorithm with xG, xA, penalty data from FPL API
34
+ - [x] Run tests (15/15 passing), commit, push
35
+
36
+ ### Track B — Distribution (Marketing Agent) — DONE
37
+ - [x] GitHub topics added (mcp, fpl, fantasy-premier-league, etc.)
38
+ - [x] GitHub description updated
39
+ - [x] All directory listing drafts ready (MARKETING_DRAFTS.md)
40
+ - [x] Reddit posts drafted (r/FantasyPL, r/ClaudeAI)
41
+ - [x] Submit to awesome-mcp-servers PR (#3340)
42
+ - [ ] Submit to Glama (manual — visit glama.ai/mcp/servers, click "Add Server")
43
+ - [ ] Submit to mcp.so (manual — visit mcp.so/submit)
44
+ - [ ] Post on Reddit (after first week of accuracy tracking)
45
+
46
+ ### Track C — Research — DONE
47
+ - [x] FPL API has xG/xA/penalty/set piece data we weren't using
48
+ - [x] Top competitor gaps identified
49
+ - [x] Manager pain points mapped (captaincy, hit decisions, chip timing)
50
+ - [x] Monetization model defined ($19.99/season freemium)
51
+
52
+ ---
53
+
54
+ ## Sprint 2: Compete & Monetize (Next Week)
55
+
56
+ ### Close Competitive Gaps
57
+ - [ ] Publish to PyPI (`pip install fpl-intelligence`) — one-command install
58
+ - [x] Add MCP prompt templates (5 prompts: analyze team, captain, differentials, transfers, price alerts)
59
+ - [x] Captain weights v2.1 — backtest-tuned (PPG×3.0, form×2.5, FDR×2.0)
60
+ - [x] Backtest script (`scripts/backtest.py`) — replay GWs, Haaland baseline, weight suggestions
61
+ - [x] MIT LICENSE added
62
+ - [ ] Add blank/double gameweek detection tool
63
+ - [ ] Add player comparison tool
64
+ - [ ] Add chip strategy advisor tool
65
+ - [ ] Add "Is this hit worth it?" tool (unique, no competitor has this)
66
+
67
+ ### Distribution Push
68
+ - [ ] Submit to Smithery
69
+ - [ ] Post on r/FantasyPL with accuracy data
70
+ - [ ] Post on r/ClaudeAI
71
+ - [ ] Rebrand MCP as "FPL Intelligence" (drop x402 from public-facing name)
72
+
73
+ ### Revenue Setup
74
+ - [ ] Set up LemonSqueezy for season pass ($19.99/season)
75
+ - [ ] Define free vs paid tier split
76
+ - [ ] Add API key gating for paid features
77
+ - [ ] Deploy HTTP API to Railway/Fly.io
78
+
79
+ ---
80
+
81
+ ## Sprint 3: Grow (Weeks 3-4)
82
+
83
+ ### Product
84
+ - [ ] Multi-gameweek transfer planning (score targets across next 3-5 GWs)
85
+ - [ ] Integrate Understat for rolling per-match xG
86
+ - [ ] Add usage metrics tracking (SQLite → PostHog)
87
+ - [ ] Track captain pick accuracy weekly — publish as credibility metric
88
+
89
+ ### Growth
90
+ - [ ] Weekly "AI captain picks" posts on r/FantasyPL
91
+ - [ ] Reach out to FPL content creators (YouTube/Twitter)
92
+ - [ ] Iterate on algorithms based on actual GW results
93
+ - [ ] First 50 paying users → $1,000 revenue target
94
+
95
+ ---
96
+
97
+ ## Revenue Model
98
+
99
+ ### Free Tier (MCP, no auth)
100
+ - Captain pick (top 3, no reasoning)
101
+ - Differentials (top 5)
102
+ - Fixture outlook (3 GWs)
103
+ - Price predictions
104
+
105
+ ### Paid Tier — $19.99/season or $4.99/month
106
+ - Full `fpl_manager_hub`
107
+ - Transfer suggestions
108
+ - Live points
109
+ - Full captain picks with reasoning
110
+ - Extended fixture outlook (10 GWs)
111
+ - Accuracy dashboard
112
+
113
+ ### Projections
114
+ | Scale | Users | Revenue/Season |
115
+ |---|---|---|
116
+ | Minimum | 50 | $1,000 |
117
+ | Modest | 250 | $5,000 |
118
+ | Good | 1,000 | $20,000 |
119
+ | Strong PMF | 5,000 | $100,000 |
120
+
121
+ ---
122
+
123
+ ## Key Metrics to Track
124
+ 1. GitHub stars + clones
125
+ 2. MCP directory installs
126
+ 3. Captain pick accuracy vs community average
127
+ 4. Free → paid conversion rate (target 3-5%)
128
+ 5. Weekly active users (tool calls per GW)
@@ -0,0 +1,53 @@
1
+ # FPL Intelligence — MCP Server
2
+
3
+ AI-powered Fantasy Premier League assistant for Claude Desktop. Get personalized captain picks, transfer suggestions, differentials, fixture analysis, price predictions, and live points — all from real FPL data.
4
+
5
+ ## Setup
6
+
7
+ ```bash
8
+ git clone https://github.com/dohyung1/x402-fpl-api.git
9
+ cd x402-fpl-api
10
+ uv sync
11
+ ```
12
+
13
+ Add to your Claude Desktop config (`~/Library/Application Support/Claude/claude_desktop_config.json`):
14
+
15
+ ```json
16
+ {
17
+ "mcpServers": {
18
+ "fpl": {
19
+ "command": "uv",
20
+ "args": ["run", "--directory", "/path/to/x402-fpl-api", "mcp_server.py"]
21
+ }
22
+ }
23
+ }
24
+ ```
25
+
26
+ Restart Claude Desktop and ask:
27
+
28
+ > "Analyze FPL team YOUR_TEAM_ID and give me your full recommendation."
29
+
30
+ Bank balance, free transfers, and chips are all auto-detected — just provide your team ID.
31
+
32
+ ## Find Your FPL Team ID
33
+
34
+ Go to the [FPL website](https://fantasy.premierleague.com), click "Points", and look at the URL:
35
+
36
+ ```
37
+ https://fantasy.premierleague.com/entry/YOUR_TEAM_ID/event/<gw>
38
+ ```
39
+
40
+ ## Available Tools
41
+
42
+ | Tool | What it does |
43
+ |---|---|
44
+ | `fpl_manager_hub` | Full personalized analysis — captain, transfers, differentials, fixtures, price risks |
45
+ | `captain_pick` | Top 5 captain recommendations scored by xG, form, fixtures, and ICT index |
46
+ | `transfer_suggestions` | Transfer in/out recommendations based on your squad and budget |
47
+ | `player_comparison` | Head-to-head compare 2-4 players (e.g. "Salah vs Palmer vs Saka") |
48
+ | `is_hit_worth_it` | Should you take a -4 hit? Projects points over N gameweeks to decide |
49
+ | `chip_strategy` | When to use your remaining chips — optimal GW for each based on fixtures |
50
+ | `differential_finder` | Underowned players outperforming their ownership % |
51
+ | `fixture_outlook` | Teams ranked by upcoming fixture difficulty + best players to target |
52
+ | `price_predictions` | Players likely to rise or fall in price tonight |
53
+ | `live_points` | Live score, projected bonus, and auto-sub scenarios |
File without changes