@edgegap/mcp 0.16.3 → 0.17.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/dist/tools.js CHANGED
@@ -995,6 +995,9 @@ export function registerTools(server, client, config, auth, options = {}) {
995
995
  'deploy time. Refused, with nothing sent, for the "latest" or an empty docker tag (use a build ID so ' +
996
996
  'deployments are reproducible) and for a docker_image that also holds a registry host or tag. ' +
997
997
  'Env vars named like secrets (TOKEN, SECRET, PASSWORD, API_KEY…) are hidden in the dashboard. ' +
998
+ 'Images on registry.edgegap.com need no registry login: leave registry_username and ' +
999
+ 'registry_token out and the version gets the organization\'s own registry login ' +
1000
+ '(registry_profile "Edgegap"). ' +
998
1001
  'When copying an existing version, copy only non-secret settings: the API returns "' +
999
1002
  ENCRYPTED_PLACEHOLDER + '" for its registry login and secret env values, and that ' +
1000
1003
  'placeholder is refused here.',
@@ -1035,8 +1038,9 @@ export function registerTools(server, client, config, auth, options = {}) {
1035
1038
  registry_username: z
1036
1039
  .string()
1037
1040
  .optional()
1038
- .describe('Registry username. Needed for private images, including images in your own ' +
1039
- 'registry.edgegap.com project: Edgegap pulls with this login, not your API token.'),
1041
+ .describe('Registry username, for private images on other registries (Docker Hub, GHCR, ECR...). ' +
1042
+ 'Leave it out for registry.edgegap.com: Edgegap then pulls with the organization\'s own ' +
1043
+ 'registry login (registry_profile "Edgegap").'),
1040
1044
  registry_token: z.string().optional().describe('Registry password or token.'),
1041
1045
  max_duration_minutes: z
1042
1046
  .number()
@@ -1104,7 +1108,10 @@ export function registerTools(server, client, config, auth, options = {}) {
1104
1108
  const requested = args.max_duration_minutes ?? config.maxDurationCeiling;
1105
1109
  const capped = Math.min(requested, config.maxDurationCeiling);
1106
1110
  const hasRegistryLogin = Boolean(args.registry_username && args.registry_token);
1107
- const edgegapRegistry = /(^|\/\/)registry\.edgegap\.com\/?$/.test(args.docker_repository.trim());
1111
+ // Edgegap attaches the org's own pull login when asked to (live API,
1112
+ // 2026-11-04). Only without a login of the caller's: the profile is
1113
+ // refused for other registries, and a login given wins.
1114
+ const useProfile = isEdgegapRegistry(args.docker_repository) && !args.registry_username && !args.registry_token;
1108
1115
  const body = {
1109
1116
  name: args.name,
1110
1117
  is_active: true,
@@ -1115,6 +1122,7 @@ export function registerTools(server, client, config, auth, options = {}) {
1115
1122
  docker_tag: args.docker_tag,
1116
1123
  private_username: args.registry_username,
1117
1124
  private_token: args.registry_token,
1125
+ ...(useProfile ? { registry_profile: EDGEGAP_REGISTRY_PROFILE } : {}),
1118
1126
  verify_image: args.verify_image ?? false,
1119
1127
  ...(args.restart_policy ? { restart_policy: args.restart_policy } : {}),
1120
1128
  ...(args.endpoint_storage ? { endpoint_storage: args.endpoint_storage } : {}),
@@ -1147,11 +1155,9 @@ export function registerTools(server, client, config, auth, options = {}) {
1147
1155
  throw err;
1148
1156
  }
1149
1157
  const notes = [];
1150
- if (edgegapRegistry && !hasRegistryLogin) {
1151
- notes.push('No registry login was set. Edgegap pulls images from registry.edgegap.com with the ' +
1152
- 'version\'s registry login, not your API token, so deployments of this version will ' +
1153
- 'likely fail to pull (424) until the developer adds the Container Registry username ' +
1154
- 'and token to this version in the dashboard.');
1158
+ if (!useProfile && !hasRegistryLogin && (args.registry_username || args.registry_token)) {
1159
+ notes.push('Only one of registry_username and registry_token was given, so the version has no complete ' +
1160
+ 'registry login and deployments will likely fail to pull (424). Pass both.');
1155
1161
  }
1156
1162
  if (!args.restart_policy) {
1157
1163
  notes.push('restart_policy was not set, so Edgegap restarts the server whenever its process exits ("always"). ' +
@@ -1166,11 +1172,16 @@ export function registerTools(server, client, config, auth, options = {}) {
1166
1172
  return withMeta(ok({
1167
1173
  created: `${args.application}/${res.version?.name ?? args.name}`,
1168
1174
  max_duration_minutes: capped,
1175
+ registry_login: useProfile
1176
+ ? 'Edgegap registry login (registry_profile "Edgegap")'
1177
+ : hasRegistryLogin
1178
+ ? 'the registry_username/registry_token given'
1179
+ : 'none: the image must be public',
1169
1180
  capped_by_server: capped < requested ? config.maxDurationCeiling : undefined,
1170
1181
  notes: notes.length ? notes : undefined,
1171
1182
  next_step: `Call edgegap_deploy with application "${args.application}" and version ` +
1172
1183
  `"${res.version?.name ?? args.name}" to start a server, then edgegap_wait_for_deployment.`,
1173
- }), { milestones: ['app_version_created'], props: { registry_login_set: hasRegistryLogin } });
1184
+ }), { milestones: ['app_version_created'], props: { registry_login_set: hasRegistryLogin, registry_profile: useProfile } });
1174
1185
  }));
1175
1186
  }
1176
1187
  // --------------------------------------------------------------- 4b ----
@@ -1178,7 +1189,8 @@ export function registerTools(server, client, config, auth, options = {}) {
1178
1189
  tool('edgegap_update_app_version', {
1179
1190
  title: 'Update an application version',
1180
1191
  description: 'Change settings on an existing version instead of creating a new one: point it at a new ' +
1181
- 'image tag, turn it on or off, change max_duration, set the registry login, turn on image ' +
1192
+ 'image tag, turn it on or off, change max_duration, set the registry login (the API cannot add ' +
1193
+ 'registry_profile "Edgegap" to an existing version: create a new version for that), turn on image ' +
1182
1194
  'caching (force_cache: Edgegap pre-loads the image so deployments start faster), set ' +
1183
1195
  'the restart policy, or set the shutdown grace period. Only the fields you pass change. Deployments already running ' +
1184
1196
  'keep their old settings; new deployments get the new ones. Same refusals as ' +
@@ -2223,8 +2235,6 @@ export function registerTools(server, client, config, auth, options = {}) {
2223
2235
  docker_repository: host,
2224
2236
  docker_image: `${creds.project}/${image}`,
2225
2237
  docker_tag: buildTag,
2226
- registry_username: creds.username,
2227
- registry_token: '<the token above>',
2228
2238
  },
2229
2239
  next_step: 'Export the token as EDGEGAP_REGISTRY_TOKEN in the shell that runs docker login ' +
2230
2240
  '(it never needs to appear in a command line or file), then build and push. ' +
@@ -3569,6 +3579,12 @@ function closestSkill(input, names) {
3569
3579
  names.find((n) => n.replace(/^edgegap-?/, '').startsWith(wanted)) ??
3570
3580
  names.find((n) => wanted.includes(n.replace(/^edgegap-/, '')) && n !== 'edgegap'));
3571
3581
  }
3582
+ /** What POST /v1/app/{app}/version takes to pull with the org's own registry login. Case-sensitive. */
3583
+ const EDGEGAP_REGISTRY_PROFILE = 'Edgegap';
3584
+ /** registry.edgegap.com, or a staging registry such as staging-registry.edgegap.dev. */
3585
+ function isEdgegapRegistry(repository) {
3586
+ return /^(https?:\/\/)?([a-z0-9-]+-)?registry\.edgegap\.(com|dev)\/?$/i.test(repository.trim());
3587
+ }
3572
3588
  function registryCredentialsUnavailable(imageName, tag) {
3573
3589
  const image = imageName ?? '<image-name>';
3574
3590
  const buildTag = tag ?? '<unique-build-tag>';
@@ -3585,8 +3601,8 @@ function registryCredentialsUnavailable(imageName, tag) {
3585
3601
  `4. docker push ${ref}\n` +
3586
3602
  `5. Confirm with edgegap_list_registry_tags (image_name "${image}", without the project).\n` +
3587
3603
  '6. Call edgegap_create_app_version with docker_repository "registry.edgegap.com", ' +
3588
- `docker_image "<project>/${image}", docker_tag "${buildTag}", and the same username and ` +
3589
- 'token as registry_username/registry_token.\n\n' +
3604
+ `docker_image "<project>/${image}", docker_tag "${buildTag}". Leave registry_username and ` +
3605
+ 'registry_token out: the version gets the organization\'s own registry login.\n\n' +
3590
3606
  'Or push to any other registry Edgegap can pull from (Docker Hub, GHCR, ECR, GCR, GitLab) ' +
3591
3607
  'and pass its registry_username/registry_token to edgegap_create_app_version.');
3592
3608
  }
@@ -3600,13 +3616,11 @@ function registryLoginNeeded(repository, hadLogin) {
3600
3616
  'created. ' +
3601
3617
  (hadLogin
3602
3618
  ? 'The registry_username/registry_token given were rejected: check them.'
3603
- : 'Edgegap pulls images with a registry login set on the version, not your API token — ' +
3604
- 'this applies to your own registry.edgegap.com project too.') +
3619
+ : 'Edgegap pulls images from this registry with a login set on the version, not your API token.') +
3605
3620
  '\n\nOptions:\n' +
3606
3621
  '1. Create the version again with verify_image false, then have the developer open it in ' +
3607
- `the dashboard (${DASHBOARD_URL}) and add the registry username and token (for ` +
3608
- 'registry.edgegap.com, the ones on the Container Registry page). Deployments fail to pull ' +
3609
- 'until they do.\n' +
3622
+ `the dashboard (${DASHBOARD_URL}) and add the registry username and token. Deployments fail ` +
3623
+ 'to pull until they do. (Images on registry.edgegap.com need neither: push there instead.)\n' +
3610
3624
  '2. If the developer chooses to give them to you, pass registry_username and registry_token. ' +
3611
3625
  'They are registry-scoped, not the org API token. Do not write them into files.');
3612
3626
  }
package/dist/version.js CHANGED
@@ -3,4 +3,4 @@
3
3
  * call, and by edgegap_context. Keep in step with package.json and server.json;
4
4
  * test/package.mjs fails the build when they disagree.
5
5
  */
6
- export const VERSION = '0.16.3';
6
+ export const VERSION = '0.17.1';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@edgegap/mcp",
3
3
  "mcpName": "dev.edgegap/mcp",
4
- "version": "0.16.3",
4
+ "version": "0.17.1",
5
5
  "description": "Check, push, and deploy game servers on Edgegap from your coding agent, with relays for P2P games. Runs locally; your API token never leaves your machine.",
6
6
  "scripts": {
7
7
  "prebuild": "rm -rf dist",