@edgegap/mcp 0.6.3 → 0.7.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 +16 -2
- package/dist/client.js +29 -0
- package/dist/skills.generated.js +110 -11
- package/dist/tools.js +438 -29
- package/dist/version.js +1 -1
- package/package.json +5 -2
package/README.md
CHANGED
|
@@ -157,7 +157,7 @@ To keep your API token on your own machine, run the server locally instead. Leav
|
|
|
157
157
|
}
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
-
Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.
|
|
160
|
+
Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.7.1`) rather than floating on latest. Registered in the official MCP registry as `dev.edgegap/mcp`.
|
|
161
161
|
|
|
162
162
|
The local server can also limit what an agent can do. These variables have no effect on the hosted endpoint at `mcp.edgegap.dev`:
|
|
163
163
|
|
|
@@ -216,6 +216,7 @@ Your agent picks the right tool from your request. You don't need to name them,
|
|
|
216
216
|
| `edgegap_validate_server_config` | Checks an existing Dockerfile, ports, resources, and image tag before you build. Catches ARM or Windows images (Edgegap runs `linux/amd64`), Unreal servers running as root, missing Unity `-batchmode -nographics`, servers bound to `localhost`, ports that don't match your netcode transport, and the `latest` tag. |
|
|
217
217
|
| `edgegap_get_registry_credentials` ● | Returns push credentials for your private Edgegap container registry, with the exact `docker login`, build, and push commands. Edgegap only gives these to the Unity/Unreal plugins' quick-start token; with a regular API token, it tells your agent to ask you for the login from the dashboard's **Container Registry** page instead. |
|
|
218
218
|
| `edgegap_list_registry_tags` | Confirms your image push landed before you register it. Takes the image name only, e.g. `my-game-server`: the project comes from your token. |
|
|
219
|
+
| `edgegap_delete_registry_tag` ● | Deletes one tag, and the image it points to, to clean up old builds. One exact tag per call; `latest`, wildcards and lists are refused. |
|
|
219
220
|
|
|
220
221
|
### Dedicated Servers (Recommended)
|
|
221
222
|
|
|
@@ -223,13 +224,19 @@ Your agent picks the right tool from your request. You don't need to name them,
|
|
|
223
224
|
| --- | --- |
|
|
224
225
|
| `edgegap_list_apps` | Lists your applications. |
|
|
225
226
|
| `edgegap_create_app` ● | Creates an application. |
|
|
227
|
+
| `edgegap_update_app` ● | Turns an application on or off for new deployments. |
|
|
226
228
|
| `edgegap_list_app_versions` | Lists versions with their image, resources, ports (with TLS Upgrade), and whether a registry login is set. |
|
|
229
|
+
| `edgegap_get_app_version` | Reads one version in full: image, resources, ports, max duration, image caching, restart policy, and env var names (never values). |
|
|
227
230
|
| `edgegap_create_app_version` ● | Registers a container image as a deployable version. Supports TLS Upgrade on WS and HTTP ports, which browser (WebGL) clients need for `wss://`. |
|
|
231
|
+
| `edgegap_update_app_version` ● | Changes an existing version: a new image tag, on/off, max duration, registry login, image caching (`force_cache`), shutdown grace period. Only the fields passed change; running deployments keep the old settings. |
|
|
232
|
+
| `edgegap_list_locations` | Lists the cities Edgegap deploys to, or, for one version, only those with capacity right now. |
|
|
233
|
+
| `edgegap_list_ping_beacons` | Lists the ping beacons game clients measure latency against before matchmaking. |
|
|
228
234
|
| `edgegap_deploy` ● | Deploys an authoritative dedicated server close to your players. Always tagged `edgegap-mcp`, and reports when Edgegap will stop it. |
|
|
229
235
|
| `edgegap_wait_for_deployment` | Waits until the server is ready and returns the connection address. |
|
|
230
236
|
| `edgegap_get_deployment` | Reads a deployment's status. |
|
|
231
237
|
| `edgegap_list_deployments` | Lists running deployments, filtered by application, version, status, tags and more, and sorted by age. Finds servers left running; `only_agent_deployments: true` lists every one an agent started. See [Filter Deployments](https://docs.edgegap.com/learn/orchestration/deployments#filter-deployments). |
|
|
232
238
|
| `edgegap_get_deployment_logs` | Reads container logs and crash details while the deployment runs. After it stops, logs are only kept if Endpoint Storage was set up. |
|
|
239
|
+
| `edgegap_get_deployment_metrics` | Summarises CPU, CPU throttling, memory and network use (latest, average, peak), to size a version or check a crash. |
|
|
233
240
|
| `edgegap_stop_deployment` ● | Stops one deployment, by its exact request ID. No bulk stop. |
|
|
234
241
|
|
|
235
242
|
### Matchmaking
|
|
@@ -248,7 +255,9 @@ A relay is not a game server: it forwards traffic while one player's game hosts
|
|
|
248
255
|
| --- | --- |
|
|
249
256
|
| `edgegap_create_relay_session` ● | Creates a relay session for your players and returns the relay address and each player's authorization token. |
|
|
250
257
|
| `edgegap_get_relay_session` | Reads a relay session. |
|
|
258
|
+
| `edgegap_list_relay_sessions` | Lists open relay sessions, to find ones left running. No authorization tokens. |
|
|
251
259
|
| `edgegap_authorize_relay_user` ● | Adds a player who joins later. |
|
|
260
|
+
| `edgegap_revoke_relay_user` ● | Removes one player from a relay session. |
|
|
252
261
|
| `edgegap_delete_relay_session` ● | Closes a relay session. |
|
|
253
262
|
|
|
254
263
|
> [!WARNING]
|
|
@@ -326,7 +335,7 @@ docker run --rm -p 8080:8080 edgegap-mcp
|
|
|
326
335
|
|
|
327
336
|
Clients connect to `http://<host>:8080/mcp` with their own `Authorization` header, the same way they connect to the hosted endpoint. The image holds no credential, and `/health` answers without one. `PORT`, `HOST`, `EDGEGAP_READ_ONLY`, `EDGEGAP_APP_ALLOWLIST`, `EDGEGAP_MAX_DURATION_MINUTES` and `EDGEGAP_MAX_AGENT_DEPLOYMENTS` apply. Read [worker/DECISION.md](worker/DECISION.md) before exposing it beyond a private network.
|
|
328
337
|
|
|
329
|
-
Prebuilt images are published to `ghcr.io/edgegap/edgegap-mcp`, tagged `main` and `sha-<commit>` on every push to `main`, plus the version on `v*` tags:
|
|
338
|
+
Prebuilt images for `linux/amd64` and `linux/arm64` are published to `ghcr.io/edgegap/edgegap-mcp`, tagged `main` and `sha-<commit>` on every push to `main`, plus the version on `v*` tags:
|
|
330
339
|
|
|
331
340
|
```bash
|
|
332
341
|
docker run --rm -p 8080:8080 ghcr.io/edgegap/edgegap-mcp:main
|
|
@@ -334,6 +343,8 @@ docker run --rm -p 8080:8080 ghcr.io/edgegap/edgegap-mcp:main
|
|
|
334
343
|
|
|
335
344
|
## Development
|
|
336
345
|
|
|
346
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for the checks a change has to pass, [CHANGELOG.md](CHANGELOG.md) for what each version changed, and [SECURITY.md](SECURITY.md) to report a vulnerability.
|
|
347
|
+
|
|
337
348
|
```bash
|
|
338
349
|
npm ci
|
|
339
350
|
npm run build
|
|
@@ -350,6 +361,7 @@ npm run check-skills # exit 1 if src/skills.generated.ts differs from the p
|
|
|
350
361
|
|
|
351
362
|
| Test | Covers |
|
|
352
363
|
| --- | --- |
|
|
364
|
+
| `test/unit.test.mjs` | Unit tests for the tag, image, secret-name, URL and redaction rules |
|
|
353
365
|
| `test/package.mjs` | Packaging: one `bin`, runtime dependencies, versions in step |
|
|
354
366
|
| `test/skills.mjs` | Skills over MCP: tools, prompts, resources, path safety, bundle matches the pin |
|
|
355
367
|
| `test/smoke.mjs` | Handshake, tool registration, read-only mode |
|
|
@@ -357,6 +369,8 @@ npm run check-skills # exit 1 if src/skills.generated.ts differs from the p
|
|
|
357
369
|
| `test/elicit.mjs` | Token prompt: accept, refuse acknowledgement, decline, no support |
|
|
358
370
|
| `test/newtools.mjs` | Validator, Dockerfile generator, registry, deployments, relay and matchmaker tools against a local mock API |
|
|
359
371
|
| `test/http.mjs` | Self-hosted HTTP server: discovery without a token, per-request tokens, foreign credentials |
|
|
372
|
+
| `test/spec.mjs` | Every endpoint and request-body field the server sends is in `spec/` (write tools checked by dry run) |
|
|
373
|
+
| `test/snapshot.mjs` | Tool names, descriptions, schemas and the instructions match `test/tools.snapshot.json`; `npm run snapshot:update` after a deliberate change |
|
|
360
374
|
| `test/live-check.mjs` | Not in `npm test`. Runs against the real API with a token from a non-production organization |
|
|
361
375
|
|
|
362
376
|
Design decisions, the security model, and what's deliberately out of scope are in [DESIGN.md](DESIGN.md).
|
package/dist/client.js
CHANGED
|
@@ -144,6 +144,9 @@ export class EdgegapClient {
|
|
|
144
144
|
createApp(body) {
|
|
145
145
|
return this.request('POST', 'v1', '/v1/app', { body });
|
|
146
146
|
}
|
|
147
|
+
updateApp(appName, body) {
|
|
148
|
+
return this.request('PATCH', 'v1', `/v1/app/${encodeURIComponent(appName)}`, { body });
|
|
149
|
+
}
|
|
147
150
|
listAppVersions(appName) {
|
|
148
151
|
return this.request('GET', 'v1', `/v1/app/${encodeURIComponent(appName)}/versions`);
|
|
149
152
|
}
|
|
@@ -151,6 +154,9 @@ export class EdgegapClient {
|
|
|
151
154
|
getAppVersion(appName, versionName) {
|
|
152
155
|
return this.request('GET', 'v1', `/v1/app/${encodeURIComponent(appName)}/version/${encodeURIComponent(versionName)}`);
|
|
153
156
|
}
|
|
157
|
+
updateAppVersion(appName, versionName, body) {
|
|
158
|
+
return this.request('PATCH', 'v1', `/v1/app/${encodeURIComponent(appName)}/version/${encodeURIComponent(versionName)}`, { body });
|
|
159
|
+
}
|
|
154
160
|
createAppVersion(appName, body) {
|
|
155
161
|
return this.request('POST', 'v1', `/v1/app/${encodeURIComponent(appName)}/version`, { body });
|
|
156
162
|
}
|
|
@@ -168,6 +174,17 @@ export class EdgegapClient {
|
|
|
168
174
|
stopDeployment(requestId) {
|
|
169
175
|
return this.request('DELETE', 'v1', `/v1/stop/${encodeURIComponent(requestId)}`);
|
|
170
176
|
}
|
|
177
|
+
getDeploymentMetrics(requestId, query = {}) {
|
|
178
|
+
return this.request('GET', 'v1', `/v1/metrics/deployment/${encodeURIComponent(requestId)}`, { query });
|
|
179
|
+
}
|
|
180
|
+
// --- Locations ----------------------------------------------------------
|
|
181
|
+
/** With app and version, only locations with capacity for it right now. */
|
|
182
|
+
listLocations(query = {}) {
|
|
183
|
+
return this.request('GET', 'v1', '/v1/locations', { query });
|
|
184
|
+
}
|
|
185
|
+
listBeacons(query = {}) {
|
|
186
|
+
return this.request('GET', 'v1', '/v1/locations/beacons', { query });
|
|
187
|
+
}
|
|
171
188
|
getDeploymentLogs(requestId, format = 'text') {
|
|
172
189
|
return this.request('GET', 'v1', `/v1/deployment/${encodeURIComponent(requestId)}/container-logs`, { query: { format } });
|
|
173
190
|
}
|
|
@@ -195,7 +212,19 @@ export class EdgegapClient {
|
|
|
195
212
|
const path = imageName.split('/').map(encodeURIComponent).join('/');
|
|
196
213
|
return this.request('GET', 'v1', `/v1/container-registry/images/${path}/tags`, { query });
|
|
197
214
|
}
|
|
215
|
+
/** Deletes one tag and, per the spec, the image it points to. Same
|
|
216
|
+
* image-name rules as listRegistryTags. */
|
|
217
|
+
deleteRegistryTag(imageName, tag) {
|
|
218
|
+
const path = imageName.split('/').map(encodeURIComponent).join('/');
|
|
219
|
+
return this.request('DELETE', 'v1', `/v1/container-registry/images/${path}/tags/${encodeURIComponent(tag)}`);
|
|
220
|
+
}
|
|
198
221
|
// --- Relays -------------------------------------------------------------
|
|
222
|
+
listRelaySessions() {
|
|
223
|
+
return this.request('GET', 'v1', '/v1/relays/sessions');
|
|
224
|
+
}
|
|
225
|
+
revokeRelayUser(body) {
|
|
226
|
+
return this.request('POST', 'v1', '/v1/relays/sessions:revoke-user', { body });
|
|
227
|
+
}
|
|
199
228
|
createRelaySession(body) {
|
|
200
229
|
return this.request('POST', 'v1', '/v1/relays/sessions', { body });
|
|
201
230
|
}
|