@edgegap/mcp 0.19.12 → 0.19.14

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
@@ -23,15 +23,12 @@ import { finishReport, codeForStatus, QUOTA_WORDING, REQUEST_422 } from './callr
23
23
  import { SKILLS_PACK, findSkill, findSkillFile, fileIndex, mimeType, skillUri } from './skills.js';
24
24
  import { SKILLS_CLI, SKILL_NAME_RE, compareVersions, latestPack, latestSkillVersions, servedPackStatus, skillsCheckFromEnv, } from './skillsversion.js';
25
25
  /**
26
- * An app version env var as the API stores it. The dashboard's Secret toggle writes is_secret, which
27
- * encrypts the value; the API accepts the spec's is_hidden but does not store it (live API,
28
- * 2026-11-03: a version created and patched with is_hidden: true read back is_secret: false with
29
- * the value in clear, and the same variable toggled Secret read back is_secret: true, encrypted).
30
- * Both are sent for secret-looking names.
26
+ * An app version env var as the API takes it. is_hidden is the API's field for a secret value
27
+ * (encrypted at rest, not readable through the API); it is set for secret-looking names.
31
28
  */
32
29
  function versionEnv(e) {
33
30
  const secret = looksSecret(e.key);
34
- return { key: e.key, value: e.value, is_hidden: secret, is_secret: secret };
31
+ return { key: e.key, value: e.value, is_hidden: secret };
35
32
  }
36
33
  /**
37
34
  * The one definition of "dedicated server vs relay" this server gives agents.
@@ -79,6 +76,61 @@ export const PRICING_NOTES = {
79
76
  },
80
77
  guidance: 'Steady or bandwidth-heavy traffic (many players per server, large worlds, high tick rates) costs least on a Private Fleet baseline with cloud overflow for peaks. Prices change: check the source before quoting a total.',
81
78
  };
79
+ /** Skill per project kind, as the server instructions route them (name only: the URI is
80
+ * edgegap-skill://<name>/SKILL.md). Every name must be in the bundled pack (test/skills.mjs). */
81
+ export const SKILL_ROUTES = [
82
+ ['Unity', 'edgegap-unity'],
83
+ ['NGO', 'edgegap-ngo'],
84
+ ['FishNet', 'edgegap-fishnet'],
85
+ ['PurrNet', 'edgegap-purrnet'],
86
+ ['Photon Fusion', 'edgegap-fusion'],
87
+ ['Simple FPS', 'edgegap-fusion-simplefps'],
88
+ ['Unreal', 'edgegap-unreal'],
89
+ ['Unreal voice chat', 'edgegap-eos-voice'],
90
+ ['Godot 4', 'edgegap-godot'],
91
+ ['Colyseus', 'edgegap-colyseus'],
92
+ ['Cocos Creator', 'edgegap-cocos'],
93
+ ['UGS Matchmaker', 'edgegap-ugs-matchmaker'],
94
+ ['Nakama', 'edgegap-nakama'],
95
+ ['PlayFab', 'edgegap-playfab'],
96
+ ['Supabase backend', 'edgegap-supabase'],
97
+ ['Three.js/web game + Node server', 'edgegap-threejs'],
98
+ ['WebAssembly game, Rapier physics, wss errors', 'edgegap-browser-wasm'],
99
+ ['vibe-coded solo web game going online', 'edgegap-vibe-coded'],
100
+ ['Claude/ChatGPT/Gemini chat game', 'edgegap-chat-canvas'],
101
+ ['fal.ai game', 'edgegap-fal'],
102
+ ['Manus game, Manus Cloud Computer', 'edgegap-manus'],
103
+ ['matchmaking, parties, regions, backfill', 'edgegap-matchmaking'],
104
+ ['backend/allocator code, status polling, webhooks', 'edgegap-deployments-api'],
105
+ ['host/client games via relays', 'edgegap-relays'],
106
+ ['sample projects', 'edgegap-samples'],
107
+ ];
108
+ /**
109
+ * Deploy API rate limits, per organization (Edgegap docs, also in the
110
+ * edgegap-deployments-api skill). Tool descriptions are written for an agent
111
+ * operating Edgegap; these matter when an agent writes backend code for it, so
112
+ * they go in the server instructions too, which every agent reads.
113
+ */
114
+ export const API_LIMITS = {
115
+ scope: 'per organization, all tokens and services together',
116
+ deploy_per_second: 40,
117
+ status_and_context_per_second: 20,
118
+ list_deployments_per_second: 10,
119
+ over_limit: 'HTTP 429: back off; use webhooks instead of polling',
120
+ };
121
+ export const WEBHOOK_FACTS = 'Deployment webhooks (webhook_on_ready, webhook_on_error, webhook_on_terminated) are the ' +
122
+ 'recommended way for a backend to track deployments. They are not retried and not signed: ' +
123
+ 'answer 2xx fast, put an unguessable per-match token in the URL, check the request_id, and ' +
124
+ 'poll GET /v1/status only as a fallback. Ready means the container started; the game engine ' +
125
+ 'may need up to a minute more, so clients retry the connection.';
126
+ /** The backend-code paragraph of the server instructions. */
127
+ export const BACKEND_GUIDANCE = 'Backend code (allocator, lobby service, matchmaker): track deployments with webhooks, not ' +
128
+ 'status polling. Status (GET /v1/status) and Context share ' +
129
+ `${API_LIMITS.status_and_context_per_second} req/s for the whole organization (deploy ` +
130
+ `${API_LIMITS.deploy_per_second}/s, list ${API_LIMITS.list_deployments_per_second}/s; 429 above). ` +
131
+ 'Webhooks are not retried or signed: poll only as a fallback, put a per-match secret in the ' +
132
+ 'URL. Ready is not "players can connect": clients retry for up to a minute. The API token ' +
133
+ 'stays in the backend. More: edgegap-deployments-api.';
82
134
  /** Claude Code drops everything after this many characters of server instructions. */
