@edgegap/mcp 0.2.0 → 0.3.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/LICENSE +201 -201
- package/README.md +211 -237
- package/dist/dockerfile.js +185 -0
- package/dist/hosted.js +61 -0
- package/dist/http.js +122 -0
- package/dist/index.js +2 -30
- package/dist/serverconfig.js +4 -48
- package/dist/tools.js +214 -26
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -1,303 +1,277 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Edgegap MCP Server
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
have a headless server build" to "players are connected to it" without the
|
|
5
|
-
developer reading the API reference: checking the Dockerfile and ports, pushing
|
|
6
|
-
to Edgegap's registry, deploying, and — for peer-to-peer games — opening a relay
|
|
7
|
-
instead.
|
|
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.
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
[
|
|
5
|
+
[](https://cursor.com/en/install-mcp?name=Edgegap&config=eyJ1cmwiOiJodHRwczovL21jcC5lZGdlZ2FwLmRldi9tY3AiLCJoZWFkZXJzIjp7IkF1dGhvcml6YXRpb24iOiIifX0%3D)
|
|
6
|
+
[](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)
|
|
11
7
|
|
|
12
|
-
##
|
|
8
|
+
## 👉 Supported Features
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
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.
|
|
16
12
|
|
|
17
|
-
|
|
13
|
+
Use our MCP server when:
|
|
18
14
|
|
|
19
|
-
|
|
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:
|
|
20
92
|
|
|
21
93
|
```json
|
|
22
94
|
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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
|
+
}
|
|
28
103
|
}
|
|
29
|
-
}
|
|
30
104
|
}
|
|
31
105
|
```
|
|
32
106
|
|
|
33
|
-
|
|
34
|
-
`https://mcp.edgegap.dev/mcp` and supply the same token.
|
|
107
|
+
### Custom Integration
|
|
35
108
|
|
|
36
|
-
|
|
109
|
+
Install remote Edgegap MCP server in your agent's virtualized environment (never in your project!):
|
|
37
110
|
|
|
38
|
-
|
|
39
|
-
|
|
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:
|
|
40
132
|
|
|
41
133
|
```json
|
|
42
134
|
{
|
|
43
135
|
"mcpServers": {
|
|
44
|
-
"
|
|
136
|
+
"Edgegap": {
|
|
45
137
|
"command": "npx",
|
|
46
|
-
"args": ["-y", "@edgegap/mcp"]
|
|
138
|
+
"args": ["-y", "@edgegap/mcp"],
|
|
139
|
+
"env": { "EDGEGAP_API_TOKEN": "xxxxxxxx-e458-4592-b607-c2c28afd8b62" }
|
|
47
140
|
}
|
|
48
141
|
}
|
|
49
142
|
}
|
|
50
143
|
```
|
|
51
144
|
|
|
52
|
-
|
|
53
|
-
(`@edgegap/mcp@0.1.5`) rather than floating on latest.
|
|
54
|
-
|
|
55
|
-
Registered in the official MCP registry as `dev.edgegap/mcp`.
|
|
145
|
+
Needs Node 18+. Pin a version in production (`@edgegap/mcp@0.3.0`) rather than floating on latest. Registered in the official MCP registry as `dev.edgegap/mcp`.
|
|
56
146
|
|
|
57
|
-
|
|
58
|
-
> the Cloudflare Worker needs Node 22+, because `wrangler` requires it.
|
|
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`:
|
|
59
148
|
|
|
60
|
-
|
|
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. |
|
|
61
156
|
|
|
62
|
-
|
|
157
|
+
## 🧰 Tools
|
|
63
158
|
|
|
64
|
-
|
|
65
|
-
call asks you for a token, shows what it authorises, and requires an explicit
|
|
66
|
-
acknowledgement before accepting it. Where that token then lives, exhaustively:
|
|
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`.
|
|
67
160
|
|
|
68
|
-
|
|
161
|
+
### Before Your First Deployment
|
|
69
162
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
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. |
|
|
74
169
|
|
|
75
|
-
|
|
76
|
-
forwarded from there to the Edgegap API. It transits infrastructure Edgegap
|
|
77
|
-
operates. The worker holds it for the life of the request and does not persist
|
|
78
|
-
it, but that is a "we don't store it" claim rather than a "we never see it"
|
|
79
|
-
claim. The two are different, and only local mode makes the second one.
|
|
170
|
+
### Dedicated Servers (Recommended)
|
|
80
171
|
|
|
81
|
-
|
|
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. |
|
|
82
190
|
|
|
83
|
-
|
|
84
|
-
for CI and for clients that cannot show prompts. Do not pass a token as a
|
|
85
|
-
command-line argument — arguments are visible to other processes via `ps`, and
|
|
86
|
-
the server warns if it detects one.
|
|
191
|
+
Learn more about the configuration in [Matchmaking](https://docs.edgegap.com/learn/matchmaking).
|
|
87
192
|
|
|
88
|
-
|
|
89
|
-
setup friction matters more than custody. Local for anything unattended,
|
|
90
|
-
anything in an organization with a live game in it, and anything where you
|
|
91
|
-
would rather not extend trust you don't have to. The guardrails described below
|
|
92
|
-
exist only in local mode.
|
|
193
|
+
### Relays (Host-Client Games Only)
|
|
93
194
|
|
|
94
|
-
|
|
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).
|
|
95
196
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
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. |
|
|
99
203
|
|
|
100
|
-
|
|
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.
|
|
101
206
|
|
|
102
|
-
|
|
103
|
-
test ones it created.
|
|
104
|
-
- Prompt injection reaching the agent — from a repo file, an issue, a fetched
|
|
105
|
-
page — reaches the token too.
|
|
106
|
-
- Anything the agent logs, echoes, or sends to a model provider is a place the
|
|
107
|
-
token could end up. This server does not log it, but it cannot control what
|
|
108
|
-
the rest of the agent does.
|
|
109
|
-
- On the remote endpoint, the same unscoped token is additionally handled by
|
|
110
|
-
Edgegap's worker on every call.
|
|
207
|
+
### Example Prompts
|
|
111
208
|
|
|
112
|
-
|
|
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."*
|
|
113
214
|
|
|
114
|
-
|
|
115
|
-
| --- | --- |
|
|
116
|
-
| Unattended or autonomous agent | Local mode. Separate non-production organization, plus `EDGEGAP_READ_ONLY=1` |
|
|
117
|
-
| 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 |
|
|
118
|
-
| Solo developer, no production workload | Either mode. Defaults are fine; revoke the token when finished |
|
|
215
|
+
## 🚨 Troubleshooting
|
|
119
216
|
|
|
120
|
-
|
|
121
|
-
they protect against an agent that makes a mistake, not against one that has
|
|
122
|
-
been compromised into calling the API directly. They narrow the blast radius;
|
|
123
|
-
they do not remove it.
|
|
217
|
+
Review common error codes and learn how to unlock your integration.
|
|
124
218
|
|
|
125
|
-
###
|
|
219
|
+
### 401 Unauthorized
|
|
126
220
|
|
|
127
|
-
|
|
128
|
-
name: `edgegap_create_app`, `edgegap_list_app_versions`,
|
|
129
|
-
`edgegap_create_app_version`, `edgegap_deploy`, and
|
|
130
|
-
`edgegap_build_matchmaker_config`.
|
|
221
|
+
Your MCP integration is most likely not including the Authorization header correctly.
|
|
131
222
|
|
|
132
|
-
|
|
133
|
-
application, so the relay and registry tools are not covered by it either.
|
|
223
|
+
### 403 Forbidden
|
|
134
224
|
|
|
135
|
-
|
|
136
|
-
`edgegap_get_deployment`, `edgegap_wait_for_deployment`,
|
|
137
|
-
`edgegap_list_deployments`, `edgegap_stop_deployment`, and
|
|
138
|
-
`edgegap_get_deployment_logs`. An agent running with an allowlist set can list
|
|
139
|
-
every deployment in the organization and then inspect, read the logs of, or stop
|
|
140
|
-
any of them — including deployments belonging to applications outside the list.
|
|
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.
|
|
141
226
|
|
|
142
|
-
|
|
143
|
-
can **touch once running**. That is narrower than earlier versions of this
|
|
144
|
-
document implied.
|
|
227
|
+
### 424 Image Could Not Be Pulled
|
|
145
228
|
|
|
146
|
-
For
|
|
147
|
-
the mutating tools at all, or point the agent at a separate non-production
|
|
148
|
-
organization. Both are unaffected by this gap.
|
|
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`.
|
|
149
230
|
|
|
150
|
-
|
|
231
|
+
### Registry Credentials Unavailable
|
|
151
232
|
|
|
152
|
-
|
|
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).
|
|
153
234
|
|
|
154
|
-
|
|
155
|
-
Edgegap and cannot be changed per developer — if you need any of them, run
|
|
156
|
-
locally.
|
|
235
|
+
### Server Starts Locally but Not on Edgegap
|
|
157
236
|
|
|
158
|
-
|
|
159
|
-
| --- | --- | --- |
|
|
160
|
-
| `EDGEGAP_API_TOKEN` | *(prompted)* | API token. Optional — omit it and the developer is asked at first use. The `token ` prefix is added for you. |
|
|
161
|
-
| `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. |
|
|
162
|
-
| `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). |
|
|
163
|
-
| `EDGEGAP_MAX_DURATION_MINUTES` | `60` | Ceiling on `max_duration` the agent may set on a version. Caps runaway cost from an unattended agent. |
|
|
164
|
-
| `EDGEGAP_TIMEOUT_MS` | `30000` | Per-request HTTP timeout. |
|
|
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.
|
|
165
238
|
|
|
166
|
-
|
|
239
|
+
### Other API Errors
|
|
167
240
|
|
|
168
|
-
|
|
169
|
-
modes; `EDGEGAP_READ_ONLY=1` hides the ● ones.
|
|
241
|
+
Please consult our [API Reference](https://docs.edgegap.com/docs/api) for possible error responses for individual API endpoints.
|
|
170
242
|
|
|
171
|
-
|
|
172
|
-
|
|
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).
|
|
173
245
|
|
|
174
|
-
|
|
175
|
-
| --- | --- | --- |
|
|
176
|
-
| `edgegap_validate_server_config` | | Static check of a 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 Edgegap's reference Unity/Unreal Dockerfile when there is none yet or it fails. No API call. |
|
|
177
|
-
| `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. |
|
|
178
|
-
| `edgegap_list_registry_tags` | | Confirm a pushed tag landed before registering it. |
|
|
246
|
+
## 🛠️ Self-Hosting
|
|
179
247
|
|
|
180
|
-
|
|
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:
|
|
181
249
|
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
| `edgegap_list_app_versions` | | Find a deployable version, or copy settings from a working one. |
|
|
187
|
-
| `edgegap_create_app_version` | ● | Register a container image with CPU, memory, and ports. |
|
|
188
|
-
| `edgegap_deploy` | ● | Start one instance near specified players. |
|
|
189
|
-
| `edgegap_get_deployment` | | Single status read. |
|
|
190
|
-
| `edgegap_wait_for_deployment` | | Poll to ready with backoff, then return the connection address. |
|
|
191
|
-
| `edgegap_list_deployments` | | Find orphaned servers from earlier sessions. |
|
|
192
|
-
| `edgegap_stop_deployment` | ● | Graceful SIGTERM, one deployment at a time. |
|
|
193
|
-
| `edgegap_get_deployment_logs` | | Container output and crash exit code after a failure. |
|
|
194
|
-
|
|
195
|
-
**Peer-to-peer relays** — for co-op and host-client games, which need no server
|
|
196
|
-
image at all.
|
|
197
|
-
|
|
198
|
-
| Tool | Mutating | What it's for |
|
|
199
|
-
| --- | --- | --- |
|
|
200
|
-
| `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. |
|
|
201
|
-
| `edgegap_get_relay_session` | | Re-read a session. |
|
|
202
|
-
| `edgegap_authorize_relay_user` | ● | Add a player who joins after the session was created. |
|
|
203
|
-
| `edgegap_delete_relay_session` | ● | Close a session. |
|
|
250
|
+
```bash
|
|
251
|
+
docker build -t edgegap-mcp .
|
|
252
|
+
docker run --rm -p 8080:8080 edgegap-mcp
|
|
253
|
+
```
|
|
204
254
|
|
|
205
|
-
|
|
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.
|
|
206
256
|
|
|
207
|
-
|
|
208
|
-
| --- | --- | --- |
|
|
209
|
-
| `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. |
|
|
210
|
-
|
|
211
|
-
## Design decisions
|
|
212
|
-
|
|
213
|
-
**Curated, not generated.** The Edgegap API has roughly sixty operations.
|
|
214
|
-
Auto-generating one tool per operation puts all sixty descriptions into the
|
|
215
|
-
agent's context on every turn and measurably degrades tool selection. These
|
|
216
|
-
cover the path that converts a new developer — including the steps before the
|
|
217
|
-
first deploy, which are where that path used to end.
|
|
218
|
-
|
|
219
|
-
**`wait_for_deployment` is a tool, not a loop.** Left to itself an agent will
|
|
220
|
-
call a status endpoint in a tight loop, burn turns, and give up early. Folding
|
|
221
|
-
the polling and backoff into one call removes the most common failure in
|
|
222
|
-
agent-driven deploys.
|
|
223
|
-
|
|
224
|
-
**Errors are written for self-correction.** A 424 comes back saying the image
|
|
225
|
-
could not be pulled and which fields to check. A 422 says to try different
|
|
226
|
-
coordinates or lower the resource request. The agent can act on these without a
|
|
227
|
-
round trip to the human.
|
|
228
|
-
|
|
229
|
-
**Local validation before the wire.** The memory-to-CPU ratio and the missing
|
|
230
|
-
player location are caught here rather than surfacing as an opaque 400.
|
|
231
|
-
`edgegap_validate_server_config` extends this to the image itself, before a
|
|
232
|
-
build and push are spent discovering a problem.
|
|
233
|
-
|
|
234
|
-
**The registry token is handed to the agent; the API token never is.** The agent
|
|
235
|
-
has to run `docker login`, so the registry token is returned in the tool result.
|
|
236
|
-
It is scoped to the org's registry project, and the returned command reads it
|
|
237
|
-
from an environment variable over `--password-stdin` so it stays off command
|
|
238
|
-
lines and out of shell history. The tool is hidden in read-only mode.
|
|
239
|
-
|
|
240
|
-
**The registry credentials endpoint is not in the public spec.** It is
|
|
241
|
-
`GET /v1/wizard/registry-credentials`, the same call the Unity plugin makes,
|
|
242
|
-
preceded by `POST /v1/wizard/init-quick-start` when the project is not yet
|
|
243
|
-
provisioned.
|
|
244
|
-
|
|
245
|
-
**Bulk operations are deliberately absent.** `stop` takes one `request_id`.
|
|
246
|
-
There is no bulk-stop tool, because an agent with a filter expression and a bug
|
|
247
|
-
can stop a production fleet.
|
|
248
|
-
|
|
249
|
-
**Both a hosted endpoint and a local package.** The hosted endpoint removes
|
|
250
|
-
every step between finding this server and calling a tool, which is where most
|
|
251
|
-
developers drop out. The local package is the only way to run the server
|
|
252
|
-
without extending custody of an unscoped token to a third party, including us.
|
|
253
|
-
Neither one dominates the other, so both ship. See `worker/DECISION.md` for the
|
|
254
|
-
longer version.
|
|
255
|
-
|
|
256
|
-
## Scope
|
|
257
|
-
|
|
258
|
-
Not exposed, on purpose: private fleets, smart fleets, endpoint storage,
|
|
259
|
-
ACL/whitelist entries, deployment tags, metrics, registry tag deletion, DNS
|
|
260
|
-
configuration, and matchmaker lifecycle (start, stop, delete).
|
|
261
|
-
|
|
262
|
-
These belong to studios already operating on the platform, not to a developer
|
|
263
|
-
getting a first game online. Relays, registry push, and a basic matchmaker
|
|
264
|
-
config were moved in scope because agents hit them before the first deploy,
|
|
265
|
-
not after.
|
|
266
|
-
|
|
267
|
-
## Known limitation: asking for the token at all
|
|
268
|
-
|
|
269
|
-
This applies to local mode, where the token is collected through elicitation
|
|
270
|
-
rather than read from config.
|
|
271
|
-
|
|
272
|
-
The MCP specification says servers should not use elicitation to collect
|
|
273
|
-
sensitive data, and an API token is sensitive. This server does it anyway,
|
|
274
|
-
because requiring a token in a config file before anything works is the largest
|
|
275
|
-
drop in the onboarding funnel, and the whole point of the server is to remove
|
|
276
|
-
setup friction.
|
|
277
|
-
|
|
278
|
-
That is a deliberate trade rather than a pattern to copy. What makes it
|
|
279
|
-
defensible is the set of mitigations in `src/auth.ts` — memory-only storage,
|
|
280
|
-
plain-language disclosure, required acknowledgement, redaction from all output,
|
|
281
|
-
and the environment variable always winning when present. Removing any of them
|
|
282
|
-
breaks the trade.
|
|
283
|
-
|
|
284
|
-
The real fix is on Edgegap's side and would improve both modes: scoped,
|
|
285
|
-
revocable, deploy-only credentials, issued through OAuth rather than pasted as
|
|
286
|
-
a secret. Until those exist, the interactive prompt is a workaround and is
|
|
287
|
-
labelled as one in the code.
|
|
257
|
+
Every push to `main` builds the image and pushes it to the Edgegap container registry as `registry.edgegap.com/<project>/edgegap-mcp`, tagged `main` and `sha-<commit>` (plus the version on `v*` tags). See [.github/workflows/docker.yml](.github/workflows/docker.yml) for the repository variables and secrets it needs.
|
|
288
258
|
|
|
289
259
|
## Development
|
|
290
260
|
|
|
291
261
|
```bash
|
|
292
|
-
npm
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
node newtools.mjs # validator, registry, relay, matchmaker tools against a local mock API
|
|
262
|
+
npm ci
|
|
263
|
+
npm run build
|
|
264
|
+
npm test # mock-API tests; none reach Edgegap
|
|
265
|
+
npm run typecheck:worker
|
|
297
266
|
```
|
|
298
267
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
268
|
+
| Test | Covers |
|
|
269
|
+
| --- | --- |
|
|
270
|
+
| `test/smoke.mjs` | Handshake, tool registration, read-only mode |
|
|
271
|
+
| `test/guards.mjs` | Local validation and allowlist enforcement |
|
|
272
|
+
| `test/elicit.mjs` | Token prompt: accept, refuse acknowledgement, decline, no support |
|
|
273
|
+
| `test/newtools.mjs` | Validator, Dockerfile generator, registry, deployments, relay and matchmaker tools against a local mock API |
|
|
274
|
+
| `test/http.mjs` | Self-hosted HTTP server: discovery without a token, per-request tokens, foreign credentials |
|
|
275
|
+
| `test/live-check.mjs` | Not in `npm test`. Runs against the real API with a token from a non-production organization |
|
|
276
|
+
|
|
277
|
+
Design decisions, the security model, and what's deliberately out of scope are in [DESIGN.md](DESIGN.md).
|