@edgegap/mcp 0.1.0 → 0.1.2
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 +10 -0
- package/package.json +2 -1
package/dist/tools.js
CHANGED
|
@@ -152,6 +152,7 @@ export function registerTools(server, client, config, auth) {
|
|
|
152
152
|
limit: z.number().int().min(1).max(100).optional().describe('Results per page. Default 50.'),
|
|
153
153
|
page: z.number().int().min(1).optional(),
|
|
154
154
|
},
|
|
155
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
155
156
|
}, async ({ limit, page }) => guard(auth, async () => {
|
|
156
157
|
const res = await client.listApps({ limit: limit ?? 50, page });
|
|
157
158
|
const apps = (res.applications ?? []).map((a) => ({
|
|
@@ -176,6 +177,7 @@ export function registerTools(server, client, config, auth) {
|
|
|
176
177
|
.describe('Application name, 3-64 chars. Usually the game or project name.'),
|
|
177
178
|
is_active: z.boolean().optional().describe('Whether deployments are allowed. Default true.'),
|
|
178
179
|
},
|
|
180
|
+
annotations: { destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
179
181
|
}, async ({ name, is_active }) => guard(auth, async () => {
|
|
180
182
|
assertAppAllowed(config, name);
|
|
181
183
|
const res = await client.createApp({
|
|
@@ -199,6 +201,7 @@ export function registerTools(server, client, config, auth) {
|
|
|
199
201
|
inputSchema: {
|
|
200
202
|
application: z.string().describe('Application name, as returned by edgegap_list_apps.'),
|
|
201
203
|
},
|
|
204
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
202
205
|
}, async ({ application }) => guard(auth, async () => {
|
|
203
206
|
assertAppAllowed(config, application);
|
|
204
207
|
const res = await client.listAppVersions(application);
|
|
@@ -266,6 +269,7 @@ export function registerTools(server, client, config, auth) {
|
|
|
266
269
|
.optional()
|
|
267
270
|
.describe('Environment variables injected into the container.'),
|
|
268
271
|
},
|
|
272
|
+
annotations: { destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
269
273
|
}, async (args) => guard(auth, async () => {
|
|
270
274
|
assertAppAllowed(config, args.application);
|
|
271
275
|
if (args.memory_mb > args.cpu_units * 2) {
|
|
@@ -325,6 +329,7 @@ export function registerTools(server, client, config, auth) {
|
|
|
325
329
|
cpu_units: z.number().int().min(256).optional().describe('Override the version CPU.'),
|
|
326
330
|
memory_mb: z.number().int().min(256).optional().describe('Override the version memory.'),
|
|
327
331
|
},
|
|
332
|
+
annotations: { destructiveHint: false, idempotentHint: false, openWorldHint: true },
|
|
328
333
|
}, async (args) => guard(auth, async () => {
|
|
329
334
|
assertAppAllowed(config, args.application);
|
|
330
335
|
const users = buildUsers(args.users);
|
|
@@ -365,6 +370,7 @@ export function registerTools(server, client, config, auth) {
|
|
|
365
370
|
inputSchema: {
|
|
366
371
|
request_id: z.string().describe('The request_id returned by edgegap_deploy.'),
|
|
367
372
|
},
|
|
373
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
368
374
|
}, async ({ request_id }) => guard(auth, async () => {
|
|
369
375
|
const d = await client.getDeployment(request_id);
|
|
370
376
|
return ok(compactDeployment(d));
|
|
@@ -386,6 +392,7 @@ export function registerTools(server, client, config, auth) {
|
|
|
386
392
|
.optional()
|
|
387
393
|
.describe('How long to wait before giving up. Default 180.'),
|
|
388
394
|
},
|
|
395
|
+
annotations: { readOnlyHint: true, idempotentHint: true, openWorldHint: true },
|
|
389
396
|
}, async ({ request_id, timeout_seconds }) => guard(auth, async () => {
|
|
390
397
|
const budgetMs = (timeout_seconds ?? 180) * 1000;
|
|
391
398
|
const startedAt = Date.now();
|
|
@@ -425,6 +432,7 @@ export function registerTools(server, client, config, auth) {
|
|
|
425
432
|
.describe('Edgegap filter expression, e.g. by tag. Omit for all deployments.'),
|
|
426
433
|
limit: z.number().int().min(1).max(100).optional().describe('Default 50.'),
|
|
427
434
|
},
|
|
435
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
428
436
|
}, async ({ filter, limit }) => guard(auth, async () => {
|
|
429
437
|
const res = await client.listDeployments({ query: filter, limit: limit ?? 50 });
|
|
430
438
|
const rows = (res.data ?? []).map((d) => ({
|
|
@@ -446,6 +454,7 @@ export function registerTools(server, client, config, auth) {
|
|
|
446
454
|
inputSchema: {
|
|
447
455
|
request_id: z.string().describe('The request_id of the deployment to stop.'),
|
|
448
456
|
},
|
|
457
|
+
annotations: { destructiveHint: true, idempotentHint: true, openWorldHint: true },
|
|
449
458
|
}, async ({ request_id }) => guard(auth, async () => {
|
|
450
459
|
const res = await client.stopDeployment(request_id);
|
|
451
460
|
return ok({ request_id, result: res.message ?? 'stop requested' });
|
|
@@ -468,6 +477,7 @@ export function registerTools(server, client, config, auth) {
|
|
|
468
477
|
.optional()
|
|
469
478
|
.describe('Truncate logs to this length, keeping the tail. Default 8000.'),
|
|
470
479
|
},
|
|
480
|
+
annotations: { readOnlyHint: true, openWorldHint: true },
|
|
471
481
|
}, async ({ request_id, max_characters }) => guard(auth, async () => {
|
|
472
482
|
const res = await client.getDeploymentLogs(request_id);
|
|
473
483
|
const cap = max_characters ?? 8000;
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@edgegap/mcp",
|
|
3
|
-
"
|
|
3
|
+
"mcpName": "dev.edgegap/mcp",
|
|
4
|
+
"version": "0.1.2",
|
|
4
5
|
"description": "Deploy game servers on Edgegap from your coding agent. Runs locally; your API token never leaves your machine.",
|
|
5
6
|
"scripts": {
|
|
6
7
|
"prebuild": "rm -rf dist",
|