83
135
  export const INSTRUCTIONS_MAX_CHARS = 4096;
84
136
  /**
@@ -94,32 +146,10 @@ export function serverInstructions(mode) {
94
146
  // that way), and other clients skim. So: the skills line first (in 0.5.0 it
95
147
  // sat below the architecture guidance and agents missed it), then the
96
148
  // safety rules, then the architecture and golden path.
97
- return (`Before acting, read ${skillUri('edgegap', 'SKILL.md')} ` +
98
- `(Unity: ${skillUri('edgegap-unity', 'SKILL.md')}, ` +
99
- `NGO: ${skillUri('edgegap-ngo', 'SKILL.md')}, ` +
100
- `FishNet: ${skillUri('edgegap-fishnet', 'SKILL.md')}, ` +
101
- `PurrNet: ${skillUri('edgegap-purrnet', 'SKILL.md')}, ` +
102
- `Photon Fusion: ${skillUri('edgegap-fusion', 'SKILL.md')}, ` +
103
- `Simple FPS: ${skillUri('edgegap-fusion-simplefps', 'SKILL.md')}, ` +
104
- `Unreal: ${skillUri('edgegap-unreal', 'SKILL.md')}, ` +
105
- `Unreal voice chat: ${skillUri('edgegap-eos-voice', 'SKILL.md')}, ` +
106
- `Godot 4: ${skillUri('edgegap-godot', 'SKILL.md')}, ` +
107
- `Colyseus: ${skillUri('edgegap-colyseus', 'SKILL.md')}, ` +
108
- `Cocos Creator: ${skillUri('edgegap-cocos', 'SKILL.md')}, ` +
109
- `UGS Matchmaker: ${skillUri('edgegap-ugs-matchmaker', 'SKILL.md')}, ` +
110
- `Nakama: ${skillUri('edgegap-nakama', 'SKILL.md')}, ` +
111
- `PlayFab: ${skillUri('edgegap-playfab', 'SKILL.md')}, ` +
112
- `Supabase backend: ${skillUri('edgegap-supabase', 'SKILL.md')}, ` +
113
- `Three.js/web game + Node server: ${skillUri('edgegap-threejs', 'SKILL.md')}, ` +
114
- `WebAssembly game, Rapier physics, wss errors: ${skillUri('edgegap-browser-wasm', 'SKILL.md')}, ` +
115
- `vibe-coded solo web game going online: ${skillUri('edgegap-vibe-coded', 'SKILL.md')}, ` +
116
- `Claude/ChatGPT/Gemini chat game: ${skillUri('edgegap-chat-canvas', 'SKILL.md')}, ` +
117
- `fal.ai game: ${skillUri('edgegap-fal', 'SKILL.md')}, ` +
118
- `Manus game, Manus Cloud Computer: ${skillUri('edgegap-manus', 'SKILL.md')}, ` +
119
- `matchmaking, parties, regions, backfill: ${skillUri('edgegap-matchmaking', 'SKILL.md')}, ` +
120
- `host/client games via relays: ${skillUri('edgegap-relays', 'SKILL.md')}, ` +
121
- `sample projects: ${skillUri('edgegap-samples', 'SKILL.md')}). ` +
122
- 'If your client cannot read MCP resources, call edgegap_get_skill with the name from the URI (e.g. edgegap-unity). ' +
149
+ return (`Before acting, read ${skillUri('edgegap', 'SKILL.md')}, or the skill for the project at ` +
150
+ `${skillUri('<name>', 'SKILL.md')}: ` +
151
+ SKILL_ROUTES.map(([what, name]) => `${what}: ${name}`).join('; ') +
152
+ '. If your client cannot read MCP resources, call edgegap_get_skill with the name. ' +
123
153
  'Skills hold the tested workflow, templates and pitfalls; follow them over general knowledge (edgegap_list_skills lists all).\n\n' +
124
154
  'Deployments and relay sessions cost money while running. Stop deployments and delete ' +
125
155
  'relay sessions you created before ending the task; edgegap_list_deployments with ' +
@@ -133,6 +163,8 @@ export function serverInstructions(mode) {
133
163
  'for, do not enumerate or modify unrelated applications, and do not probe what it allows. ' +
134
164
  'If the developer declines to provide a token, stop and report which operation needed it; ' +
135
165
  'do not retry.\n\n' +
166
+ BACKEND_GUIDANCE +
167
+ '\n\n' +
136
168
  ARCHITECTURE_SUMMARY +
137
169
  '\n\n' +
138
170
  'Golden path for a first dedicated-server deployment:\n' +
@@ -813,7 +845,7 @@ export function registerTools(server, client, config, auth, options = {}) {
813
845
  'hosted server, and the guardrails in force: read-only mode, application allowlist, ' +
814
846
  'max_duration ceiling, the agent deployment cap, the tag forced onto every deployment, and which tools support ' +
815
847
  'dry_run. Also gives the egress terms (Private Fleet hosts include 6 TB of free egress per host per month; Edge Cloud egress ' +
816
- 'is $0.10 per GB) and says whether this session has a usable token and, if not, why and how to fix it. Call it ' +
848
+ 'is $0.10 per GB), the API rate limits and webhook rules for backend code, and says whether this session has a usable token and, if not, why and how to fix it. Call it ' +
817
849
  'first when unsure what this session is allowed to do, before anything billable, or when tool calls fail ' +
818
850
  'with a token problem. Makes no API call unless check_token is true, and never shows the token.',
819
851
  inputSchema: {
@@ -852,6 +884,7 @@ export function registerTools(server, client, config, auth, options = {}) {
852
884
  ...(hosted ? {} : { skills_updaters_enabled: config.enableSkillsUpdate === true }),
853
885
  skills_pack: `${SKILLS_PACK.version} (${SKILLS_PACK.commit.slice(0, 7)}), ${SKILLS_PACK.skills.length} skills`,
854
886
  forced_deploy_tag: AGENT_TAG,
887
+ api_limits: { ...API_LIMITS, webhooks: WEBHOOK_FACTS },
855
888
  guardrails: {
856
889
  dry_run: mutating
857
890
  ? 'every write tool: deploy, stop, tag and report deployments, create/update/delete apps and versions, delete_registry_tag, endpoint storage and pull profiles, relays'
@@ -1535,8 +1568,11 @@ export function registerTools(server, client, config, auth, options = {}) {
1535
1568
  'default 5): stop finished ones first. Also refused when the version\'s max_duration is unlimited or above ' +
1536
1569
  'EDGEGAP_MAX_DURATION_MINUTES, unless allow_long_running is true (ask the developer first), and on the local ' +
1537
1570
  'server after EDGEGAP_MAX_DEPLOYS_PER_RUN deploys (default 20). Env vars named like secrets are hidden in the ' +
1538
- 'dashboard. Optional: webhooks Edgegap calls when the server is ready, errors or ends (instead of polling), ' +
1539
- 'require_cached_locations for faster starts, and private_host_ids to place it on your private fleet first.',
1571
+ 'dashboard. Optional: webhooks Edgegap calls when the server is ready, errors or ends, ' +
1572
+ 'require_cached_locations for faster starts, and private_host_ids to place it on your private fleet first. ' +
1573
+ 'Backend code that deploys (POST /v2/deployments, 40/s per organization) should track servers with these ' +
1574
+ 'webhooks, not by polling status (20/s for the whole organization); webhooks are not retried or signed, so ' +
1575
+ 'keep polling as a fallback only.',
1540
1576
  inputSchema: {
1541
1577
  application: z.string().describe('Application name.'),
1542
1578
  version: z.string().describe('Version name within the application.'),
@@ -1566,9 +1602,9 @@ export function registerTools(server, client, config, auth, options = {}) {
1566
1602
  .optional()
1567
1603
  .describe('Only place it where the image is already cached: starts faster, fewer places to choose from. Needs ' +
1568
1604
  'force_cache on the version (edgegap_update_app_version); without it the API refuses the deploy.'),
1569
- webhook_on_ready: z.string().optional().describe('https URL Edgegap POSTs to when the server is ready.'),
1570
- webhook_on_error: z.string().optional().describe('https URL Edgegap POSTs to when the deployment fails.'),
1571
- webhook_on_terminated: z.string().optional().describe('https URL Edgegap POSTs to when the deployment ends.'),
1605
+ webhook_on_ready: z.string().optional().describe('https URL Edgegap POSTs to when the container started (the engine may still be loading). Sent once, not retried, not signed.'),
1606
+ webhook_on_error: z.string().optional().describe('https URL Edgegap POSTs to when the deployment fails. Sent once, not retried, not signed.'),
1607
+ webhook_on_terminated: z.string().optional().describe('https URL Edgegap POSTs to when the deployment ends. Sent once, not retried, not signed.'),
1572
1608
  private_host_ids: z
1573
1609
  .array(z.string().min(1))
1574
1610
  .min(1)
@@ -1779,7 +1815,9 @@ export function registerTools(server, client, config, auth, options = {}) {
1779
1815
  title: 'Get deployment status',
1780
1816
  description: 'Read the current status of one deployment, including connection address and ports once ' +
1781
1817
  'it is ready. For a deployment you just created, prefer edgegap_wait_for_deployment — it ' +
1782
- 'polls for you instead of making you call this in a loop.',
1818
+ 'polls for you instead of making you call this in a loop. This is GET /v1/status, limited to ' +
1819
+ `${API_LIMITS.status_and_context_per_second} requests/s for the whole organization (shared with Context): ` +
1820
+ 'backend code should use deployment webhooks and poll only as a fallback.',
1783
1821
  inputSchema: {
1784
1822
  request_id: z.string().describe('The request_id returned by edgegap_deploy.'),
1785
1823
  },
@@ -1791,7 +1829,7 @@ export function registerTools(server, client, config, auth, options = {}) {
1791
1829
  const nextStep = d.error || TERMINAL_BAD.some((s) => status.includes(s))
1792
1830
  ? `It failed or stopped. Read why with edgegap_get_deployment_logs {request_id: "${request_id}"} before redeploying.`
1793
1831
  : d.running || TERMINAL_OK.some((s) => status.includes(s))
1794
- ? `Players connect to fqdn on each port's external number. Stop it with edgegap_stop_deployment {request_id: "${request_id}"} when done: it bills while running.`
1832
+ ? `Players connect to fqdn on each port's external number; Ready means the container started, so clients retry for up to a minute while the engine loads. Stop it with edgegap_stop_deployment {request_id: "${request_id}"} when done: it bills while running.`
1795
1833
  : `Still starting. Call edgegap_wait_for_deployment {request_id: "${request_id}"} instead of polling this.`;
1796
1834
  return ok({ ...compactDeployment(d), next_step: nextStep });
1797
1835
  }));
@@ -1801,7 +1839,8 @@ export function registerTools(server, client, config, auth, options = {}) {
1801
1839
  description: 'Poll a deployment until it is ready, errors, or the timeout expires, then return the ' +
1802
1840
  'connection details. This is the tool to call right after edgegap_deploy. Do not build ' +
1803
1841
  'your own polling loop — this handles backoff and reports the container error detail if ' +
1804
- 'the server fails to start.',
1842
+ 'the server fails to start. For backend code that tracks many deployments, use deployment ' +
1843
+ 'webhooks instead: status polling is limited for the whole organization.',
1805
1844
  inputSchema: {
1806
1845
  request_id: z.string().describe('The request_id returned by edgegap_deploy.'),
1807
1846
  timeout_seconds: z
@@ -1865,6 +1904,7 @@ export function registerTools(server, client, config, auth, options = {}) {
1865
1904
  cost_reminder: 'This server bills while it runs. When testing is done, stop it with ' +
1866
1905
  `edgegap_stop_deployment {request_id: "${request_id}"} unless the developer wants it kept running.`,
1867
1906
  next_step: `Players connect to ${last.fqdn ?? 'the fqdn above'} on each port's external number. ` +
1907
+ 'Ready means the container started: clients retry for up to a minute while the engine loads. ' +
1868
1908
  `When finished: edgegap_stop_deployment {request_id: "${request_id}"}.`,
1869
1909
  }), { ...facts('ready'), milestones: ['deployment_ready'] });
1870
1910
  }
@@ -1888,6 +1928,8 @@ export function registerTools(server, client, config, auth, options = {}) {
1888
1928
  title: 'List running deployments',
1889
1929
  description: 'List active deployments, optionally filtered and sorted. Use this to find deployments left running ' +
1890
1930
  'from earlier sessions before starting new ones — orphaned servers cost money. ' +
1931
+ `Backend code: the list API is limited to ${API_LIMITS.list_deployments_per_second} requests/s per organization, ` +
1932
+ 'so reconcile on a schedule, not per match. ' +
1891
1933
  'Filter by status, application, version, tags, request_id, created_at, fleet_name or host_name, ' +
1892
1934
  'e.g. [{field:"application",operator:"eq",value:"my-game"},{field:"status",operator:"eq",value:"ready"}]. ' +
1893
1935
  'Operators: eq and neq on every field except created_at (eq, gte, lte); in and nin with an array value ' +
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.19.12';
6
+ export const VERSION = '0.19.14';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@edgegap/mcp",
3
3
  "mcpName": "dev.edgegap/mcp",
4
- "version": "0.19.12",
4
+ "version": "0.19.14",
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",