@edgegap/mcp 0.2.2 → 0.3.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 CHANGED
@@ -1,341 +1,281 @@
1
- # edgegap-mcp
2
-
3
- An MCP server for Edgegap that lets a coding agent take a developer from "I
4
- have a headless server build" to "players are connected to it" without the
5
- developer reading the API reference: writing and checking the Dockerfile,
6
- pushing to Edgegap's registry, and deploying an authoritative dedicated server.
7
- Relays are there too, for games built host-client, but they are not the default
8
- — see [Dedicated servers vs relays](#dedicated-servers-vs-relays).
9
-
10
- Nineteen tools, hand-picked. Not generated from the OpenAPI spec — see
11
- [Design decisions](#design-decisions) for why.
12
-
13
- ## Install
14
-
15
- Two ways to run it. Pick based on how much you care about where your token
16
- goes — see [Where your token goes](#where-your-token-goes).
17
-
18
- ### Remote endpoint
19
-
20
- Hosted by Edgegap as a Cloudflare Worker. Nothing to install.
21
-
22
- ```json
23
- {
24
- "mcpServers": {
25
- "edgegap": {
26
- "type": "http",
27
- "url": "https://mcp.edgegap.dev/mcp",
28
- "headers": { "Authorization": "token YOUR_API_TOKEN" }
29
- }
30
- }
31
- }
32
- ```
33
-
34
- Also works as a custom connector in claude.ai: add
35
- `https://mcp.edgegap.dev/mcp` and supply the same token.
36
-
37
- ### Local
38
-
39
- Runs on your own machine, spawned by your editor. One line in your MCP client
40
- config, nothing to clone, nothing to build.
41
-
42
- ```json
43
- {
44
- "mcpServers": {
45
- "edgegap": {
46
- "command": "npx",
47
- "args": ["-y", "@edgegap/mcp"]
48
- }
49
- }
50
- }
51
- ```
52
-
53
- Works in Claude Code, Cursor, Codex, and VS Code. Pin a version in production
54
- (`@edgegap/mcp@0.1.5`) rather than floating on latest.
55
-
56
- Registered in the official MCP registry as `dev.edgegap/mcp`.
57
-
58
- > **Node version:** the local server needs Node 18+. Deploying your own copy of
59
- > the Cloudflare Worker needs Node 22+, because `wrangler` requires it.
60
-
61
- ## Where your token goes
62
-
63
- This differs by mode, and the difference is the reason both modes exist.
64
-
65
- **Local.** The server runs as a process on your own computer. The first tool
66
- call asks you for a token, shows what it authorises, and requires an explicit
67
- acknowledgement before accepting it. Where that token then lives, exhaustively:
68
-
69
- - one variable in that process's memory, for the life of your editor session
70
-
71
- That is the whole list. Not on disk. Not in a config file. Not in logs. Not on
72
- any Edgegap server — the only thing sent to Edgegap is the API call itself,
73
- exactly as if you had run `curl`. Closing your editor revokes this server's
74
- access completely.
75
-
76
- **Remote.** Your token is sent to `mcp.edgegap.dev` on every request and
77
- forwarded from there to the Edgegap API. It transits infrastructure Edgegap
78
- operates. The worker holds it for the life of the request and does not persist
79
- it, but that is a "we don't store it" claim rather than a "we never see it"
80
- claim. The two are different, and only local mode makes the second one.
81
-
82
- Generate a token at <https://app.edgegap.com/user-settings?tab=tokens>.
83
-
84
- In local mode, setting `EDGEGAP_API_TOKEN` takes precedence over the prompt,
85
- for CI and for clients that cannot show prompts. Do not pass a token as a
86
- command-line argument — arguments are visible to other processes via `ps`, and
87
- the server warns if it detects one.
88
-
89
- **Which to use.** Remote for a first try, a demo, or a supervised session where
90
- setup friction matters more than custody. Local for anything unattended,
91
- anything in an organization with a live game in it, and anything where you
92
- would rather not extend trust you don't have to. The guardrails described below
93
- exist only in local mode.
94
-
95
- ## Read this before connecting an agent
96
-
97
- **The Edgegap API token cannot be scoped.** One token authorises every
98
- application, every version, every running deployment, and your usage across the
99
- whole organization. There is no deploy-only token and no per-application token.
100
-
101
- Consequences worth being deliberate about:
102
-
103
- - An agent holding this token can stop production deployments, not just the
104
- test ones it created.
105
- - Prompt injection reaching the agent — from a repo file, an issue, a fetched
106
- page — reaches the token too.
107
- - Anything the agent logs, echoes, or sends to a model provider is a place the
108
- token could end up. This server does not log it, but it cannot control what
109
- the rest of the agent does.
110
- - On the remote endpoint, the same unscoped token is additionally handled by
111
- Edgegap's worker on every call.
112
-
113
- Recommended setup, in decreasing order of caution:
114
-
115
- | Situation | Setup |
116
- | --- | --- |
117
- | Unattended or autonomous agent | Local mode. Separate non-production organization, plus `EDGEGAP_READ_ONLY=1` |
118
- | Supervised agent, live game in the org | Local mode. `EDGEGAP_APP_ALLOWLIST` scoped to the app being worked on, plus `EDGEGAP_MAX_DURATION_MINUTES`. Read [Scope of the allowlist](#scope-of-the-allowlist) first — deployments that are already running are not covered |
119
- | Solo developer, no production workload | Either mode. Defaults are fine; revoke the token when finished |
120
-
121
- The allowlist and read-only flag are enforced in the local server, which means
122
- they protect against an agent that makes a mistake, not against one that has
123
- been compromised into calling the API directly. They narrow the blast radius;
124
- they do not remove it.
125
-
126
- ### Scope of the allowlist
127
-
128
- `EDGEGAP_APP_ALLOWLIST` is enforced by the five tools that take an application
129
- name: `edgegap_create_app`, `edgegap_list_app_versions`,
130
- `edgegap_create_app_version`, `edgegap_deploy`, and
131
- `edgegap_build_matchmaker_config`.
132
-
133
- Relay sessions and the container registry belong to the organization, not to an
134
- application, so the relay and registry tools are not covered by it either.
135
-
136
- It is **not** enforced by the five tools keyed on `request_id`:
137
- `edgegap_get_deployment`, `edgegap_wait_for_deployment`,
138
- `edgegap_list_deployments`, `edgegap_stop_deployment`, and
139
- `edgegap_get_deployment_logs`. An agent running with an allowlist set can list
140
- every deployment in the organization and then inspect, read the logs of, or stop
141
- any of them — including deployments belonging to applications outside the list.
142
-
143
- So the allowlist scopes what an agent can **create and deploy into**, not what it
144
- can **touch once running**. That is narrower than earlier versions of this
145
- document implied.
146
-
147
- For a stronger guarantee today, use `EDGEGAP_READ_ONLY=1`, which never registers
148
- the mutating tools at all, or point the agent at a separate non-production
149
- organization. Both are unaffected by this gap.
150
-
151
- Reported by Syed Anas Mohiuddin, September 2026.
152
-
153
- ### Environment variables
154
-
155
- These configure the local server. On the remote endpoint they are set by
156
- Edgegap and cannot be changed per developer — if you need any of them, run
157
- locally.
158
-
159
- | Variable | Default | Purpose |
160
- | --- | --- | --- |
161
- | `EDGEGAP_API_TOKEN` | *(prompted)* | API token. Optional — omit it and the developer is asked at first use. The `token ` prefix is added for you. |
162
- | `EDGEGAP_READ_ONLY` | `0` | Set to `1` and the eight mutating tools (●, below) are never registered. The agent cannot see them, so it cannot be talked into calling them. |
163
- | `EDGEGAP_APP_ALLOWLIST` | *(empty)* | Comma-separated application names. When set, the five application-keyed tools refuse to touch anything else. Does **not** scope the five `request_id`-keyed tools — see [Scope of the allowlist](#scope-of-the-allowlist). |
164
- | `EDGEGAP_MAX_DURATION_MINUTES` | `60` | Ceiling on `max_duration` the agent may set on a version. Caps runaway cost from an unattended agent. |
165
- | `EDGEGAP_TIMEOUT_MS` | `30000` | Per-request HTTP timeout. |
166
-
167
- ## Dedicated servers vs relays
168
-
169
- Edgegap hosts multiplayer games two ways, and they are not interchangeable.
170
- **This server recommends a dedicated server by default**, and tells the agent so
171
- in its instructions, in the tool descriptions, and in every relay result.
172
-
173
- | | Dedicated (authoritative) server | Relay |
174
- | --- | --- | --- |
175
- | What Edgegap runs | Your headless server build, near the players | Only a traffic forwarder; no game code |
176
- | Who owns the game state | The server | One player's game (the host) |
177
- | Cheating | Much harder: the server decides | The host can change anything |
178
- | Fairness | Every player is one hop from the server | The host has zero latency; everyone else has two hops |
179
- | Host quits | Match continues | Match ends, unless the game implements host migration |
180
- | Limited by | The server's allocated CPU and memory | The host's PC and home upload bandwidth |
181
- | Needs | A server image (`edgegap_generate_dockerfile` writes the Dockerfile) | Netcode built as a listen server (host-client) |
182
- | Tools | `edgegap_deploy`, matchmaker | `edgegap_create_relay_session` |
183
-
184
- Agents left alone tend to pick relays because they need no server image. That
185
- saves the agent work, not the developer's game, so the relay tool tells the
186
- agent to use it only when the developer has chosen host-client, or the netcode
187
- is already a listen server and moving to a dedicated server is not an option —
188
- and to ask when that is unclear.
189
-
190
- ## Tools
191
-
192
- Nineteen tools, grouped by where they fall on the path. The same set in both
193
- modes; `EDGEGAP_READ_ONLY=1` hides the ● ones.
194
-
195
- **Before the first deploy** — getting a headless build into a correct image and
196
- into a registry, which is where agent-driven onboarding actually stalls.
197
-
198
- | Tool | Mutating | What it's for |
199
- | --- | --- | --- |
200
- | `edgegap_generate_dockerfile` | | Write a Dockerfile for this project's build: its build folder, binary or start script, ports and launch arguments, with the right headless flags, non-root user (Unreal), CRLF fix for start scripts, and matching EXPOSE lines. Lists anything it had to assume, returns the ports for `edgegap_create_app_version`, and is checked against the validator before it is returned. Unity, Unreal, Godot, or any other engine. No API call. |
201
- | `edgegap_validate_server_config` | | Static check of an existing Dockerfile, ports, resources and tag against Edgegap's requirements: linux/amd64, Unreal not running as root, Unity `-batchmode -nographics`, loopback binds, EXPOSE vs. version ports, protocol vs. netcode transport, `latest` tags. Returns a known-good Dockerfile for the engine when the one checked fails. No API call. |
202
- | `edgegap_get_registry_credentials` | ● | Push credentials for the org's private `registry.edgegap.com` project, plus the exact login/build/push commands and the values to pass to `edgegap_create_app_version`. Provisions the project on first use. |
203
- | `edgegap_list_registry_tags` | | Confirm a pushed tag landed before registering it. |
204
-
205
- **Dedicated servers** — the recommended way to host a match.
206
-
207
- | Tool | Mutating | What it's for |
208
- | --- | --- | --- |
209
- | `edgegap_list_apps` | | Orient before doing anything. Prevents duplicate applications. |
210
- | `edgegap_create_app` | ● | Create the container for versions. |
211
- | `edgegap_list_app_versions` | | Find a deployable version, or copy settings from a working one. |
212
- | `edgegap_create_app_version` | ● | Register a container image with CPU, memory, and ports. |
213
- | `edgegap_deploy` | ● | Start one authoritative server near specified players. |
214
- | `edgegap_get_deployment` | | Single status read. |
215
- | `edgegap_wait_for_deployment` | | Poll to ready with backoff, then return the connection address. |
216
- | `edgegap_list_deployments` | | Find orphaned servers from earlier sessions. |
217
- | `edgegap_stop_deployment` | ● | Graceful SIGTERM, one deployment at a time. |
218
- | `edgegap_get_deployment_logs` | | Container output and crash exit code after a failure. |
219
-
220
- **Matchmaking** — puts players into dedicated servers.
221
-
222
- | Tool | Mutating | What it's for |
223
- | --- | --- | --- |
224
- | `edgegap_build_matchmaker_config` | | Generate a basic matchmaker configuration (teams, team size, optional latency rule and expansions) checked against the application version it deploys. Edgegap has no API for creating a matchmaker, so the developer uploads the result in the dashboard. |
225
-
226
- **Relays** — only for games built host-client; not a game server. See
227
- [Dedicated servers vs relays](#dedicated-servers-vs-relays).
228
-
229
- | Tool | Mutating | What it's for |
230
- | --- | --- | --- |
231
- | `edgegap_create_relay_session` | ● | Open a relay session for a set of player IPs, wait until it is ready, and return the relay address, ports, and per-player authorization tokens, plus the trade-offs to raise with the developer. |
232
- | `edgegap_get_relay_session` | | Re-read a session. |
233
- | `edgegap_authorize_relay_user` | ● | Add a player who joins after the session was created. |
234
- | `edgegap_delete_relay_session` | ● | Close a session. |
235
-
236
- ## Design decisions
237
-
238
- **Curated, not generated.** The Edgegap API has roughly sixty operations.
239
- Auto-generating one tool per operation puts all sixty descriptions into the
240
- agent's context on every turn and measurably degrades tool selection. These
241
- cover the path that converts a new developer — including the steps before the
242
- first deploy, which are where that path used to end.
243
-
244
- **`wait_for_deployment` is a tool, not a loop.** Left to itself an agent will
245
- call a status endpoint in a tight loop, burn turns, and give up early. Folding
246
- the polling and backoff into one call removes the most common failure in
247
- agent-driven deploys.
248
-
249
- **Errors are written for self-correction.** A 424 comes back saying the image
250
- could not be pulled and which fields to check. A 422 says to try different
251
- coordinates or lower the resource request. The agent can act on these without a
252
- round trip to the human.
253
-
254
- **Local validation before the wire.** The memory-to-CPU ratio and the missing
255
- player location are caught here rather than surfacing as an opaque 400.
256
- `edgegap_validate_server_config` extends this to the image itself, before a
257
- build and push are spent discovering a problem.
258
-
259
- **Generated Dockerfiles are validated before they are returned.**
260
- `edgegap_generate_dockerfile` runs its own output through
261
- `edgegap_validate_server_config` and refuses to return anything that fails, so
262
- the two tools cannot disagree. Every value it writes into the Dockerfile (paths,
263
- binary name, launch arguments) is restricted to characters that cannot start a
264
- new instruction or escape into a shell. The Unity template leaves out the `env`
265
- dump from Edgegap's plugin Dockerfile, which writes hidden environment variables
266
- into container logs.
267
-
268
- **The same instructions on both transports.** The hosted Worker used to start
269
- without server instructions, so hosted agents never saw the golden path. Both
270
- entry points now use `serverInstructions()` from `src/tools.ts`.
271
-
272
- **The registry token is handed to the agent; the API token never is.** The agent
273
- has to run `docker login`, so the registry token is returned in the tool result.
274
- It is scoped to the org's registry project, and the returned command reads it
275
- from an environment variable over `--password-stdin` so it stays off command
276
- lines and out of shell history. The tool is hidden in read-only mode.
277
-
278
- **The registry credentials endpoint is not in the public spec.** It is
279
- `GET /v1/wizard/registry-credentials`, the same call the Unity plugin makes,
280
- preceded by `POST /v1/wizard/init-quick-start` when the project is not yet
281
- provisioned.
282
-
283
- **Bulk operations are deliberately absent.** `stop` takes one `request_id`.
284
- There is no bulk-stop tool, because an agent with a filter expression and a bug
285
- can stop a production fleet.
286
-
287
- **Both a hosted endpoint and a local package.** The hosted endpoint removes
288
- every step between finding this server and calling a tool, which is where most
289
- developers drop out. The local package is the only way to run the server
290
- without extending custody of an unscoped token to a third party, including us.
291
- Neither one dominates the other, so both ship. See `worker/DECISION.md` for the
292
- longer version.
293
-
294
- ## Scope
295
-
296
- Not exposed, on purpose: private fleets, smart fleets, endpoint storage,
297
- ACL/whitelist entries, deployment tags, metrics, registry tag deletion, DNS
298
- configuration, and matchmaker lifecycle (start, stop, delete).
299
-
300
- These belong to studios already operating on the platform, not to a developer
301
- getting a first game online. Dockerfile generation and validation, registry
302
- push, a basic matchmaker config, and relays were moved in scope because agents
303
- hit them before the first deploy, not after.
304
-
305
- ## Known limitation: asking for the token at all
306
-
307
- This applies to local mode, where the token is collected through elicitation
308
- rather than read from config.
309
-
310
- The MCP specification says servers should not use elicitation to collect
311
- sensitive data, and an API token is sensitive. This server does it anyway,
312
- because requiring a token in a config file before anything works is the largest
313
- drop in the onboarding funnel, and the whole point of the server is to remove
314
- setup friction.
315
-
316
- That is a deliberate trade rather than a pattern to copy. What makes it
317
- defensible is the set of mitigations in `src/auth.ts` — memory-only storage,
318
- plain-language disclosure, required acknowledgement, redaction from all output,
319
- and the environment variable always winning when present. Removing any of them
320
- breaks the trade.
321
-
322
- The real fix is on Edgegap's side and would improve both modes: scoped,
323
- revocable, deploy-only credentials, issued through OAuth rather than pasted as
324
- a secret. Until those exist, the interactive prompt is a workaround and is
325
- labelled as one in the code.
326
-
327
- ## Development
328
-
329
- ```bash
330
- npm run typecheck
331
- node smoke.mjs # handshake, tool registration, read-only mode
332
- node guards.mjs # local validation and allowlist enforcement
333
- node elicit.mjs # token prompt: accept, refuse acknowledgement, decline, no support
334
- node newtools.mjs # validator, registry, relay, matchmaker tools against a local mock API
335
- ```
336
-
337
- None of these reach Edgegap. `newtools.mjs` points `EDGEGAP_BASE_URL` at a
338
- mock server on localhost. `elicit.mjs` asserts that the prompt states
339
- the org-wide scope, that the acknowledgement is required, that the token never
340
- appears in tool output, and that declining produces a stop-and-report message
341
- rather than a retry loop.
1
+ # Edgegap MCP Server
2
+
3
+ Connect AI coding agents to Edgegap through our MCP server. Your agent can take a headless server build all the way to players connecting: write or check the Dockerfile, push the image to your private Edgegap registry, deploy an authoritative dedicated server close to players, and read logs when something breaks.
4
+
5
+ [![Install in Cursor](https://cursor.com/deeplink/mcp-install-dark.svg)](https://cursor.com/en/install-mcp?name=Edgegap&config=eyJ1cmwiOiJodHRwczovL21jcC5lZGdlZ2FwLmRldi9tY3AiLCJoZWFkZXJzIjp7IkF1dGhvcml6YXRpb24iOiIifX0%3D)
6
+ [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_Edgegap_MCP-0098FF?style=flat-square&logo=visualstudiocode&logoColor=white)](https://vscode.dev/redirect/mcp/install?name=Edgegap&config=%7B%22type%22%3A%22http%22%2C%22url%22%3A%22https%3A%2F%2Fmcp.edgegap.dev%2Fmcp%22%2C%22headers%22%3A%7B%22Authorization%22%3A%22%22%7D%7D)
7
+
8
+ ## 👉 Supported Features
9
+
10
+ > [!TIP]
11
+ > **Using Unity, Unreal Engine, or Godot?** Our [Unity](https://docs.edgegap.com/unity), [Unreal Engine](https://docs.edgegap.com/unreal-engine), and [Godot](https://docs.edgegap.com/godot) guides and plugins remain the fastest path for those engines. The MCP server works alongside them, and on its own for any engine.
12
+
13
+ Use our MCP server when:
14
+
15
+ * **Containerizing your game server** - your agent writes a Dockerfile for your build (or checks the one you have) against Edgegap's requirements, then pushes the image to your private Edgegap container registry.
16
+ * **Deploying a dedicated server** - create an application and version, deploy close to your players, and get the connection address.
17
+ * **Setting up matchmaking** - generate a matchmaker configuration that points at your deployed version, ready to upload in the dashboard.
18
+ * **Running a host-client game** - create a relay session if your game is built with one player as host. See [Dedicated Servers or Relays?](#dedicated-servers-or-relays) first.
19
+ * **Building a CI/CD pipeline** - test your deployments and teardown from a build system.
20
+ * **Troubleshooting a game server issue** - inspect app versions and deployment status, read container logs, or reproduce a failed deployment.
21
+
22
+ > [!WARNING]
23
+ > Out of scope / not supported by MCP: creating or running a matchmaker (the MCP generates the configuration, you upload it in the dashboard); server browser; lobbies; managed clusters; private fleets; or billing.
24
+
25
+ > [!NOTE]
26
+ > If you need help, [please reach out to us over Discord](https://discord.gg/MmJf8fWjnt). For live games support see our [ticketing system](https://edgegap.atlassian.net/servicedesk/customer/portal/3).
27
+
28
+ <a id="dedicated-servers-or-relays"></a>
29
+
30
+ ## ⚖️ Dedicated Servers or Relays?
31
+
32
+ Edgegap can host your multiplayer game in two ways. **We recommend dedicated servers**, and so does our MCP server: your agent will default to a dedicated server and only use a relay when you've chosen a host-client setup.
33
+
34
+ | | Dedicated server (recommended) | Relay |
35
+ | ----------------------- | ------------------------------------------------ | --------------------------------------------------------- |
36
+ | What Edgegap runs | Your headless server build, close to players | A traffic forwarder only, no game code |
37
+ | Who runs the game | The server | One player's game (the host) |
38
+ | Cheating | Much harder, the server has authority | The host can change anything |
39
+ | Fairness | Every player connects directly to the server | The host has no latency, everyone else goes through two hops |
40
+ | When the host leaves | The match continues | The match ends, unless your game supports host migration |
41
+ | Performance limited by | The server's allocated CPU and memory | The host's PC and home internet upload |
42
+ | You need | A server build in a container image | Netcode built as a listen server (host-client) |
43
+
44
+ > [!NOTE]
45
+ > **No server image yet?** That's not a reason to choose relays. Your agent can write the Dockerfile for your build with `edgegap_generate_dockerfile`. Learn more about relays in [Distributed Relay](https://docs.edgegap.com/learn/distributed-relay).
46
+
47
+ ## 🚀 Installation
48
+
49
+ MCP server installation is very simple:
50
+
51
+ 1. Install the MCP server for [Popular Agents](#popular-agents) or with [Custom Integration](#custom-integration).
52
+ 2. Generate and attach an API token for your agent to use with our MCP server.
53
+
54
+ Generate (and view) your secret tokens for Edgegap API in [Dashboard - User Settings / Tokens](https://app.edgegap.com/user-settings?tab=tokens).
55
+
56
+ Add your secret token with each API request as an HTTP header (include the word `token`):
57
+
58
+ `Authorization: token xxxxxxxx-e458-4592-b607-c2c28afd8b62`
59
+
60
+ > [!CAUTION]
61
+ > **Do not integrate Edgegap API endpoints in game client, as your API token provides unlimited access to your account. See [Integration](https://docs.edgegap.com/docs/api/integration) for secure client-facing API endpoints and functions.**
62
+
63
+ > [!TIP]
64
+ > In case your secret tokens are compromised or leaked, delete and re-create them from dashboard.
65
+
66
+ The token is organization-wide and cannot be scoped to one application. Read [DESIGN.md](DESIGN.md#where-your-token-goes) before giving it to an unattended agent.
67
+
68
+ ### Popular Agents
69
+
70
+ Install Edgegap MCP server in your preferred agentic IDE with the **Cursor** or **VS Code** buttons at the top of this page, then add your token to the `Authorization` header.
71
+
72
+ #### Claude Code
73
+
74
+ ```bash
75
+ claude mcp add --transport http edgegap https://mcp.edgegap.dev/mcp \
76
+ -H "Authorization: token xxxxxxxx-e458-4592-b607-c2c28afd8b62" --scope user
77
+ ```
78
+
79
+ #### ChatGPT Codex
80
+
81
+ ```bash
82
+ codex mcp add edgegap --url https://mcp.edgegap.dev/mcp
83
+ ```
84
+
85
+ #### claude.ai
86
+
87
+ Add `https://mcp.edgegap.dev/mcp` as a custom connector and supply the same token.
88
+
89
+ #### mcp.json
90
+
91
+ Most agentic IDEs also support integration by pasting JSON configuration:
92
+
93
+ ```json
94
+ {
95
+ "mcpServers": {
96
+ "Edgegap": {
97
+ "type": "http",
98
+ "url": "https://mcp.edgegap.dev/mcp",
99
+ "headers": {
100
+ "Authorization": "token xxxxxxxx-e458-4592-b607-c2c28afd8b62"
101
+ }
102
+ }
103
+ }
104
+ }
105
+ ```
106
+
107
+ ### Custom Integration
108
+
109
+ Install remote Edgegap MCP server in your agent's virtualized environment (never in your project!):
110
+
111
+ **Node, using the `mcp-remote` npx package**
112
+
113
+ ```json
114
+ {
115
+ "command": "npx",
116
+ "args": ["-y", "mcp-remote", "https://mcp.edgegap.dev/mcp", "--transport", "http-only"]
117
+ }
118
+ ```
119
+
120
+ **Python, using the `mcp-proxy` uvx package**
121
+
122
+ ```json
123
+ {
124
+ "command": "uvx",
125
+ "args": ["mcp-proxy", "--transport", "streamablehttp", "https://mcp.edgegap.dev/mcp"]
126
+ }
127
+ ```
128
+
129
+ ### Local Server
130
+
131
+ To keep your API token on your own machine, run the server locally instead. Leave the token out and your agent asks you for it on first use, holding it in memory only for that session:
132
+
133
+ ```json
134
+ {
135
+ "mcpServers": {
136
+ "Edgegap": {
137
+ "command": "npx",
138
+ "args": ["-y", "@edgegap/mcp"],
139
+ "env": { "EDGEGAP_API_TOKEN": "xxxxxxxx-e458-4592-b607-c2c28afd8b62" }
140
+ }
141
+ }
142
+ }
143
+ ```
144
+
145
+ Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.3.1`) rather than floating on latest. Registered in the official MCP registry as `dev.edgegap/mcp`.
146
+
147
+ The local server can also limit what an agent can do. These variables have no effect on the hosted endpoint at `mcp.edgegap.dev`:
148
+
149
+ | Variable | Default | Purpose |
150
+ | --- | --- | --- |
151
+ | `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. |
152
+ | `EDGEGAP_READ_ONLY` | `0` | Set to `1` and the eight mutating tools are never registered, so the agent cannot be talked into calling them. |
153
+ | `EDGEGAP_APP_ALLOWLIST` | *(empty)* | Comma-separated application names. Limits what the agent can create and deploy into, not what it can touch once running. See [DESIGN.md](DESIGN.md#scope-of-the-allowlist). |
154
+ | `EDGEGAP_MAX_DURATION_MINUTES` | `60` | Ceiling on `max_duration` the agent may set on a version. |
155
+ | `EDGEGAP_TIMEOUT_MS` | `30000` | Per-request HTTP timeout. |
156
+
157
+ ## 🧰 Tools
158
+
159
+ Your agent picks the right tool from your request. You don't need to name them, but knowing what's available helps you ask. Tools marked ● change something in your account and are hidden when `EDGEGAP_READ_ONLY=1`.
160
+
161
+ ### Before Your First Deployment
162
+
163
+ | Tool | What it does |
164
+ | --- | --- |
165
+ | `edgegap_generate_dockerfile` | Writes a Dockerfile for your server build: your build folder, server binary or start script, ports, and launch arguments, with the right headless flags (Unity `-batchmode -nographics`, Godot `--headless`), a non-root user for Unreal, and matching ports. Lists anything it had to assume so your agent can confirm it. Works for Unity, Unreal Engine, Godot, and any other engine. |
166
+ | `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. |
167
+ | `edgegap_get_registry_credentials` ● | Returns push credentials for your private Edgegap container registry, with the exact `docker login`, build, and push commands. No Docker Hub account needed. |
168
+ | `edgegap_list_registry_tags` | Confirms your image push landed before you register it. |
169
+
170
+ ### Dedicated Servers (Recommended)
171
+
172
+ | Tool | What it does |
173
+ | --- | --- |
174
+ | `edgegap_list_apps` | Lists your applications. |
175
+ | `edgegap_create_app` ● | Creates an application. |
176
+ | `edgegap_list_app_versions` | Lists versions with their image, resources, and ports. |
177
+ | `edgegap_create_app_version` ● | Registers a container image as a deployable version. |
178
+ | `edgegap_deploy` ● | Deploys an authoritative dedicated server close to your players. |
179
+ | `edgegap_wait_for_deployment` | Waits until the server is ready and returns the connection address. |
180
+ | `edgegap_get_deployment` | Reads a deployment's status. |
181
+ | `edgegap_list_deployments` | Lists running deployments, filtered by application, version, status, tags and more, and sorted by age. Finds servers left running. See [Filter Deployments](https://docs.edgegap.com/learn/orchestration/deployments#filter-deployments). |
182
+ | `edgegap_get_deployment_logs` | Reads container logs and crash details. |
183
+ | `edgegap_stop_deployment` ● | Stops one deployment. |
184
+
185
+ ### Matchmaking
186
+
187
+ | Tool | What it does |
188
+ | --- | --- |
189
+ | `edgegap_build_matchmaker_config` | Generates a matchmaker configuration (teams, team size, optional latency rules and expansions) and checks that the version it deploys exists. Upload the result in the dashboard to create your matchmaker, which starts a dedicated server for each match. |
190
+
191
+ Learn more about the configuration in [Matchmaking](https://docs.edgegap.com/learn/matchmaking).
192
+
193
+ ### Relays (Host-Client Games Only)
194
+
195
+ A relay is not a game server: it forwards traffic while one player's game hosts the match. See [Dedicated Servers or Relays?](#dedicated-servers-or-relays).
196
+
197
+ | Tool | What it does |
198
+ | --- | --- |
199
+ | `edgegap_create_relay_session` ● | Creates a relay session for your players and returns the relay address and each player's authorization token. |
200
+ | `edgegap_get_relay_session` | Reads a relay session. |
201
+ | `edgegap_authorize_relay_user` ● | Adds a player who joins later. |
202
+ | `edgegap_delete_relay_session` ● | Closes a relay session. |
203
+
204
+ > [!WARNING]
205
+ > Deployments and relay sessions are billed while they run. Ask your agent to stop test deployments and delete test relay sessions when it's done.
206
+
207
+ ### Example Prompts
208
+
209
+ * *"Write a Dockerfile for my Unity server build, then push it and deploy a server near me."*
210
+ * *"Check my Dockerfile for Edgegap and fix any problems."*
211
+ * *"Create a matchmaker config for 2v2 matches on my latest version."*
212
+ * *"My deployment failed. Read the logs and tell me why."*
213
+ * *"My game uses host-client networking. Set up an Edgegap relay for two players."*
214
+
215
+ ## 🚨 Troubleshooting
216
+
217
+ Review common error codes and learn how to unlock your integration.
218
+
219
+ ### 401 Unauthorized
220
+
221
+ Your MCP integration is most likely not including the Authorization header correctly.
222
+
223
+ ### 403 Forbidden
224
+
225
+ Your MCP integration is likely using the template token or a deleted token. Please validate that the token value used by your integration matches exactly the token displayed in dashboard.
226
+
227
+ ### 424 Image Could Not Be Pulled
228
+
229
+ Edgegap could not pull your container image. Check the repository, image name, and tag, and that the tag was pushed (ask your agent to list registry tags). For images in the Edgegap registry, the image name must include your project, e.g. `my-project/my-game-server`.
230
+
231
+ ### Registry Credentials Unavailable
232
+
233
+ If your agent can't retrieve registry credentials, request them in the [dashboard](https://app.edgegap.com) under **Container Registry**, or push to another registry Edgegap can pull from (Docker Hub, GitHub, AWS ECR, GCP, GitLab). See [External Registries](https://docs.edgegap.com/docs/tools-and-integrations/docker/external-registries).
234
+
235
+ ### Server Starts Locally but Not on Edgegap
236
+
237
+ Ask your agent to validate your server configuration, or to generate a new Dockerfile. The most common causes are an image built on Apple Silicon without `docker build --platform linux/amd64`, a server listening on a different port than the version exposes, or a UDP transport configured as TCP.
238
+
239
+ ### Other API Errors
240
+
241
+ Please consult our [API Reference](https://docs.edgegap.com/docs/api) for possible error responses for individual API endpoints.
242
+
243
+ > [!NOTE]
244
+ > If you need help, [please reach out to us over Discord](https://discord.gg/MmJf8fWjnt). For live games support see our [ticketing system](https://edgegap.atlassian.net/servicedesk/customer/portal/3).
245
+
246
+ ## 🛠️ Self-Hosting
247
+
248
+ The hosted endpoint at `mcp.edgegap.dev` runs as a Cloudflare Worker (see [worker/INSTALL.md](worker/INSTALL.md)). To run the same stateless HTTP server on your own infrastructure, use the Docker image:
249
+
250
+ ```bash
251
+ docker build -t edgegap-mcp .
252
+ docker run --rm -p 8080:8080 edgegap-mcp
253
+ ```
254
+
255
+ 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` and `EDGEGAP_MAX_DURATION_MINUTES` apply. Read [worker/DECISION.md](worker/DECISION.md) before exposing it beyond a private network.
256
+
257
+ 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:
258
+
259
+ ```bash
260
+ docker run --rm -p 8080:8080 ghcr.io/edgegap/edgegap-mcp:main
261
+ ```
262
+
263
+ ## Development
264
+
265
+ ```bash
266
+ npm ci
267
+ npm run build
268
+ npm test # mock-API tests; none reach Edgegap
269
+ npm run typecheck:worker
270
+ ```
271
+
272
+ | Test | Covers |
273
+ | --- | --- |
274
+ | `test/smoke.mjs` | Handshake, tool registration, read-only mode |
275
+ | `test/guards.mjs` | Local validation and allowlist enforcement |
276
+ | `test/elicit.mjs` | Token prompt: accept, refuse acknowledgement, decline, no support |
277
+ | `test/newtools.mjs` | Validator, Dockerfile generator, registry, deployments, relay and matchmaker tools against a local mock API |
278
+ | `test/http.mjs` | Self-hosted HTTP server: discovery without a token, per-request tokens, foreign credentials |
279
+ | `test/live-check.mjs` | Not in `npm test`. Runs against the real API with a token from a non-production organization |
280
+
281
+ Design decisions, the security model, and what's deliberately out of scope are in [DESIGN.md](DESIGN.md).
package/dist/hosted.js ADDED
@@ -0,0 +1,61 @@
1
+ /**
2
+ * Per-request token handling shared by the two hosted transports: the
3
+ * Cloudflare Worker (worker/worker.ts) and the Node HTTP server (src/http.ts).
4
+ *
5
+ * Neither has an ambient credential. Each request carries the developer's own
6
+ * Edgegap token in its Authorization header, and it is used for that request
7
+ * and discarded. See worker/DECISION.md.
8
+ */
9
+ const TOKEN_URL = 'https://app.edgegap.com/user-settings?tab=tokens';
10
+ /**
11
+ * Edgegap API tokens are UUIDs. The strict form is the real test; the loose
12
+ * form exists so a future token format does not silently stop working here.
13
+ *
14
+ * The point of this check is NOT security — an invalid token fails upstream
15
+ * anyway. It is to tell a foreign credential apart from an Edgegap one BEFORE
16
+ * relaying it, so the developer gets "your client sent its own token" instead
17
+ * of Edgegap's generic 401. JWTs are the common case: they are what MCP clients
18
+ * mint for themselves, and they always carry dots, which a UUID never does.
19
+ */
20
+ const STRICT_UUID = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i;
21
+ const LOOSE_OPAQUE = /^[A-Za-z0-9_-]{16,200}$/;
22
+ function looksLikeEdgegapToken(value) {
23
+ if (STRICT_UUID.test(value))
24
+ return true;
25
+ return LOOSE_OPAQUE.test(value);
26
+ }
27
+ export function extractToken(header) {
28
+ if (!header)
29
+ return { token: undefined, problem: 'absent' };
30
+ const value = header.replace(/^Bearer\s+/i, '').replace(/^token\s+/i, '').trim();
31
+ if (!value)
32
+ return { token: undefined, problem: 'absent' };
33
+ if (!looksLikeEdgegapToken(value))
34
+ return { token: undefined, problem: 'foreign' };
35
+ return { token: value };
36
+ }
37
+ /**
38
+ * The message an agent sees when it calls a tool without a usable credential.
39
+ * It is the only place the developer is told what to do, so it says it in full
40
+ * rather than pointing at docs.
41
+ */
42
+ export function unavailableMessage(problem) {
43
+ const common = `Get a token at ${TOKEN_URL}. It is used for the request and discarded — ` +
44
+ 'never stored. Edgegap tokens are organization-wide and cannot be scoped, ' +
45
+ 'so prefer the local server (npx -y @edgegap/mcp), which keeps the token ' +
46
+ 'on your own machine and never sends it through Edgegap infrastructure.';
47
+ if (problem === 'foreign') {
48
+ return ('The Authorization header on this connection does not contain an Edgegap ' +
49
+ 'API token — it looks like a credential your MCP client issued for ' +
50
+ 'itself. That happens with clients that connect by URL alone and have no ' +
51
+ 'field for a custom header. This server was not going to relay it to the ' +
52
+ 'Edgegap API, because the only thing that produces is a confusing 401.\n\n' +
53
+ 'If your client cannot attach your own Edgegap token to the connection, ' +
54
+ 'it cannot use this hosted server: run the local one instead ' +
55
+ '(npx -y @edgegap/mcp).\n\n' +
56
+ common);
57
+ }
58
+ return ('No Edgegap API token on this request. Send it as an Authorization header ' +
59
+ 'on the MCP connection.\n\n' +
60
+ common);
61
+ }
package/dist/http.js ADDED
@@ -0,0 +1,122 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Edgegap MCP server over Streamable HTTP, for self-hosting (Docker, a VM).
4
+ *
5
+ * The same stateless design as the Cloudflare Worker: no ambient credential,
6
+ * the developer's token comes in on each request's Authorization header and is
7
+ * discarded with it, and discovery (initialize, tools/list) works without one.
8
+ * Read worker/DECISION.md before exposing this beyond a private network.
9
+ *
10
+ * Environment: PORT (default 8080), HOST (default 0.0.0.0), plus the same
11
+ * EDGEGAP_* variables as the local server. EDGEGAP_API_TOKEN is ignored here.
12
+ */
13
+ import { createServer } from 'node:http';
14
+ import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
15
+ import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
16
+ import { loadConfig, ConfigError } from './config.js';
17
+ import { EdgegapClient } from './client.js';
18
+ import { registerTools, serverInstructions } from './tools.js';
19
+ import { StaticTokenProvider } from './auth.js';
20
+ import { extractToken, unavailableMessage } from './hosted.js';
21
+ const MAX_BODY_BYTES = 1_000_000;
22
+ function readBody(req) {
23
+ return new Promise((resolve, reject) => {
24
+ let size = 0;
25
+ const chunks = [];
26
+ req.on('data', (chunk) => {
27
+ size += chunk.length;
28
+ if (size > MAX_BODY_BYTES) {
29
+ reject(new Error('request body too large'));
30
+ req.destroy();
31
+ return;
32
+ }
33
+ chunks.push(chunk);
34
+ });
35
+ req.on('end', () => {
36
+ const raw = Buffer.concat(chunks).toString('utf8');
37
+ try {
38
+ resolve(raw ? JSON.parse(raw) : undefined);
39
+ }
40
+ catch {
41
+ reject(new Error('request body is not valid JSON'));
42
+ }
43
+ });
44
+ req.on('error', reject);
45
+ });
46
+ }
47
+ function sendJsonRpcError(res, status, message) {
48
+ res.writeHead(status, { 'Content-Type': 'application/json' });
49
+ res.end(JSON.stringify({ jsonrpc: '2.0', error: { code: -32000, message }, id: null }));
50
+ }
51
+ function main() {
52
+ let config;
53
+ try {
54
+ // No ambient credential, by design: every token comes from the request.
55
+ config = { ...loadConfig(), envToken: undefined };
56
+ }
57
+ catch (err) {
58
+ if (err instanceof ConfigError) {
59
+ process.stderr.write(`[edgegap-mcp] ${err.message}\n`);
60
+ process.exit(1);
61
+ }
62
+ throw err;
63
+ }
64
+ const port = Number.parseInt(process.env.PORT ?? '8080', 10);
65
+ const host = process.env.HOST ?? '0.0.0.0';
66
+ const httpServer = createServer(async (req, res) => {
67
+ const { pathname } = new URL(req.url ?? '/', 'http://localhost');
68
+ // Token-free, so health checks need no credential.
69
+ if (pathname === '/health') {
70
+ res.writeHead(200, { 'Content-Type': 'text/plain' }).end('ok');
71
+ return;
72
+ }
73
+ // startsWith, not strict equality: Streamable HTTP uses subpaths.
74
+ if (!pathname.startsWith('/mcp')) {
75
+ res.writeHead(404, { 'Content-Type': 'text/plain' }).end('Not found');
76
+ return;
77
+ }
78
+ // Stateless: no sessions, so the GET stream and DELETE have nothing to attach to.
79
+ if (req.method !== 'POST') {
80
+ res.setHeader('Allow', 'POST');
81
+ sendJsonRpcError(res, 405, 'Method not allowed. This server is stateless; use POST.');
82
+ return;
83
+ }
84
+ let body;
85
+ try {
86
+ body = await readBody(req);
87
+ }
88
+ catch (err) {
89
+ sendJsonRpcError(res, 400, err.message);
90
+ return;
91
+ }
92
+ const { token, problem } = extractToken(req.headers.authorization);
93
+ const auth = new StaticTokenProvider(token, problem ? unavailableMessage(problem) : undefined);
94
+ const server = new McpServer({ name: 'edgegap', version: '0.3.1' }, { instructions: serverInstructions('hosted') });
95
+ registerTools(server, new EdgegapClient(config, auth), config, auth);
96
+ const transport = new StreamableHTTPServerTransport({
97
+ sessionIdGenerator: undefined,
98
+ enableJsonResponse: true,
99
+ });
100
+ res.on('close', () => {
101
+ void transport.close();
102
+ void server.close();
103
+ });
104
+ try {
105
+ await server.connect(transport);
106
+ await transport.handleRequest(req, res, body);
107
+ }
108
+ catch (err) {
109
+ // Never echo the error: HTTP layers sometimes include request headers.
110
+ process.stderr.write(`[edgegap-mcp] request failed: ${err.name}\n`);
111
+ if (!res.headersSent)
112
+ sendJsonRpcError(res, 500, 'Internal server error');
113
+ }
114
+ });
115
+ httpServer.listen(port, host, () => {
116
+ process.stderr.write(`[edgegap-mcp] listening on http://${host}:${port}/mcp\n`);
117
+ });
118
+ const shutdown = () => httpServer.close(() => process.exit(0));
119
+ process.on('SIGTERM', shutdown);
120
+ process.on('SIGINT', shutdown);
121
+ }
122
+ main();
package/dist/index.js CHANGED
@@ -29,7 +29,7 @@ async function main() {
29
29
  }
30
30
  throw err;
31
31
  }
32
- const server = new McpServer({ name: 'edgegap', version: '0.2.2' }, { instructions: serverInstructions('local') });
32
+ const server = new McpServer({ name: 'edgegap', version: '0.3.1' }, { instructions: serverInstructions('local') });
33
33
  warnIfTokenInArgv();
34
34
  const auth = new TokenProvider(config);
35
35
  auth.attach(server.server);
@@ -45,7 +45,19 @@ async function main() {
45
45
  }
46
46
  await server.connect(new StdioServerTransport());
47
47
  }
48
- main().catch((err) => {
49
- process.stderr.write(`[edgegap-mcp] fatal: ${err.message}\n`);
50
- process.exit(1);
51
- });
48
+ // `--http` runs the self-hosted Streamable HTTP server (src/http.ts) instead of
49
+ // stdio. It is a flag rather than a second `bin` entry on purpose: with two
50
+ // commands and neither named `mcp`, `npx @edgegap/mcp` cannot pick one and
51
+ // fails outright, which is what broke 0.3.0. Keep `bin` to one command.
52
+ if (process.argv.slice(2).includes('--http')) {
53
+ import('./http.js').catch((err) => {
54
+ process.stderr.write(`[edgegap-mcp] fatal: ${err.message}\n`);
55
+ process.exit(1);
56
+ });
57
+ }
58
+ else {
59
+ main().catch((err) => {
60
+ process.stderr.write(`[edgegap-mcp] fatal: ${err.message}\n`);
61
+ process.exit(1);
62
+ });
63
+ }
package/dist/tools.js CHANGED
@@ -493,18 +493,47 @@ export function registerTools(server, client, config, auth) {
493
493
  // ---------------------------------------------------------------- 8 ----
494
494
  server.registerTool('edgegap_list_deployments', {
495
495
  title: 'List running deployments',
496
- description: 'List active deployments, optionally filtered. Use this to find deployments left running ' +
497
- 'from earlier sessions before starting new ones — orphaned servers cost money.',
496
+ description: 'List active deployments, optionally filtered and sorted. Use this to find deployments left running ' +
497
+ 'from earlier sessions before starting new ones — orphaned servers cost money. ' +
498
+ 'Filter by status, application, version, tags, request_id, created_at, fleet_name or host_name, ' +
499
+ 'e.g. [{field:"application",operator:"eq",value:"my-game"},{field:"status",operator:"eq",value:"ready"}]. ' +
500
+ 'Operators: eq and neq on every field except created_at (eq, gte, lte); in and nin with an array value ' +
501
+ 'on request_id, tags, application, version, fleet_name, host_name; ilike with % wildcards on fleet_name ' +
502
+ 'and host_name. At most one filter per field. Sort by created_at or available_session_sockets.',
498
503
  inputSchema: {
499
- filter: z
500
- .string()
504
+ filters: z
505
+ .array(z.object({
506
+ field: z.enum([
507
+ 'status', 'request_id', 'tags', 'created_at', 'application',
508
+ 'version', 'fleet_name', 'host_name',
509
+ ]),
510
+ operator: z.enum(['eq', 'neq', 'in', 'nin', 'gte', 'lte', 'ilike']),
511
+ value: z
512
+ .union([z.string(), z.array(z.string())])
513
+ .describe('A string, or an array of strings for in/nin. created_at is ISO 8601, e.g. "2026-09-30T00:00:00Z".'),
514
+ }))
515
+ .optional()
516
+ .describe('Omit for all deployments.'),
517
+ order_by: z
518
+ .array(z.object({
519
+ field: z.enum(['created_at', 'available_session_sockets']),
520
+ order: z.enum(['asc', 'desc']),
521
+ }))
501
522
  .optional()
502
- .describe('Edgegap filter expression, e.g. by tag. Omit for all deployments.'),
523
+ .describe('e.g. [{field:"created_at",order:"asc"}] for oldest first.'),
503
524
  limit: z.number().int().min(1).max(100).optional().describe('Default 50.'),
504
525
  },
505
526
  annotations: { readOnlyHint: true, openWorldHint: true },
506
- }, async ({ filter, limit }) => guard(auth, async () => {
507
- const res = await client.listDeployments({ query: filter, limit: limit ?? 50 });
527
+ }, async ({ filters, order_by, limit }) => guard(auth, async () => {
528
+ const fields = (filters ?? []).map((f) => f.field);
529
+ const repeated = fields.find((f, i) => fields.indexOf(f) !== i);
530
+ if (repeated) {
531
+ return fail(`Only one filter per field is allowed, and "${repeated}" has more than one. Combine them with "in" or "nin".`);
532
+ }
533
+ const query = filters?.length || order_by?.length
534
+ ? JSON.stringify({ filters: filters ?? [], ...(order_by?.length ? { order_by } : {}) })
535
+ : undefined;
536
+ const res = await client.listDeployments({ query, limit: limit ?? 50 });
508
537
  const rows = (res.data ?? []).map((d) => ({
509
538
  request_id: d.request_id,
510
539
  ready: d.ready,
@@ -643,7 +672,8 @@ export function registerTools(server, client, config, auth) {
643
672
  ports_for_create_app_version: generated.ports,
644
673
  commands: {
645
674
  build: `docker build --platform linux/amd64 -t ${ref} .`,
646
- test_locally: `docker run --rm --platform linux/amd64 ${portFlags} ${ref}`,
675
+ // --platform belongs on build only: the image is already linux/amd64.
676
+ test_locally: `docker run --rm ${portFlags} ${ref}`,
647
677
  },
648
678
  next_step: 'Confirm every assumption, write this to Dockerfile, build it, and run it locally to check ' +
649
679
  'the server starts and stays up. Then push it (edgegap_get_registry_credentials) and ' +
package/package.json CHANGED
@@ -1,14 +1,15 @@
1
1
  {
2
2
  "name": "@edgegap/mcp",
3
3
  "mcpName": "dev.edgegap/mcp",
4
- "version": "0.2.2",
4
+ "version": "0.3.1",
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",
8
- "build": "tsc && chmod +x dist/index.js",
8
+ "build": "tsc && chmod +x dist/index.js dist/http.js",
9
9
  "typecheck": "tsc --noEmit",
10
10
  "typecheck:worker": "tsc -p worker/tsconfig.json --noEmit",
11
- "test": "node smoke.mjs && node guards.mjs && node elicit.mjs && node newtools.mjs",
11
+ "test": "node test/package.mjs && node test/smoke.mjs && node test/guards.mjs && node test/elicit.mjs && node test/newtools.mjs && node test/http.mjs",
12
+ "start:http": "node dist/index.js --http",
12
13
  "worker:dev": "wrangler dev --config worker/wrangler.jsonc --local --port 8787",
13
14
  "worker:check": "wrangler deploy --config worker/wrangler.jsonc --dry-run --outdir=.wrangler/dryrun",
14
15
  "worker:deploy": "wrangler deploy --config worker/wrangler.jsonc",
@@ -24,6 +25,14 @@
24
25
  ],
25
26
  "author": "Mathieu Duperre",
26
27
  "license": "Apache-2.0",
28
+ "repository": {
29
+ "type": "git",
30
+ "url": "git+https://github.com/edgegap/edgegap-mcp.git"
31
+ },
32
+ "homepage": "https://github.com/edgegap/edgegap-mcp#readme",
33
+ "bugs": {
34
+ "url": "https://github.com/edgegap/edgegap-mcp/issues"
35
+ },
27
36
  "dependencies": {
28
37
  "@modelcontextprotocol/sdk": "^1.30.0",
29
38
  "@modelcontextprotocol/server": "^2.0.0",