Skip to content

Commit 5693aa3

Browse files
Geekurclaude
andcommitted
2.6.1: discipline guard — public MCP build FAILS if it ever calls a gated path; soften sign-in desc
Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
1 parent e173213 commit 5693aa3

5 files changed

Lines changed: 11 additions & 5 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ _16 tools:_
6464
- `create_tournament_invite` — Create a shareable invite (QR/link) for an INDIVIDUAL tournament or round. Everyone who redeems the same invite joins the SAME event/session = the group, linked. max_uses caps the size (foursome=4). Requires OPENGOLFAPI_KEY.
6565
- `join_tournament` — Join a player into a tournament/round by redeeming its invite token. The player lands in the shared event = part of the field. Handicap is optional: gross by default (no handicap needed); if the player has one it auto-applies for net. Requires OPENGOLFAPI_KEY.
6666
- `request_sign_in_code` — Start "Sign in with OpenGolf" for a player: emails them a 6-digit code. No API key needed — the email authenticates them. They read you the code, then call complete_sign_in.
67-
- `complete_sign_in` — Finish "Sign in with OpenGolf": exchange the player's 6-digit code for their OpenGolf ID access token + portable player_id. Use the returned access_token as the X-OpenGolf-Token header to act AS the player — log scores, run/settle events you organize, grant awards (all scope-gated). scopes: space-separated, e.g. "identity events:settle awards:grant" (default "identity").
67+
- `complete_sign_in` — Finish "Sign in with OpenGolf": exchange the player's 6-digit code for their OpenGolf ID access token + portable player_id. Use the returned access_token as the X-OpenGolf-Token header to act AS the player, within whatever scopes you were granted. scopes: space-separated (default "identity").
6868
- `how_to_build` — The safe playbook for building on OpenGolfAPI and contributing data the right way. Call once before contributing.
6969
<!-- TOOLS:END -->
7070

gen-manifest.mjs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ const tools = [...src.matchAll(/server\.tool\(\s*'([a-z_]+)',\s*'((?:[^'\\]|\\.)
1717
.map((m) => ({ name: m[1], description: m[2].replace(/\\'/g, "'") }));
1818
if (!tools.length) { console.error('gen-manifest: found 0 tools — aborting (regex drift?)'); process.exit(1); }
1919

20+
// CORE DISCIPLINE: nothing paid/gated/geo is ever public. Fail the build if the public MCP calls a gated
21+
// path (compute/events/awards/geo/ads/surface/settle/stats). The public MCP is the OPEN standard ONLY.
22+
const calls = [...src.matchAll(/api(?:Get|Post)[^(]*\(\s*[`'"]([^`'"]+)/g)].map((m) => m[1]);
23+
const gated = calls.filter((p) => /\/(compute|events|awards|geo|ads|surface)\b|settle|players\/[^/]*\/stats/.test(p));
24+
if (gated.length) { console.error('gen-manifest: PUBLIC MCP calls GATED paths — paid/gated must NEVER be public:', gated.join(', '), '\nAborting.'); process.exit(1); }
25+
2026
// 1) server.json — keep version in sync (the official MCP registry schema is strict: no `tools` field,
2127
// camelCase only). Tools live in the README (below) + are introspected from the package at runtime.
2228
const sjPath = join(dir, 'server.json');

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@opengolfapi/mcp-server",
3-
"version": "2.6.0",
3+
"version": "2.6.1",
44
"description": "Golf for AI agents — every US course free, plus open contribution (OpenShot/Moments), portable identity & tournaments. The open data layer for golf.",
55
"mcpName": "io.github.opengolfapi/mcp-server",
66
"type": "module",

server.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
33
"name": "io.github.opengolfapi/mcp-server",
44
"description": "Golf for AI agents — every US course free, plus open contribution, identity & tournaments.",
5-
"version": "2.6.0",
5+
"version": "2.6.1",
66
"repository": {
77
"url": "https://github.com/opengolfapi/mcp-server",
88
"source": "github"
@@ -12,7 +12,7 @@
1212
{
1313
"registryType": "npm",
1414
"identifier": "@opengolfapi/mcp-server",
15-
"version": "2.6.0",
15+
"version": "2.6.1",
1616
"transport": {
1717
"type": "stdio"
1818
},

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -578,7 +578,7 @@ server.tool(
578578

579579
server.tool(
580580
'complete_sign_in',
581-
'Finish "Sign in with OpenGolf": exchange the player\'s 6-digit code for their OpenGolf ID access token + portable player_id. Use the returned access_token as the X-OpenGolf-Token header to act AS the player — log scores, run/settle events you organize, grant awards (all scope-gated). scopes: space-separated, e.g. "identity events:settle awards:grant" (default "identity").',
581+
'Finish "Sign in with OpenGolf": exchange the player\'s 6-digit code for their OpenGolf ID access token + portable player_id. Use the returned access_token as the X-OpenGolf-Token header to act AS the player, within whatever scopes you were granted. scopes: space-separated (default "identity").',
582582
{
583583
email: z.string(), code: z.string().describe('the 6-digit code from the email'),
584584
scopes: z.string().optional().describe('space-separated OAuth scopes (default "identity")'),

0 commit comments

Comments
 (0)