@edgegap/mcp 0.5.1 → 0.5.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/README.md +2 -2
- package/dist/tools.js +2 -34
- package/dist/version.js +1 -1
- package/package.json +3 -1
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.5.
|
|
160
|
+
Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.5.2`) 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
|
|
|
@@ -271,7 +271,7 @@ Your API token can do anything in your organization, so the server adds its own
|
|
|
271
271
|
|
|
272
272
|
The server identifies itself with `User-Agent: edgegap-mcp/<version> (<MCP client name>)` on every API call.
|
|
273
273
|
|
|
274
|
-
**Usage analytics.** The local server and the self-hosted Docker image send nothing beyond the API calls themselves. The hosted endpoint at `mcp.edgegap.dev` sends usage events to Edgegap's PostHog: which MCP client connected, which tool, prompt or skill resource was used, whether a call succeeded
|
|
274
|
+
**Usage analytics.** The local server and the self-hosted Docker image send nothing beyond the API calls themselves. The hosted endpoint at `mcp.edgegap.dev` uses [PostHog MCP Analytics](https://posthog.com/docs/mcp-analytics) (`@posthog/mcp`) and sends usage events to Edgegap's PostHog: which MCP client connected, which tool, prompt or skill resource was used, the names (not values) of the arguments passed, whether a call succeeded and its error category, how long it took, and whether it was a dry run, plus the server version and Cloudflare's country code. Only named metadata properties are let through. It never sends your token, tool argument values (IP addresses, env vars, app or image names), results or error text, and GeoIP is off. It adds no parameters to the tools. Events from one token are grouped under a keyed, non-reversible hash of it. To opt out, send the header `X-Edgegap-Telemetry: off` (or `DNT: 1`), or use the local server.
|
|
275
275
|
|
|
276
276
|
## 🚨 Troubleshooting
|
|
277
277
|
|
package/dist/tools.js
CHANGED
|
@@ -346,48 +346,16 @@ function autoStop(maxDuration) {
|
|
|
346
346
|
: {}),
|
|
347
347
|
};
|
|
348
348
|
}
|
|
349
|
-
function toolCallEvent(name, input, result, started) {
|
|
350
|
-
const args = (input && typeof input === 'object' ? input : {});
|
|
351
|
-
const text = result.content.map((c) => c.text).join('\n');
|
|
352
|
-
const status = text.match(/Edgegap API (\d{3})\b/)?.[1];
|
|
353
|
-
const event = {
|
|
354
|
-
tool: name,
|
|
355
|
-
success: !result.isError,
|
|
356
|
-
duration_ms: Date.now() - started,
|
|
357
|
-
dry_run: args.dry_run === true,
|
|
358
|
-
};
|
|
359
|
-
if (result.isError) {
|
|
360
|
-
event.error_kind = status ? 'api' : /^Refused|is not a single|not in EDGEGAP_APP_ALLOWLIST/m.test(text) ? 'refused' : 'other';
|
|
361
|
-
if (status)
|
|
362
|
-
event.error_status = Number(status);
|
|
363
|
-
}
|
|
364
|
-
if (name === 'edgegap_get_skill' && typeof args.skill === 'string')
|
|
365
|
-
event.skill = args.skill.slice(0, 80);
|
|
366
|
-
return event;
|
|
367
|
-
}
|
|
368
349
|
/** Prepends "[api.edgegap.com]" (or "[custom · host]") to a tool result. */
|
|
369
350
|
function withHost(result, label) {
|
|
370
351
|
return { ...result, content: [{ type: 'text', text: `[${label}]` }, ...result.content] };
|
|
371
352
|
}
|
|
372
|
-
export function registerTools(server, client, config, auth
|
|
353
|
+
export function registerTools(server, client, config, auth) {
|
|
373
354
|
const mutating = !config.readOnly;
|
|
374
355
|
// Every result names the API host it came from, first, so a session pointed
|
|
375
356
|
// at a custom EDGEGAP_BASE_URL can never be mistaken for production.
|
|
376
|
-
// The optional hook (the hosted Worker's analytics) sees each call's outcome.
|
|
377
357
|
const label = hostLabel(config);
|
|
378
|
-
const tool = ((name, def, cb) => server.registerTool(name, def, (async (...a) =>
|
|
379
|
-
const started = Date.now();
|
|
380
|
-
const result = await cb(...a);
|
|
381
|
-
if (hooks.onToolCall) {
|
|
382
|
-
try {
|
|
383
|
-
hooks.onToolCall(toolCallEvent(name, a[0], result, started));
|
|
384
|
-
}
|
|
385
|
-
catch {
|
|
386
|
-
// Analytics must never affect a tool result.
|
|
387
|
-
}
|
|
388
|
-
}
|
|
389
|
-
return withHost(result, label);
|
|
390
|
-
})));
|
|
358
|
+
const tool = ((name, def, cb) => server.registerTool(name, def, (async (...a) => withHost(await cb(...a), label))));
|
|
391
359
|
// ---------------------------------------------------------------- 0 ----
|
|
392
360
|
// No token, no network: describes this server's own configuration, so an
|
|
393
361
|
// agent can check where it is pointed and what is allowed before acting.
|
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.5.
|
|
4
|
+
"version": "0.5.2",
|
|
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",
|
|
@@ -43,8 +43,10 @@
|
|
|
43
43
|
"devDependencies": {
|
|
44
44
|
"@cloudflare/workers-types": "^5.20260911.1",
|
|
45
45
|
"@modelcontextprotocol/server": "^2.0.0",
|
|
46
|
+
"@posthog/mcp": "0.22.3",
|
|
46
47
|
"@types/node": "^22.20.2",
|
|
47
48
|
"agents": "^0.23.0",
|
|
49
|
+
"posthog-node": "5.56.1",
|
|
48
50
|
"typescript": "^7.0.2",
|
|
49
51
|
"wrangler": "^4.131.1"
|
|
50
52
|
},
|