openfoot-mcp 0.1.0 → 0.1.1

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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.js +17 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openfoot-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Native Model Context Protocol (MCP) server for OpenFootAPI — football fixtures, standings, lineups, events timeline, shot-level xG and match context.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://openfootapi.com",
package/src/index.js CHANGED
@@ -16,7 +16,7 @@ import { z } from "zod";
16
16
 
17
17
  const BASE_URL = process.env.OPENFOOT_BASE_URL ?? "https://openfootapi.com";
18
18
  const API_KEY = process.env.OPENFOOT_API_KEY ?? "";
19
- const VERSION = "0.1.0";
19
+ const VERSION = "0.1.1";
20
20
 
21
21
  /** Endpoints that never need a key, so the server is useful before signup. */
22
22
  const PUBLIC_PATHS = new Set(["/v1/health"]);
@@ -53,8 +53,22 @@ async function call(path, query = {}) {
53
53
  body = { raw: text.slice(0, 2000) };
54
54
  }
55
55
 
56
- if (res.status === 401 || res.status === 403) {
57
- return { error: "unauthorized", status: res.status, message: "API key missing, invalid or revoked.", body };
56
+ if (res.status === 401) {
57
+ return { error: "unauthorized", status: 401, message: "API key missing, invalid or revoked.", body };
58
+ }
59
+ if (res.status === 403) {
60
+ // Not the same failure as a 401. A 403 here means the key is valid and the plan simply does
61
+ // not include this endpoint — lineups, events, xG, league xG and odds are Developer-tier.
62
+ // Calling that "invalid or revoked" sends the agent, and the user, off to regenerate a key
63
+ // that was never the problem. Pass the upstream sentence through; it names the feature.
64
+ return {
65
+ error: "plan_upgrade_required",
66
+ status: 403,
67
+ message:
68
+ body?.error?.message ??
69
+ "Your plan does not include this endpoint. See https://openfootapi.com/pricing.",
70
+ body,
71
+ };
58
72
  }
59
73
  if (res.status === 429) {
60
74
  return {