@sport365/sport-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.
package/README.md CHANGED
@@ -2,16 +2,25 @@
2
2
 
3
3
  Sport MCP is a Rust-based MCP stdio server packaged as an npm CLI. Users can start it with `npx`, while the actual MCP protocol handling and upstream API calls run in the native Rust binary.
4
4
 
5
- ## Usage
5
+ ## Quick Start
6
6
 
7
- After the package is published, configure your MCP client like this:
7
+ Sport MCP is a stdio MCP server. It should be started by an MCP client. Running `npx @sport365/sport-mcp` directly in a terminal only starts the stdio server and waits for MCP JSON-RPC messages.
8
+
9
+ Check the package:
10
+
11
+ ```bash
12
+ npx -y @sport365/sport-mcp@latest --version
13
+ npx -y @sport365/sport-mcp@latest --help
14
+ ```
15
+
16
+ Configure your MCP client like this:
8
17
 
9
18
  ```json
10
19
  {
11
20
  "mcpServers": {
12
21
  "sport": {
13
22
  "command": "npx",
14
- "args": ["-y", "@sport365/sport-mcp"],
23
+ "args": ["-y", "@sport365/sport-mcp@latest"],
15
24
  "env": {
16
25
  "SPORT_AGENT_KEY": "skill_abc123"
17
26
  }
@@ -20,7 +29,9 @@ After the package is published, configure your MCP client like this:
20
29
  }
21
30
  ```
22
31
 
23
- `SPORT_AGENT_KEY` is required. It is sent to the upstream API as `X-Agent-Key`.
32
+ `SPORT_AGENT_KEY` is required when calling `sport_api_call`. It is sent to the upstream API as `X-Agent-Key`. The server can still start without it, and `sport_list_domains` remains available for checking supported domains.
33
+
34
+ For Claude Desktop, add the same JSON object under `mcpServers` in the Claude Desktop config file, then restart Claude Desktop. For Cursor or other MCP clients, use the same `command`, `args`, and `env` fields in that client's MCP server configuration UI.
24
35
 
25
36
  Optional environment variables:
26
37
 
@@ -33,6 +44,19 @@ Optional environment variables:
33
44
  The default upstream URL is compiled into the Rust binary from `crates/sport-core/build.rs`.
34
45
  The API documentation entry is `https://beta-skill-api.zhitiyu.com/docs/api`.
35
46
 
47
+ ## Troubleshooting
48
+
49
+ If the MCP client reports the server as unavailable:
50
+
51
+ - Confirm the command is `npx`, not `node`.
52
+ - Confirm args are `["-y", "@sport365/sport-mcp@latest"]`.
53
+ - Confirm `SPORT_AGENT_KEY` is configured in the MCP client env when calling `sport_api_call`.
54
+ - Restart the MCP client after editing its config.
55
+ - Run `npx -y @sport365/sport-mcp@latest --help` to print the expected config.
56
+ - Run `npm view @sport365/sport-mcp version` to confirm npm can see the package.
57
+
58
+ If `sport_list_domains` works but `sport_api_call` returns a missing key error, the server is installed correctly and only the `SPORT_AGENT_KEY` env value is missing or not visible to the MCP client process.
59
+
36
60
  ## MCP Tools
37
61
 
38
62
  The server exposes two MCP tools:
@@ -170,7 +194,7 @@ dist/npm/
170
194
 
171
195
  ## Publish
172
196
 
173
- Before publishing, replace the placeholder package name in `package.json`:
197
+ The package name is already configured as:
174
198
 
175
199
  ```json
176
200
  {
@@ -178,13 +202,21 @@ Before publishing, replace the placeholder package name in `package.json`:
178
202
  }
179
203
  ```
180
204
 
181
- Then publish the staged package:
205
+ Build the full-platform package first:
182
206
 
183
207
  ```bash
184
208
  npm login
185
- npm run publish:npm:all
209
+ npm run package:all
186
210
  ```
187
211
 
