@edgegap/mcp 0.14.2 → 0.15.0
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 +3 -1
- package/dist/client.js +6 -0
- package/dist/tools.js +66 -0
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -213,7 +213,7 @@ To keep your API token on your own machine, run the server locally instead. Leav
|
|
|
213
213
|
}
|
|
214
214
|
```
|
|
215
215
|
|
|
216
|
-
Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.
|
|
216
|
+
Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.15.0`) rather than floating on latest. Registered in the official MCP registry as `dev.edgegap/mcp`.
|
|
217
217
|
|
|
218
218
|
The local server can also limit what an agent can do. These variables have no effect on the hosted endpoint at `mcp.edgegap.dev`:
|
|
219
219
|
|
|
@@ -332,6 +332,8 @@ Container logs disappear with the deployment unless they are exported to your ow
|
|
|
332
332
|
| `edgegap_create_endpoint_storage` ● | Registers a bucket (AWS S3, Cloudflare R2, DigitalOcean Spaces…) for log export. Set `endpoint_storage` on a version to turn export on. The secret key is never echoed back. |
|
|
333
333
|
| `edgegap_create_pull_profile` ● | Copies a file or folder from the bucket into the container at boot (maps, configs, large assets). |
|
|
334
334
|
| `edgegap_link_pull_profile` ● | Links a pull profile to a version, or unlinks it. |
|
|
335
|
+
| `edgegap_delete_pull_profile` ● | Deletes one pull profile. The bucket and its files stay. |
|
|
336
|
+
| `edgegap_delete_endpoint_storage` ● | Deletes one Endpoint Storage; refused while it has pull profiles unless `max_pull_profiles` allows them. The bucket and its logs stay. |
|
|
335
337
|
|
|
336
338
|
### Relays (Host-Client Games Only)
|
|
337
339
|
|
package/dist/client.js
CHANGED
|
@@ -218,6 +218,12 @@ export class EdgegapClient {
|
|
|
218
218
|
createPullProfile(endpointName, body) {
|
|
219
219
|
return this.request('POST', 'v1', `/v1/storage/endpoint/${encodeURIComponent(endpointName)}/pull-profile`, { body });
|
|
220
220
|
}
|
|
221
|
+
deleteEndpointStorage(endpointName) {
|
|
222
|
+
return this.request('DELETE', 'v1', `/v1/storage/endpoint/${encodeURIComponent(endpointName)}`);
|
|
223
|
+
}
|
|
224
|
+
deletePullProfile(endpointName, profileName) {
|
|
225
|
+
return this.request('DELETE', 'v1', `/v1/storage/endpoint/${encodeURIComponent(endpointName)}/pull-profile/${encodeURIComponent(profileName)}`);
|
|
226
|
+
}
|
|
221
227
|
/** PUT links, DELETE unlinks; the path is the same. */
|
|
222
228
|
linkPullProfile(method, endpointName, profileName, appName, versionName) {
|
|
223
229
|
return this.request(method, 'v1', `/v1/storage/endpoint/${encodeURIComponent(endpointName)}/pull-profile/${encodeURIComponent(profileName)}` +
|
package/dist/tools.js
CHANGED
|
@@ -2684,6 +2684,72 @@ export function registerTools(server, client, config, auth, options = {}) {
|
|
|
2684
2684
|
linked: !args.unlink,
|
|
2685
2685
|
});
|
|
2686
2686
|
}, 'the Endpoint Storage, pull profile, application or version does not exist. Check them with edgegap_list_endpoint_storage and edgegap_list_app_versions.'));
|
|
2687
|
+
tool('edgegap_delete_pull_profile', {
|
|
2688
|
+
title: 'Delete a pull profile',
|
|
2689
|
+
description: 'Delete one pull profile from an Endpoint Storage, to clean up a test profile. Exactly one exact name. ' +
|
|
2690
|
+
'Every version linked to it stops getting its files at boot (the API cannot list those links, so ask ' +
|
|
2691
|
+
'the developer when the profile is not one this conversation created). The bucket and its files are not ' +
|
|
2692
|
+
'touched. Cannot be undone.',
|
|
2693
|
+
inputSchema: {
|
|
2694
|
+
endpoint_storage: z.string().min(1).describe('Endpoint Storage name, from edgegap_list_endpoint_storage.'),
|
|
2695
|
+
pull_profile: z.string().min(1).describe('The exact pull profile name to delete.'),
|
|
2696
|
+
dry_run: dryRunParam,
|
|
2697
|
+
},
|
|
2698
|
+
annotations: { destructiveHint: true, idempotentHint: true, openWorldHint: true },
|
|
2699
|
+
}, async ({ endpoint_storage, pull_profile, dry_run }) => guard(auth, async () => {
|
|
2700
|
+
const badName = exactName(endpoint_storage, 'Endpoint Storage') ?? exactName(pull_profile, 'pull profile');
|
|
2701
|
+
if (badName)
|
|
2702
|
+
return badName;
|
|
2703
|
+
if (dry_run) {
|
|
2704
|
+
const dry = client.dryRun();
|
|
2705
|
+
await dry.client.deletePullProfile(endpoint_storage, pull_profile);
|
|
2706
|
+
return dryRunResult(dry.requests);
|
|
2707
|
+
}
|
|
2708
|
+
await client.deletePullProfile(endpoint_storage, pull_profile);
|
|
2709
|
+
return ok({ endpoint_storage, deleted_pull_profile: pull_profile, bucket_kept: 'The bucket and its files were not touched.' });
|
|
2710
|
+
}, `no pull profile "${pull_profile}" under Endpoint Storage "${endpoint_storage}". List them with edgegap_list_endpoint_storage.`));
|
|
2711
|
+
tool('edgegap_delete_endpoint_storage', {
|
|
2712
|
+
title: 'Delete an Endpoint Storage',
|
|
2713
|
+
description: 'Delete one Endpoint Storage, to clean up a test one. Exactly one exact name; refused when it still has ' +
|
|
2714
|
+
'more pull profiles than max_pull_profiles (default 0: delete them first with edgegap_delete_pull_profile, ' +
|
|
2715
|
+
'or raise max_pull_profiles after the developer agreed). Versions that export logs to it stop doing so, ' +
|
|
2716
|
+
'so confirm with the developer when the storage is not one this conversation created. The bucket and the ' +
|
|
2717
|
+
'logs already in it are not touched. Cannot be undone.',
|
|
2718
|
+
inputSchema: {
|
|
2719
|
+
endpoint_storage: z.string().min(1).describe('The exact Endpoint Storage name to delete.'),
|
|
2720
|
+
max_pull_profiles: z
|
|
2721
|
+
.number()
|
|
2722
|
+
.int()
|
|
2723
|
+
.min(0)
|
|
2724
|
+
.optional()
|
|
2725
|
+
.describe('Delete only if it has at most this many pull profiles, which go with it. Default 0.'),
|
|
2726
|
+
dry_run: dryRunParam,
|
|
2727
|
+
},
|
|
2728
|
+
annotations: { destructiveHint: true, idempotentHint: true, openWorldHint: true },
|
|
2729
|
+
}, async ({ endpoint_storage, max_pull_profiles, dry_run }) => guard(auth, async () => {
|
|
2730
|
+
const badName = exactName(endpoint_storage, 'Endpoint Storage');
|
|
2731
|
+
if (badName)
|
|
2732
|
+
return badName;
|
|
2733
|
+
if (dry_run) {
|
|
2734
|
+
const dry = client.dryRun();
|
|
2735
|
+
await dry.client.deleteEndpointStorage(endpoint_storage);
|
|
2736
|
+
return dryRunResult(dry.requests, ['A real call first checks how many pull profiles it has.']);
|
|
2737
|
+
}
|
|
2738
|
+
const profiles = ((await client.listPullProfiles(endpoint_storage)).pull_profiles ?? []).map((p) => p.name);
|
|
2739
|
+
const limit = max_pull_profiles ?? 0;
|
|
2740
|
+
if (profiles.length > limit) {
|
|
2741
|
+
return fail(`Refused: Endpoint Storage "${endpoint_storage}" has ${profiles.length} pull profile` +
|
|
2742
|
+
`${profiles.length === 1 ? '' : 's'} (${profiles.slice(0, 10).join(', ')}${profiles.length > 10 ? ', …' : ''}), ` +
|
|
2743
|
+
`more than max_pull_profiles (${limit}). Nothing was deleted. Delete them with edgegap_delete_pull_profile, ` +
|
|
2744
|
+
`or pass max_pull_profiles ${profiles.length} once the developer agreed to delete them all.`);
|
|
2745
|
+
}
|
|
2746
|
+
await client.deleteEndpointStorage(endpoint_storage);
|
|
2747
|
+
return ok({
|
|
2748
|
+
deleted_endpoint_storage: endpoint_storage,
|
|
2749
|
+
deleted_pull_profiles: profiles,
|
|
2750
|
+
bucket_kept: 'The bucket and the logs already in it were not touched.',
|
|
2751
|
+
});
|
|
2752
|
+
}, `no Endpoint Storage named "${endpoint_storage}". List them with edgegap_list_endpoint_storage.`));
|
|
2687
2753
|
}
|
|
2688
2754
|
// ================================================== peer-to-peer relays ====
|
|
2689
2755
|
// --------------------------------------------------------------- 14 ----
|
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edgegap/mcp",
|
|
3
3
|
"mcpName": "dev.edgegap/mcp",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.15.0",
|
|
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",
|