@edgegap/mcp 0.19.13 → 0.19.15

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
@@ -76,6 +76,61 @@ export const PRICING_NOTES = {
76
76
  },
77
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.',
78
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.';
79
134
  /** Claude Code drops everything after this many characters of server instructions. */
80
135
  export const INSTRUCTIONS_MAX_CHARS = 4096;
81
136
  /**
@@ -91,32 +146,10 @@ export function serverInstructions(mode) {
91
146
  // that way), and other clients skim. So: the skills line first (in 0.5.0 it
92
147
  // sat below the architecture guidance and agents missed it), then the
93
148
  // safety rules, then the architecture and golden path.
94
- return (`Before acting, read ${skillUri('edgegap', 'SKILL.md')} ` +
95
- `(Unity: ${skillUri('edgegap-unity', 'SKILL.md')}, ` +
96
- `NGO: ${skillUri('edgegap-ngo', 'SKILL.md')}, ` +
97
- `FishNet: ${skillUri('edgegap-fishnet', 'SKILL.md')}, ` +
98
- `PurrNet: ${skillUri('edgegap-purrnet', 'SKILL.md')}, ` +
99
- `Photon Fusion: ${skillUri('edgegap-fusion', 'SKILL.md')}, ` +
100
- `Simple FPS: ${skillUri('edgegap-fusion-simplefps', 'SKILL.md')}, ` +
101
- `Unreal: ${skillUri('edgegap-unreal', 'SKILL.md')}, ` +
102
- `Unreal voice chat: ${skillUri('edgegap-eos-voice', 'SKILL.md')}, ` +
103
- `Godot 4: ${skillUri('edgegap-godot', 'SKILL.md')}, ` +
104
- `Colyseus: ${skillUri('edgegap-colyseus', 'SKILL.md')}, ` +
105
- `Cocos Creator: ${skillUri('edgegap-cocos', 'SKILL.md')}, ` +
106
- `UGS Matchmaker: ${skillUri('edgegap-ugs-matchmaker', 'SKILL.md')}, ` +
107
- `Nakama: ${skillUri('edgegap-nakama', 'SKILL.md')}, ` +
108
- `PlayFab: ${skillUri('edgegap-playfab', 'SKILL.md')}, ` +
109
- `Supabase backend: ${skillUri('edgegap-supabase', 'SKILL.md')}, ` +
110
- `Three.js/web game + Node server: ${skillUri('edgegap-threejs', 'SKILL.md')}, ` +
111
- `WebAssembly game, Rapier physics, wss errors: ${skillUri('edgegap-browser-wasm', 'SKILL.md')}, ` +
112
- `vibe-coded solo web game going online: ${skillUri('edgegap-vibe-coded', 'SKILL.md')}, ` +
113
- `Claude/ChatGPT/Gemini chat game: ${skillUri('edgegap-chat-canvas', 'SKILL.md')}, ` +
114
- `fal.ai game: ${skillUri('edgegap-fal', 'SKILL.md')}, ` +
115
- `Manus game, Manus Cloud Computer: ${skillUri('edgegap-manus', 'SKILL.md')}, ` +
116
- `matchmaking, parties, regions, backfill: ${skillUri('edgegap-matchmaking', 'SKILL.md')}, ` +
117
- `host/client games via relays: ${skillUri('edgegap-relays', 'SKILL.md')}, ` +
118
- `sample projects: ${skillUri('edgegap-samples', 'SKILL.md')}). ` +
119
- '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. ' +
120
153
  'Skills hold the tested workflow, templates and pitfalls; follow them over general knowledge (edgegap_list_skills lists all).\n\n' +
121
154
  'Deployments and relay sessions cost money while running. Stop deployments and delete ' +
122
155
  'relay sessions you created before ending the task; edgegap_list_deployments with ' +
@@ -130,6 +163,8 @@ export function serverInstructions(mode) {
130
163
  'for, do not enumerate or modify unrelated applications, and do not probe what it allows. ' +
131
164
  'If the developer declines to provide a token, stop and report which operation needed it; ' +
132
165
  'do not retry.\n\n' +
166
+ BACKEND_GUIDANCE +
167
+ '\n\n' +
133
168
  ARCHITECTURE_SUMMARY +
134
169
  '\n\n' +
135
170
  'Golden path for a first dedicated-server deployment:\n' +
@@ -810,7 +845,7 @@ export function registerTools(server, client, config, auth, options = {}) {
810
845
  'hosted server, and the guardrails in force: read-only mode, application allowlist, ' +
811
846
  'max_duration ceiling, the agent deployment cap, the tag forced onto every deployment, and which tools support ' +
812
847
  'dry_run. Also gives the egress terms (Private Fleet hosts include 6 TB of free egress per host per month; Edge Cloud egress ' +
813
- '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 ' +
814
849
  'first when unsure what this session is allowed to do, before anything billable, or when tool calls fail ' +
815
850
  'with a token problem. Makes no API call unless check_token is true, and never shows the token.',
816
851
  inputSchema: {
@@ -849,6 +884,7 @@ export function registerTools(server, client, config, auth, options = {}) {
849
884
  ...(hosted ? {} : { skills_updaters_enabled: config.enableSkillsUpdate === true }),
850
885
  skills_pack: `${SKILLS_PACK.version} (${SKILLS_PACK.commit.slice(0, 7)}), ${SKILLS_PACK.skills.length} skills`,
851
886
  forced_deploy_tag: AGENT_TAG,
887
+ api_limits: { ...API_LIMITS, webhooks: WEBHOOK_FACTS },
852
888
  guardrails: {
853
889
  dry_run: mutating
854
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'
@@ -1532,8 +1568,11 @@ export function registerTools(server, client, config, auth, options = {}) {
1532
1568
  'default 5): stop finished ones first. Also refused when the version\'s max_duration is unlimited or above ' +
1533
1569
  'EDGEGAP_MAX_DURATION_MINUTES, unless allow_long_running is true (ask the developer first), and on the local ' +
1534
1570
  'server after EDGEGAP_MAX_DEPLOYS_PER_RUN deploys (default 20). Env vars named like secrets are hidden in the ' +
1535
- 'dashboard. Optional: webhooks Edgegap calls when the server is ready, errors or ends (instead of polling), ' +
1536
- '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.',
1537
1576
  inputSchema: {
1538
1577
  application: z.string().describe('Application name.'),
1539
1578
  version: z.string().describe('Version name within the application.'),
@@ -1563,9 +1602,9 @@ export function registerTools(server, client, config, auth, options = {}) {
1563
1602
  .optional()
1564
1603
  .describe('Only place it where the image is already cached: starts faster, fewer places to choose from. Needs ' +
1565
1604
  'force_cache on the version (edgegap_update_app_version); without it the API refuses the deploy.'),
1566
- webhook_on_ready: z.string().optional().describe('https URL Edgegap POSTs to when the server is ready.'),
1567
- webhook_on_error: z.string().optional().describe('https URL Edgegap POSTs to when the deployment fails.'),
1568
- 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.'),
1569
1608
  private_host_ids: z
1570
1609
  .array(z.string().min(1))
1571
1610
  .min(1)
@@ -1776,7 +1815,9 @@ export function registerTools(server, client, config, auth, options = {}) {
1776
1815
  title: 'Get deployment status',
1777
1816
  description: 'Read the current status of one deployment, including connection address and ports once ' +
1778
1817
  'it is ready. For a deployment you just created, prefer edgegap_wait_for_deployment — it ' +
1779
- '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.',
1780
1821
  inputSchema: {
1781
1822
  request_id: z.string().describe('The request_id returned by edgegap_deploy.'),
1782
1823
  },
@@ -1788,7 +1829,7 @@ export function registerTools(server, client, config, auth, options = {}) {
1788
1829
  const nextStep = d.error || TERMINAL_BAD.some((s) => status.includes(s))
1789
1830
  ? `It failed or stopped. Read why with edgegap_get_deployment_logs {request_id: "${request_id}"} before redeploying.`
1790
1831
  : d.running || TERMINAL_OK.some((s) => status.includes(s))
1791
- ? `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.`
1792
1833
  : `Still starting. Call edgegap_wait_for_deployment {request_id: "${request_id}"} instead of polling this.`;
1793
1834
  return ok({ ...compactDeployment(d), next_step: nextStep });
1794
1835
  }));
@@ -1798,7 +1839,8 @@ export function registerTools(server, client, config, auth, options = {}) {
1798
1839
  description: 'Poll a deployment until it is ready, errors, or the timeout expires, then return the ' +
1799
1840
  'connection details. This is the tool to call right after edgegap_deploy. Do not build ' +
1800
1841
  'your own polling loop — this handles backoff and reports the container error detail if ' +
1801
- '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.',
1802
1844
  inputSchema: {
1803
1845
  request_id: z.string().describe('The request_id returned by edgegap_deploy.'),
1804
1846
  timeout_seconds: z
@@ -1862,6 +1904,7 @@ export function registerTools(server, client, config, auth, options = {}) {
1862
1904
  cost_reminder: 'This server bills while it runs. When testing is done, stop it with ' +
1863
1905
  `edgegap_stop_deployment {request_id: "${request_id}"} unless the developer wants it kept running.`,
1864
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. ' +
1865
1908
  `When finished: edgegap_stop_deployment {request_id: "${request_id}"}.`,
1866
1909
  }), { ...facts('ready'), milestones: ['deployment_ready'] });
1867
1910
  }
@@ -1885,6 +1928,8 @@ export function registerTools(server, client, config, auth, options = {}) {
1885
1928
  title: 'List running deployments',
1886
1929
  description: 'List active deployments, optionally filtered and sorted. Use this to find deployments left running ' +
1887
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. ' +
1888
1933
  'Filter by status, application, version, tags, request_id, created_at, fleet_name or host_name, ' +
1889
1934
  'e.g. [{field:"application",operator:"eq",value:"my-game"},{field:"status",operator:"eq",value:"ready"}]. ' +
1890
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.13';
6
+ export const VERSION = '0.19.15';
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.13",
4
+ "version": "0.19.15",
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",