212
+ Then publish the staged package:
213
+
214
+ ```bash
215
+ npm publish ./dist/npm --access public
216
+ ```
217
+
218
+ If the npm account uses WebAuthn, passkey, security key, Chrome, or Windows Hello for 2FA, do not pass `--otp`. The npm CLI will print a browser verification URL. Open it in Chrome, complete Windows Hello or security key verification, then paste the returned token back into the terminal.
219
+
188
220
  ## Architecture
189
221
 
190
222
  The detailed architecture design is written in Chinese:
package/bin/sport-mcp.js CHANGED
@@ -6,6 +6,52 @@ import path from "node:path";
6
6
  import { fileURLToPath } from "node:url";
7
7
 
8
8
  const root = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
9
+ const packageJsonPath = path.join(root, "package.json");
10
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf8"));
11
+ const args = process.argv.slice(2);
12
+
13
+ if (args.includes("--help") || args.includes("-h")) {
14
+ console.log(`Sport MCP ${packageJson.version}
15
+
16
+ Sport MCP is a stdio MCP server. It should be configured in an MCP client, not used as a normal HTTP CLI.
17
+
18
+ MCP client config:
19
+
20
+ {
21
+ "mcpServers": {
22
+ "sport": {
23
+ "command": "npx",
24
+ "args": ["-y", "@sport365/sport-mcp@latest"],
25
+ "env": {
26
+ "SPORT_AGENT_KEY": "skill_abc123"
27
+ }
28
+ }
29
+ }
30
+ }
31
+
32
+ Environment:
33
+ SPORT_AGENT_KEY Required when calling sport_api_call. Sent as X-Agent-Key.
34
+ SPORT_API_BASE_URL Optional. Defaults to https://beta-skill-api.zhitiyu.com/
35
+ SPORT_API_TIMEOUT_SECS Optional. Defaults to 20.
36
+ X_AGENT_KEY Optional fallback for SPORT_AGENT_KEY.
37
+
38
+ Tools:
39
+ sport_list_domains List supported football and basketball API domains.
40
+ sport_api_call Call a documented Skill API domain.
41
+
42
+ Manual checks:
43
+ npx -y @sport365/sport-mcp --version
44
+ npx -y @sport365/sport-mcp --help
45
+
46
+ If an MCP client reports this server as unavailable, check that the client config uses command "npx",
47
+ passes args ["-y", "@sport365/sport-mcp@latest"], and includes SPORT_AGENT_KEY in env.`);
48
+ process.exit(0);
49
+ }
50
+
51
+ if (args.includes("--version") || args.includes("-v")) {
52
+ console.log(packageJson.version);
53
+ process.exit(0);
54
+ }
9
55
 
10
56
  const platform = process.platform;
11
57
  const arch = process.arch;
