glitchless-mcp 0.20.0 → 0.22.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 +7 -6
- package/package.json +2 -2
- package/src/context.js +72 -8
- package/src/skills.js +3 -3
- package/src/tools/dashboard.js +2 -2
- package/src/tools/multiplayer.js +8 -2
- package/src/tools/playtest.js +17 -6
- package/src/tools/store-reviews.js +33 -12
- package/src/tools/workspace.js +38 -10
package/README.md
CHANGED
|
@@ -24,8 +24,9 @@ npx -y glitchless-mcp login
|
|
|
24
24
|
It prints a link and a code; you approve the code in the Glitchless dashboard, and it saves a workspace key in
|
|
25
25
|
`~/.config/glitchless/credentials.json` (readable only by you). From then on the server reaches every game in that
|
|
26
26
|
workspace: `glitchless_list_games` lists them, `glitchless_create_game` makes one and returns its client token, and
|
|
27
|
-
every tool takes `game` (a name or id). The key acts as you, with your role in the workspace, and never
|
|
28
|
-
|
|
27
|
+
every tool takes `game` (a name or id). The key acts as you, with your role in the workspace, and never touches
|
|
28
|
+
billing or people. It deletes data only if you ticked "Delete games and their data, for good" when approving it, and
|
|
29
|
+
then only a whole game, with its name repeated back. `npx -y glitchless-mcp whoami` shows where you're signed in, `logout` deletes the saved
|
|
29
30
|
key, and Settings → Keys & access in the dashboard lists and revokes keys. An agent can also sign in from inside a
|
|
30
31
|
chat with the `glitchless_sign_in` tool: it shows the link and code, and the running server switches over once you
|
|
31
32
|
approve. The saved key is only ever sent to the server it was saved for: point `GLITCHLESS_URL` at another one (a
|
|
@@ -92,8 +93,8 @@ above go in its environment.
|
|
|
92
93
|
| --- | --- |
|
|
93
94
|
| `glitchless_list_games` | Which games report to the server, with their versions and environments; signed in to a workspace, every game in it with its client token |
|
|
94
95
|
| `glitchless_sign_in` | Connect to a Glitchless Cloud workspace: a link and a code for the person to approve |
|
|
95
|
-
| `glitchless_create_game` | A new game in the workspace, with its client token and intake URL (a name already there returns that game); with `engine`, or `files` (what's in the game's folder), also the steps that add Glitchless to the game's code for its engine, for a new game (`name`) or one already there (`game`): the instrument skill, for an agent without it; `demo: true` makes the demo game (a week of sample play); `rename` (with `game`) renames one instead, its client token, service and data unchanged |
|
|
96
|
-
| `glitchless_share_links` | A read-only link to one board page, for a dev log, Discord or a game's "Live stats" link (`page`); lists them, and revokes one (`revoke`) |
|
|
96
|
+
| `glitchless_create_game` | A new game in the workspace, with its client token and intake URL (a name already there returns that game); with `engine`, or `files` (what's in the game's folder), also the steps that add Glitchless to the game's code for its engine, for a new game (`name`) or one already there (`game`): the instrument skill, for an agent without it; `demo: true` makes the demo game (a week of sample play); `rename` (with `game`) renames one instead, its client token, service and data unchanged; `delete` (with `game`, and the game's name again) deletes it and everything Glitchless keeps for it, for good: a key with `delete_games` (off unless an Owner or Admin ticked it), and when two games share the name, `game` is its id; the client token is refused from then on |
|
|
97
|
+
| `glitchless_share_links` | A read-only link to one board page, for a dev log, Discord or a game's "Live stats" link (`page`), or with `claim: true` a claim link that hands a game the team made to its creator, who moves it into their own workspace; lists them, and revokes one (`revoke`) |
|
|
97
98
|
| `glitchless_triage` | The headline numbers (sessions, players, crash-free sessions, frame time, rage quits), then ranked findings: stutter per level and what it correlates with, leaks, top errors, difficulty spikes. Start here |
|
|
98
99
|
| `glitchless_mark_known` | Mark a finding the game's owner accepts as known, so the weekly summary stops listing it (triage shows it last, with the note); with `player` or `session` instead, the team's own play, read as testers in every tool; `clear: true` removes the mark |
|
|
99
100
|
| `glitchless_resolve_error` | Resolve an error issue the game's owner fixed or accepts: hidden from the Errors page, triage and the weekly summary until it fires again in a newer version (`any_version`: any); `clear: true` unresolves it |
|
|
@@ -107,12 +108,12 @@ above go in its environment.
|
|
|
107
108
|
| `glitchless_compare_versions` | Two or more versions side by side, in the game's own stats first, to confirm a fix with real players |
|
|
108
109
|
| `glitchless_session` | One play session in detail, with its whole event timeline |
|
|
109
110
|
| `glitchless_bug_reports` | Bug reports players sent from inside the game: their notes, levels, positions and sessions, and one report's screenshot when asked |
|
|
110
|
-
| `glitchless_store` | For a game connected to a store (Glitchless Cloud: Steam, Google Play, the App Store, Roblox, itch.io): what players wrote there, by store, build or version, sentiment, topic (stutter, lag, fps, freeze, crash), device and, on Steam, Steam Deck, each build with the frame-time p95 and crash-free sessions measured on it; with `show: "vitals"`, what Google Play (slow rendering, crash and ANR rates, the slowest devices and GPUs) or the App Store (hang rate, launch time, animation hitches, hang signatures) or Roblox (crash rate and frame rate by place version and platform, and its retention) measured of each version, next to what Glitchless measured, and where the two disagree; with `show: "sales"`, what the store counted by day: Steam's units, returns and wishlists,
|
|
111
|
+
| `glitchless_store` | For a game connected to a store (Glitchless Cloud: Steam, Google Play, the App Store, Roblox, itch.io, the Microsoft Store): what players wrote there, by store, build or version, sentiment, topic (stutter, lag, fps, freeze, crash), device and, on Steam, Steam Deck, each build with the frame-time p95 and crash-free sessions measured on it; with `show: "vitals"`, what Google Play (slow rendering, crash and ANR rates, the slowest devices and GPUs) or the App Store (hang rate, launch time, animation hitches, hang signatures) or Roblox (crash rate and frame rate by place version and platform, and its retention) or the Microsoft Store (crash and hang rates by package version from Windows error reporting, and the heaviest failures; not Xbox consoles) measured of each version, next to what Glitchless measured, and where the two disagree; with `show: "sales"`, what the store counted by day: Steam's units, returns and wishlists, itch.io's page views, downloads and purchases next to the browser plays Glitchless measured on itch.io, or the Microsoft Store's acquisitions by kind and add-ons |
|
|
111
112
|
| `glitchless_revenue` | For a game connected to RevenueCat, its own Stripe account, Roblox or itch.io (Glitchless Cloud; `source` picks one, else each): its real revenue by day and revenue per player measured. RevenueCat's (production purchases only): installs (new customers) and active users, MRR, active subscriptions and trials, and revenue by version where RevenueCat splits it. Stripe's: refunds, disputes, fees and net, new paying customers, revenue by product, and by version and platform for purchases the game tied to a session. Roblox's: Robux earned (and what they'd be worth through DevEx), paying users, daily active and new users, and D1, D7 and D30 retention. itch.io's: its earnings by day, from the first sync (itch.io gives a total only). All next to the sessions, players and new players Glitchless measured and what the game's own purchase events add up to |
|
|
112
113
|
| `glitchless_match` | A multiplayer game's matches (the worst by lag or disconnects on request), or one match from every side, 30 seconds at a time: each player's ping, frame time and outcome, the server's ticks, and whether the whole lobby lagged at once (the server) or one player did (their connection) |
|
|
113
114
|
| `glitchless_network` | Ping, lag (play over 150 ms), packet loss and disconnects by level, version, platform, kind of connection and region, with the worst matches and the network findings |
|
|
114
115
|
| `glitchless_servers` | A game's dedicated servers in server mode: servers running now and their players, tick time against its budget by players connected, map and version, crashes with the matches they ended, and memory that climbs. Every other tool reads them with service `<game>.server` |
|
|
115
|
-
| `glitchless_playtest` | The game's autoplay bot plays it and the run is compared with a saved baseline ([glitchless-playtest](https://www.npmjs.com/package/glitchless-playtest)): a Unity, Godot, Unreal or GameMaker build from its `command`, a Roblox game in the open Roblox Studio (`engine: "roblox"`, over Studio's MCP server), or a web game in Chrome (needs Playwright in the game project) |
|
|
116
|
+
| `glitchless_playtest` | The game's autoplay bot plays it and the run is compared with a saved baseline ([glitchless-playtest](https://www.npmjs.com/package/glitchless-playtest)): a Unity, Godot, Unreal or GameMaker build from its `command`, a Roblox game in the open Roblox Studio (`engine: "roblox"`, over Studio's MCP server), or a web game in Chrome (needs Playwright in the game project). With `check_url`, a game check: bots play any web game someone posted (an itch.io page, github.io, Vercel), with nothing installed in it, on a desktop and a throttled phone, and make a report, a dashboard for that game and, on Glitchless Cloud, an unlisted share link to send its maker |
|
|
116
117
|
| `glitchless_deck` | Build the game, send it to the paired Steam Deck, add it to the Deck's library and optionally start it ([glitchless-deck](https://www.npmjs.com/package/glitchless-deck); pair once with `npx glitchless-deck pair`); with `measure: true`, measure a Unity, Godot or Unreal build there and compare it with a saved run |
|
|
117
118
|
|
|
118
119
|
The reads take `hours`, `version`, `env` (e.g. `prod`), `session_type` (`user` for players only, `tester` for people on TestFlight and other test builds, `synthetic` for bots, playtests and store test devices, `all`) and `props`, the session properties the game sets (`{ rank: "diamond" }`, or a list of values). Unless `env` or `session_type` is given, findings read the production sessions of players and say so; the other numbers count every session in the window.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glitchless-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"mcpName": "io.github.glitchless-gg/glitchless",
|
|
5
5
|
"description": "Coding agents can build a game. They can't see anyone play it. Glitchless lets them. The MCP server for Glitchless, game observability for coding agents: Claude Code, Codex, Cursor and others read real players' stutters, crashes, custom metrics and ranked findings in Unity, Godot, Unreal, Three.js, Roblox, Phaser and GameMaker games, build the game's own dashboard, and run playtest bots.",
|
|
6
6
|
"keywords": [
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"dependencies": {
|
|
68
68
|
"@modelcontextprotocol/server": "^2.4.0",
|
|
69
69
|
"zod": "^4.6.7",
|
|
70
|
-
"glitchless-playtest": "^0.
|
|
70
|
+
"glitchless-playtest": "^0.4.0",
|
|
71
71
|
"glitchless-deck": "^0.1.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
package/src/context.js
CHANGED
|
@@ -9,7 +9,7 @@ import path from 'node:path';
|
|
|
9
9
|
import { McpServer } from '@modelcontextprotocol/server';
|
|
10
10
|
import { z } from 'zod';
|
|
11
11
|
|
|
12
|
-
export const VERSION = '0.
|
|
12
|
+
export const VERSION = '0.22.0';
|
|
13
13
|
|
|
14
14
|
// Where `glitchless-mcp login` keeps its workspace key: { url, token, workspace: { id, name }, scopes }.
|
|
15
15
|
export const CREDENTIALS_FILE = path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config'), 'glitchless', 'credentials.json');
|
|
@@ -99,6 +99,13 @@ export const canManage = () => {
|
|
|
99
99
|
return !scopes || scopes.includes('manage');
|
|
100
100
|
};
|
|
101
101
|
|
|
102
|
+
// Whether this call's connection may delete games: over HTTP, by the scopes its token carries (a token can carry fewer
|
|
103
|
+
// than its key); on stdio, Glitchless Cloud decides by the key.
|
|
104
|
+
export const canDeleteGames = () => {
|
|
105
|
+
const scopes = calls.getStore()?.scopes;
|
|
106
|
+
return !scopes || scopes.includes('delete_games');
|
|
107
|
+
};
|
|
108
|
+
|
|
102
109
|
// Where an agent gets the steps that add Glitchless to a game's code, as the end of a sentence: from
|
|
103
110
|
// glitchless_create_game (setup-guide.js) where the connection has it, else the setup prompt.
|
|
104
111
|
export const setupSteps = () =>
|
|
@@ -120,6 +127,12 @@ export async function projectFor(game) {
|
|
|
120
127
|
return hit.id;
|
|
121
128
|
}
|
|
122
129
|
|
|
130
|
+
// After a game is deleted: later calls don't fall back to it.
|
|
131
|
+
export function forgetGame(id) {
|
|
132
|
+
const c = conn();
|
|
133
|
+
if (c.game === id) c.game = null;
|
|
134
|
+
}
|
|
135
|
+
|
|
123
136
|
// A workspace key names the game in x-glitchless-project. A key for one game sends the game a call names (or
|
|
124
137
|
// GLITCHLESS_GAME) as x-glitchless-game, so Glitchless Cloud refuses it when it isn't the key's game instead of
|
|
125
138
|
// answering, or writing, for the key's own game.
|
|
@@ -138,15 +151,59 @@ export async function agent(method, p, body) {
|
|
|
138
151
|
...(body ? { body: JSON.stringify(body) } : {}),
|
|
139
152
|
});
|
|
140
153
|
const data = await res.json().catch(() => ({}));
|
|
141
|
-
|
|
154
|
+
// The answer's code and fields go with the error, for a tool that answers one of them its own way.
|
|
155
|
+
if (!res.ok) throw Object.assign(new Error(`${data.error || `HTTP ${res.status}`}`), { code: data.code ?? null, data });
|
|
142
156
|
return data;
|
|
143
157
|
}
|
|
144
158
|
|
|
159
|
+
// A read the server refused (SPEC §3): it took too long and was stopped (503), or the server is busy with other large
|
|
160
|
+
// reads (429). Told apart by the body's `reason`, since a 429 is also a rate limit. → what to tell the agent, with what
|
|
161
|
+
// to do next in a tool's own terms, or null for any other answer.
|
|
162
|
+
const SMALLER = 'Call again with a smaller hours (for example 168, a week), then widen it if you need more.';
|
|
163
|
+
function refusal(res, text) {
|
|
164
|
+
if (res.status !== 503 && res.status !== 429) return null;
|
|
165
|
+
let data;
|
|
166
|
+
try {
|
|
167
|
+
data = JSON.parse(text);
|
|
168
|
+
} catch {
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
if (data?.reason === 'deadline') {
|
|
172
|
+
const after = String(data.error).match(/[\d.]+ seconds?/)?.[0];
|
|
173
|
+
return `This window was too big to read: Glitchless stopped the read${after ? ` after ${after}` : ''}. ${SMALLER}`;
|
|
174
|
+
}
|
|
175
|
+
if (data?.reason === 'busy' && data.behind === 'own') {
|
|
176
|
+
return 'Another large read of yours (a tool call running at the same time) was still running, so this one waited for it and ran out of time. Nothing is wrong with the call: make it again once the other call has answered, one call at a time, or with a smaller hours.';
|
|
177
|
+
}
|
|
178
|
+
if (data?.reason === 'busy') {
|
|
179
|
+
const wait = Number(res.headers.get('retry-after')) || 5;
|
|
180
|
+
return `Glitchless is busy with other large reads right now. Nothing is wrong with the call: make it again in ${wait} second${wait === 1 ? '' : 's'}, or now with a smaller hours.`;
|
|
181
|
+
}
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
// The hosted server answers a tool call within one web request, however many reads the tool makes, and each read has
|
|
186
|
+
// the server's 25 seconds of its own. So a call that has used this long gives up the read it is waiting on and says
|
|
187
|
+
// why, where the agent would otherwise get a dropped connection. (The read itself stops at the server's deadline.)
|
|
188
|
+
export const CALL_LIMITS = { ms: 27_000 };
|
|
189
|
+
function withinCall(read) {
|
|
190
|
+
const call = calls.getStore();
|
|
191
|
+
if (!call?.remote) return read;
|
|
192
|
+
let timer;
|
|
193
|
+
const late = new Promise((_, reject) => {
|
|
194
|
+
timer = setTimeout(() => reject(new Error(`This window was too big to read in one call: its reads took more than ${Math.round(CALL_LIMITS.ms / 100) / 10} seconds together (waiting for any other large read of yours running at the same time included), so the call was stopped. ${SMALLER} Make large calls one at a time.`)), Math.max(0, CALL_LIMITS.ms - (Date.now() - call.startedAt)));
|
|
195
|
+
});
|
|
196
|
+
return Promise.race([read, late]).finally(() => clearTimeout(timer));
|
|
197
|
+
}
|
|
198
|
+
|
|
145
199
|
export async function query(name, params = {}) {
|
|
146
200
|
const qs = new URLSearchParams();
|
|
147
201
|
for (const [k, v] of Object.entries(params)) if (v != null && v !== '') qs.set(k, String(v));
|
|
148
|
-
const res = await conn().fetch(`${base()}/v1/query/${name}?${qs}`, { headers: await headers() });
|
|
149
|
-
if (!res.ok)
|
|
202
|
+
const res = await withinCall(conn().fetch(`${base()}/v1/query/${name}?${qs}`, { headers: await headers() }));
|
|
203
|
+
if (!res.ok) {
|
|
204
|
+
const text = await res.text();
|
|
205
|
+
throw new Error(refusal(res, text) ?? `Glitchless API ${name} → HTTP ${res.status}: ${text.slice(0, 200)}${signInHint(res.status)}`);
|
|
206
|
+
}
|
|
150
207
|
const data = await res.json();
|
|
151
208
|
const call = calls.getStore();
|
|
152
209
|
if (call && data?.meta) Object.assign(call, { meta: data.meta, from: params.from });
|
|
@@ -231,7 +288,7 @@ export const common = {
|
|
|
231
288
|
.min(0.25)
|
|
232
289
|
.max(9600)
|
|
233
290
|
.optional()
|
|
234
|
-
.describe("Look-back window in hours (default 24), as far back as the workspace keeps data on Glitchless Cloud (the answer says when it starts later than asked). Past 744 (31 days) answers are by day."),
|
|
291
|
+
.describe("Look-back window in hours (default 24), as far back as the workspace keeps data on Glitchless Cloud (the answer says when it starts later than asked). Past 744 (31 days) answers are by day. A window that takes more than 25 seconds to read is stopped and the tool says so: ask again with fewer hours. When Glitchless is busy with other large reads the tool says to try again in a few seconds. On Glitchless Cloud an answer reads at most 100,000 raw events in all (session_type, props, matches and positions read them), the latest ones, and its note says from when."),
|
|
235
292
|
version: z.string().optional().describe('Only include sessions from this game version'),
|
|
236
293
|
steam_branch: z.string().optional().describe('Only include sessions that ran this Steam branch ("public", or a beta\'s name); games that use Steamworks send it'),
|
|
237
294
|
env: z.string().optional().describe('Only include sessions from this environment, e.g. "prod" (what the game passes to init; builds a developer runs usually send "dev")'),
|
|
@@ -283,17 +340,24 @@ const gameField = z.string().optional().describe('The game, by name or id, when
|
|
|
283
340
|
|
|
284
341
|
// A server with the tools. remote: the HTTP server's set (no local tools, and instructions to match); scopes: show
|
|
285
342
|
// only the tools these scopes allow; connection: what every call runs with (default: this process's own).
|
|
343
|
+
//
|
|
344
|
+
// The tools are all there before the server connects and never change while it runs, so it says it sends no
|
|
345
|
+
// tool-list changes (McpServer would say it does). A client that is promised them opens a subscriptions/listen
|
|
346
|
+
// stream and waits: over HTTP that is one request held open per connected agent, for news that never comes. Told
|
|
347
|
+
// there are none, a client doesn't listen, and one that listens anyway is acknowledged with nothing and closed at
|
|
348
|
+
// once. Every tools/list answer is marked stale straight away (ttlMs 0), so a client that asks again gets the
|
|
349
|
+
// current list; one that stays connected through a release keeps the list it loaded until it reconnects.
|
|
286
350
|
export function createServer({ remote = false, scopes = null, connection: c = null } = {}) {
|
|
287
351
|
const server = new McpServer(
|
|
288
352
|
{ name: 'glitchless', title: 'Glitchless', version: VERSION, websiteUrl: 'https://www.glitchless.gg', icons: [{ src: 'https://app.glitchless.gg/brand/glitchless-icon-512.png', mimeType: 'image/png', sizes: ['512x512'] }] },
|
|
289
|
-
{ instructions: instructions(remote, !scopes || scopes.includes('manage')) },
|
|
353
|
+
{ instructions: instructions(remote, !scopes || scopes.includes('manage')), capabilities: { tools: { listChanged: false } } },
|
|
290
354
|
);
|
|
291
355
|
for (const t of tools) {
|
|
292
356
|
if ((remote && t.local) || (scopes && !scopes.includes(t.scope))) continue;
|
|
293
357
|
const { inputSchema = {}, ...config } = t.config;
|
|
294
358
|
server.registerTool(t.name, { ...config, title: titleOf(t), inputSchema: z.object({ game: gameField, ...inputSchema }) }, (args = {}, ctx) => {
|
|
295
359
|
const run = () =>
|
|
296
|
-
calls.run({ game: args.game, server, remote, scopes }, async () => {
|
|
360
|
+
calls.run({ game: args.game, server, remote, scopes, startedAt: Date.now() }, async () => {
|
|
297
361
|
try {
|
|
298
362
|
return await t.handler(args, ctx);
|
|
299
363
|
} catch (err) {
|
|
@@ -326,7 +390,7 @@ function instructions(remote, manage = true) {
|
|
|
326
390
|
...(remote
|
|
327
391
|
? ['After shipping a fix (bump the version passed to Glitchless.init), use glitchless_compare_versions to confirm it with real players.']
|
|
328
392
|
: [
|
|
329
|
-
'Before changing game code, run glitchless_playtest with save_as "baseline"; after the change, run glitchless_playtest again to compare, and treat a FAIL as unfinished work. It plays a web game in Chrome, runs a Unity, Godot, Unreal or GameMaker build from its command (command, e.g. ["godot", "--path", "."]) with the game\'s autoplay flags, or plays a Roblox game (engine "roblox") in the open Roblox Studio, which needs Studio\'s MCP server on. After shipping a fix (bump the version passed to Glitchless.init), use glitchless_compare_versions to confirm it with real players.',
|
|
393
|
+
'Before changing game code, run glitchless_playtest with save_as "baseline"; after the change, run glitchless_playtest again to compare, and treat a FAIL as unfinished work. It plays a web game in Chrome, runs a Unity, Godot, Unreal or GameMaker build from its command (command, e.g. ["godot", "--path", "."]) with the game\'s autoplay flags, or plays a Roblox game (engine "roblox") in the open Roblox Studio, which needs Studio\'s MCP server on. With check_url it runs a game check: bots play any web game someone posted (an itch.io page, github.io, Vercel), with nothing installed in it, and make a report, a dashboard and a share link to send its maker. After shipping a fix (bump the version passed to Glitchless.init), use glitchless_compare_versions to confirm it with real players.',
|
|
330
394
|
'If the game is running in a browser with WebMCP connected, its live tools (glitchless_live_performance, glitchless_measure, glitchless_inspect_scene, and game tools such as zoomies_load_level) let you reproduce and measure issues directly. Unity, Godot, Unreal and GameMaker builds measure themselves when run with --glitchless-measure=SECONDS (-glitchless-measure in Unreal and GameMaker); in the Unreal editor, Unreal MCP with the Glitchless Toolset has a Measure tool.',
|
|
331
395
|
]),
|
|
332
396
|
].join(' ');
|