@edgegap/mcp 0.9.0 → 0.11.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 CHANGED
@@ -78,10 +78,16 @@ claude mcp add --transport http edgegap https://mcp.edgegap.dev/mcp \
78
78
 
79
79
  #### ChatGPT Codex
80
80
 
81
- ```bash
82
- codex mcp add edgegap --url https://mcp.edgegap.dev/mcp
81
+ Codex reads the token from an environment variable and sends it as `Authorization: Bearer <token>`, which the hosted endpoint accepts. In `~/.codex/config.toml`:
82
+
83
+ ```toml
84
+ [mcp_servers.edgegap]
85
+ url = "https://mcp.edgegap.dev/mcp"
86
+ bearer_token_env_var = "EDGEGAP_API_TOKEN"
83
87
  ```
84
88
 
89
+ Then set `EDGEGAP_API_TOKEN` to your token in the environment Codex starts from.
90
+
85
91
  #### Claude Desktop and claude.ai
86
92
 
87
93
  Custom connectors in claude.ai and Claude Desktop cannot send an `Authorization` header, so the hosted endpoint never receives your token from them: the connector shows as connected, but every tool call fails. Use the [Local Server](#local-server) instead.
@@ -161,14 +167,14 @@ To keep your API token on your own machine, run the server locally instead. Leav
161
167
  }
162
168
  ```
163
169
 
164
- Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.9.0`) rather than floating on latest. Registered in the official MCP registry as `dev.edgegap/mcp`.
170
+ Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.11.0`) rather than floating on latest. Registered in the official MCP registry as `dev.edgegap/mcp`.
165
171
 
166
172
  The local server can also limit what an agent can do. These variables have no effect on the hosted endpoint at `mcp.edgegap.dev`:
167
173
 
168
174
  | Variable | Default | Purpose |
169
175
  | --- | --- | --- |
170
176
  | `EDGEGAP_API_TOKEN` | *(prompted)* | API token. Optional: omit it and you're asked at first use. The `token ` prefix is added for you. Never pass it as a command-line argument. |