Binary file
Binary file
package/package.json CHANGED
@@ -1,45 +1,45 @@
1
- {
2
- "name": "@sport365/sport-mcp",
3
- "version": "0.1.0",
4
- "description": "MCP server wrapper for Skill sport APIs.",
5
- "type": "module",
6
- "bin": {
7
- "sport-mcp": "bin/sport-mcp.js"
8
- },
9
- "files": [
10
- "bin",
11
- "native",
12
- "README.md",
13
- "basketball-api.md",
14
- "football-api.md"
15
- ],
16
- "scripts": {
17
- "build": "node ./scripts/build-package.js",
18
- "build:linux": "node ./scripts/build-package.js --target linux-x64",
19
- "build:linux:cross": "node ./scripts/build-package.js --target linux-x64 --linux-builder cargo",
20
- "build:linux:docker": "node ./scripts/build-package.js --target linux-x64 --linux-builder docker",
21
- "build:mac": "node ./scripts/build-package.js --targets mac",
22
- "build:mac:zig": "node ./scripts/build-package.js --targets mac --mac-builder zig",
23
- "build:mac:x64": "node ./scripts/build-package.js --target darwin-x64",
24
- "build:mac:arm64": "node ./scripts/build-package.js --target darwin-arm64",
25
- "build:win-linux": "node ./scripts/build-package.js --targets win-linux",
26
- "build:all": "node ./scripts/build-package.js --targets all",
27
- "package": "npm run build && node ./scripts/pack-npm.js",
28
- "package:linux": "npm run build:linux && node ./scripts/pack-npm.js",
29
- "package:linux:cross": "npm run build:linux:cross && node ./scripts/pack-npm.js",
30
- "package:linux:docker": "npm run build:linux:docker && node ./scripts/pack-npm.js",
31
- "package:mac": "npm run build:mac && node ./scripts/pack-npm.js",
32
- "package:mac:zig": "npm run build:mac:zig && node ./scripts/pack-npm.js",
33
- "package:mac:x64": "npm run build:mac:x64 && node ./scripts/pack-npm.js",
34
- "package:mac:arm64": "npm run build:mac:arm64 && node ./scripts/pack-npm.js",
35
- "package:win-linux": "npm run build:win-linux && node ./scripts/pack-npm.js",
36
- "package:all": "npm run build:all && node ./scripts/pack-npm.js",
37
- "pack": "npm run package",
38
- "publish:npm": "npm run build && npm publish ./dist/npm --access public",
39
- "publish:npm:all": "npm run build:all && npm publish ./dist/npm --access public"
40
- },
41
- "engines": {
42
- "node": ">=18"
43
- },
44
- "license": "MIT"
45
- }
1
+ {
2
+ "name": "@sport365/sport-mcp",
3
+ "version": "0.1.1",
4
+ "description": "MCP server wrapper for Skill sport APIs.",
5
+ "type": "module",
6
+ "bin": {
7
+ "sport-mcp": "bin/sport-mcp.js"
8
+ },
9
+ "files": [
10
+ "bin",
11
+ "native",
12
+ "README.md",
13
+ "basketball-api.md",
14
+ "football-api.md"
15
+ ],
16
+ "scripts": {
17
+ "build": "node ./scripts/build-package.js",
18
+ "build:linux": "node ./scripts/build-package.js --target linux-x64",
19
+ "build:linux:cross": "node ./scripts/build-package.js --target linux-x64 --linux-builder cargo",
20
+ "build:linux:docker": "node ./scripts/build-package.js --target linux-x64 --linux-builder docker",
21
+ "build:mac": "node ./scripts/build-package.js --targets mac",
22
+ "build:mac:zig": "node ./scripts/build-package.js --targets mac --mac-builder zig",
23
+ "build:mac:x64": "node ./scripts/build-package.js --target darwin-x64",
24
+ "build:mac:arm64": "node ./scripts/build-package.js --target darwin-arm64",
25
+ "build:win-linux": "node ./scripts/build-package.js --targets win-linux",
26
+ "build:all": "node ./scripts/build-package.js --targets all",
27
+ "package": "npm run build && node ./scripts/pack-npm.js",
28
+ "package:linux": "npm run build:linux && node ./scripts/pack-npm.js",
29
+ "package:linux:cross": "npm run build:linux:cross && node ./scripts/pack-npm.js",
30
+ "package:linux:docker": "npm run build:linux:docker && node ./scripts/pack-npm.js",
31
+ "package:mac": "npm run build:mac && node ./scripts/pack-npm.js",
32
+ "package:mac:zig": "npm run build:mac:zig && node ./scripts/pack-npm.js",
33
+ "package:mac:x64": "npm run build:mac:x64 && node ./scripts/pack-npm.js",
34
+ "package:mac:arm64": "npm run build:mac:arm64 && node ./scripts/pack-npm.js",
35
+ "package:win-linux": "npm run build:win-linux && node ./scripts/pack-npm.js",
36
+ "package:all": "npm run build:all && node ./scripts/pack-npm.js",
37
+ "pack": "npm run package",
38
+ "publish:npm": "npm run build && npm publish ./dist/npm --access public",
39
+ "publish:npm:all": "npm run build:all && npm publish ./dist/npm --access public"
40
+ },
41
+ "engines": {
42
+ "node": ">=18"
43
+ },
44
+ "license": "MIT"
45
+ }