171
- | `EDGEGAP_READ_ONLY` | `0` | Set to `1` and the eight mutating tools are never registered, so the agent cannot be talked into calling them. |
177
+ | `EDGEGAP_READ_ONLY` | `0` | Set to `1` and the tools that change something (marked ● in [Tools](#-tools)) are never registered, so the agent cannot be talked into calling them. |
172
178
  | `EDGEGAP_APP_ALLOWLIST` | *(empty)* | Comma-separated application names. Limits what the agent can create and deploy into. Reading (listing apps and versions) is not limited, and neither is touching deployments once running. See [DESIGN.md](DESIGN.md#scope-of-the-allowlist). |
173
179
  | `EDGEGAP_MAX_DURATION_MINUTES` | `60` | Ceiling on `max_duration` the agent may set on a version. |
174
180
  | `EDGEGAP_MAX_AGENT_DEPLOYMENTS` | `5` | `edgegap_deploy` refuses while this many deployments tagged `edgegap-mcp` are running. `0` turns the cap off. |
@@ -201,7 +207,7 @@ They're served three ways, so every MCP client can reach them:
201
207
 
202
208
  - **Tools:** `edgegap_list_skills` and `edgegap_get_skill`, which loads a skill's `SKILL.md`, or one of its reference documents or templates with `file`.
203
209
  - **Prompts:** one per skill, named after it. In Claude Code they show up as slash commands, e.g. `/mcp__edgegap__edgegap-unity`.
204
- - **Resources:** one per file, at `edgegap-skill://<skill>/<path>`, e.g. `edgegap-skill://edgegap-unity/references/deploy.md`.
210
+ - **Resources:** each skill's `SKILL.md` is listed, at `edgegap-skill://<skill>/SKILL.md`; every other file is read through the `edgegap-skill://{skill}/{+path}` template, e.g. `edgegap-skill://edgegap-unity/references/deploy.md`.
205
211
 
206
212
  Each release bundles the skills at the commit pinned in `scripts/skills-pin.txt`; `edgegap_context` reports which pack is loaded. `edgegap_list_skills` also reads the latest pack version from GitHub (one version number, cached for an hour; `EDGEGAP_SKILLS_CHECK=off` turns it off) and says when a newer one is out, and `edgegap_get_skill` adds the same note under a skill's header.
207
213
 
@@ -235,7 +241,7 @@ Your agent picks the right tool from your request. You don't need to name them,
235
241
  | `edgegap_list_app_versions` | Lists versions with their image, resources, ports (with TLS Upgrade), and whether a registry login is set. |
236
242
  | `edgegap_get_app_version` | Reads one version in full: image, resources, ports, max duration, image caching, restart policy, and env var names (never values). |
237
243
  | `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://`. |
238
- | `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. |
244
+ | `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, ports, env vars. Only the fields passed change, but `ports` and `env` replace the whole list. Running deployments keep the old settings. |
239
245
  | `edgegap_list_locations` | Lists the cities Edgegap deploys to, or, for one version, only those with capacity right now. |
240
246
  | `edgegap_list_ping_beacons` | Lists the ping beacons game clients measure latency against before matchmaking. |
241
247
  | `edgegap_deploy` ● | Deploys an authoritative dedicated server close to your players. Always tagged `edgegap-mcp`, and reports when Edgegap will stop it. |
@@ -342,10 +348,10 @@ docker run --rm -p 8080:8080 edgegap-mcp
342
348
 
343
349
  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.
344
350
 
345
- 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:
351
+ Prebuilt images for `linux/amd64` and `linux/arm64` are published to `ghcr.io/edgegap/llm-mcp-server` (and, for existing setups, the old name `ghcr.io/edgegap/edgegap-mcp`), tagged `main` and `sha-<commit>` on every push to `main`, plus the version on `v*` tags:
346
352
 
347
353
  ```bash
348
- docker run --rm -p 8080:8080 ghcr.io/edgegap/edgegap-mcp:main
354
+ docker run --rm -p 8080:8080 ghcr.io/edgegap/llm-mcp-server:main
349
355
  ```
350
356
 
351
357
  ## Development
@@ -0,0 +1,128 @@
1
+ /**
2
+ * Output schemas for the tools whose results have a stable shape. Clients that
3
+ * read structuredContent can rely on these fields; the JSON text in content is
4
+ * the same payload.
5
+ *
6
+ * Deliberately loose: every field is optional, and objects keep
7
+ * fields not listed here. The SDK rejects a successful result that does not
8
+ * match its tool's schema, so a schema stricter than the Edgegap API's own
9
+ * answers would turn a working call into an error. They document the fields
10
+ * agents use, rather than police them. ok() drops null fields, so no schema
11
+ * needs nullable (each one doubles the JSON Schema). Dry runs of write tools return their
12
+ * own fields (dry_run, sent, requests), which pass for the same reason.
13
+ */
14
+ import { z } from 'zod';
15
+ const str = z.string().optional();
16
+ const num = z.number().optional();
17
+ const bool = z.boolean().optional();
18
+ const strs = z.array(z.string()).optional();
19
+ const obj = (shape) => z.looseObject(shape).optional();
20
+ const list = (shape) => z.array(z.looseObject(shape)).optional();
21
+ /** total, and when a page is short: showing, truncated, next_step. */
22
+ const page = { total: num, showing: num, truncated: bool, next_step: str };
23
+ const port = { name: str, port: num, protocol: str, tls_upgrade: bool };
24
+ const version = {
25
+ name: str,
26
+ active: bool,
27
+ image: str,
28
+ registry_credentials_set: bool,
29
+ cpu_units: num,
30
+ memory_mb: num,
31
+ max_duration_minutes: num,
32
+ ports: list(port),
33
+ };
34
+ const deployment = {
35
+ request_id: str,
36
+ status: str,
37
+ running: bool,
38
+ ready: bool,
39
+ error: bool,
40
+ error_detail: str,
41
+ fqdn: str,
42
+ public_ip: str,
43
+ application: str,
44
+ version: str,
45
+ location: str,
46
+ elapsed_seconds: num,
47
+ ports: list({ name: str, connect: str, external: num, internal: num, protocol: str }),
48
+ next_step: str,
49
+ };
50
+ const series = obj({ latest: num, average: num, peak: num, samples: num, labels: strs, from: str, to: str });
51
+ /** Loose at the top level too: a raw shape becomes additionalProperties: false
52
+ * in JSON Schema, and clients that validate results reject extra fields. */
53
+ const out = (shape) => z.looseObject(shape);
54
+ const shapes = {
55
+ context: {
56
+ server: str,
57
+ transport: str,
58
+ api_host: str,
59
+ api_base_url: str,
60
+ read_only: bool,
61
+ max_duration_ceiling_minutes: num,
62
+ skills_pack: str,
63
+ forced_deploy_tag: str,
64
+ guardrails: obj({}),
65
+ },
66
+ listApps: { ...page, applications: list({ name: str, active: bool, last_updated: str }) },
67
+ listAppVersions: { application: str, ...page, versions: list(version) },
68
+ getAppVersion: {
69
+ application: str,
70
+ ...version,
71
+ force_cache: bool,
72
+ caching_percent: num,
73
+ verify_image: bool,
74
+ restart_policy: str,
75
+ termination_grace_period_seconds: num,
76
+ env: list({ key: str, hidden: bool }),
77
+ auto_stop_after_minutes: num,
78
+ auto_stop: str,
79
+ warning: str,
80
+ },
81
+ listLocations: {
82
+ filtered_for: str,
83
+ ...page,
84
+ locations: list({ city: str, region: str, country: str, continent: str, latitude: num, longitude: num }),
85
+ messages: strs,
86
+ },
87
+ listPingBeacons: { total: num, beacons: list({ host: str, udp_port: num, tcp_port: num, city: str, country: str, continent: str }) },
88
+ deploy: {
89
+ request_id: str,
90
+ status: str,
91
+ tags: strs,
92
+ auto_stop_after_minutes: num,
93
+ auto_stop: str,
94
+ warning: str,
95
+ resources: obj({ cpu_units: num, memory_mib: num }),
96
+ next_step: str,
97
+ },
98
+ deployment,
99
+ waitForDeployment: { ...deployment, waited_seconds: num },
100
+ listDeployments: { ...page, deployments: list({ request_id: str, ready: bool, fqdn: str, started: str, tags: strs }) },
101
+ metrics: {
102
+ request_id: str,
103
+ cpu: series,
104
+ cpu_throttle_rate: series,
105
+ memory: series,
106
+ network_receive: series,
107
+ network_transmit: series,
108
+ totals: obj({ received: num, transmitted: num, disk_read: num, disk_written: num }),
109
+ note: str,
110
+ },
111
+ listRegistryTags: {
112
+ image_name: str,
113
+ note: str,
114
+ ...page,
115
+ tags: list({ tag: str, pushed: str, size_mb: num, digest: str }),
116
+ },
117
+ listRelaySessions: {
118
+ ...page,
119
+ sessions: list({ session_id: str, status: str, ready: bool, linked: bool, players: num, relay: str, error: str }),
120
+ },
121
+ validateServerConfig: {
122
+ verdict: str,
123
+ engine: str,
124
+ errors: list({ severity: str, code: str, message: str, fix: str, line: num }),
125
+ warnings: list({ severity: str, code: str, message: str, fix: str, line: num }),
126
+ },
127
+ };
128
+ export const OUTPUT = Object.fromEntries(Object.entries(shapes).map(([k, v]) => [k, out(v)]));