glitchless-mcp 0.21.0 → 0.23.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 +48 -8
- package/package.json +4 -4
- package/src/context.js +180 -38
- package/src/hosted-tools.js +1 -0
- package/src/http.js +8 -6
- package/src/index.js +6 -2
- package/src/login.js +31 -3
- package/src/request-state.js +47 -0
- package/src/served-skills.js +77 -0
- package/src/skills.js +10 -6
- package/src/tasks.js +123 -0
- package/src/tools/analytics.js +1 -1
- package/src/tools/core.js +2 -2
- package/src/tools/dashboard.js +1 -1
- package/src/tools/feedback.js +131 -0
- package/src/tools/multiplayer.js +8 -2
- package/src/tools/playtest.js +29 -15
- package/src/tools/store-reviews.js +2 -2
- package/src/tools/workspace.js +132 -15
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# glitchless-mcp
|
|
2
2
|
|
|
3
|
-
The [Glitchless](https://github.com/glitchless-gg/glitchless) MCP server.
|
|
4
|
-
|
|
5
|
-
Glitchless server:
|
|
6
|
-
|
|
3
|
+
The [Glitchless](https://github.com/glitchless-gg/glitchless) MCP server. Coding agents can build a game. They
|
|
4
|
+
don't know how anyone plays it. Glitchless tells them. Any coding agent (Claude Code, Codex, Cursor or another MCP
|
|
5
|
+
client) reads how players play your game, from a Glitchless server: where they stop and where they die, the game's
|
|
6
|
+
own events (modes, purchases), ranked findings on stutter, errors and crashes, multiplayer lag and version
|
|
7
|
+
comparisons, and on Glitchless Cloud what store reviews say and what the game earns. It can also run playtest bots
|
|
8
|
+
before and after a change, to check a fix.
|
|
7
9
|
|
|
8
10
|
It's a stdio server. Run it with `npx`, no install needed:
|
|
9
11
|
|
|
@@ -24,11 +26,13 @@ npx -y glitchless-mcp login
|
|
|
24
26
|
It prints a link and a code; you approve the code in the Glitchless dashboard, and it saves a workspace key in
|
|
25
27
|
`~/.config/glitchless/credentials.json` (readable only by you). From then on the server reaches every game in that
|
|
26
28
|
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
|
-
|
|
29
|
+
every tool takes `game` (a name or id). The key acts as you, with your role in the workspace, and never touches
|
|
30
|
+
billing or people. It deletes data only if you ticked "Delete games and their data, for good" when approving it, and
|
|
31
|
+
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
32
|
key, and Settings → Keys & access in the dashboard lists and revokes keys. An agent can also sign in from inside a
|
|
30
33
|
chat with the `glitchless_sign_in` tool: it shows the link and code, and the running server switches over once you
|
|
31
|
-
approve.
|
|
34
|
+
approve. In an agent that can open links for you (Claude Code does), it opens the approve page itself and waits for
|
|
35
|
+
you to approve it. The saved key is only ever sent to the server it was saved for: point `GLITCHLESS_URL` at another one (a
|
|
32
36
|
meetup's own box) and the MCP server connects without it, so set `GLITCHLESS_API_KEY` if that server has a key.
|
|
33
37
|
|
|
34
38
|
## Serve it over HTTP yourself
|
|
@@ -92,7 +96,7 @@ above go in its environment.
|
|
|
92
96
|
| --- | --- |
|
|
93
97
|
| `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
98
|
| `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 |
|
|
99
|
+
| `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 |
|
|
96
100
|
| `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
101
|
| `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
102
|
| `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 |
|
|
@@ -112,6 +116,7 @@ above go in its environment.
|
|
|
112
116
|
| `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
117
|
| `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
118
|
| `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` |
|
|
119
|
+
| `glitchless_feedback` | Tell the Glitchless team about a bug, a dead end, something missing or an idea while the agent works: a `message`, its `type` (bug, friction, missing, idea) and `impact` (blocked, worked_around, minor), and the `tool`, `task`, `expected`, `actual` and `engine` if it has them. Signed in to a Glitchless Cloud workspace it's sent at once and answers with the report's ID, which the agent tells the person; anywhere else nothing is sent, and it answers with a GitHub issue filled in with the report. 4,000 characters a report, 20 a day from a workspace |
|
|
115
120
|
| `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
121
|
| `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
122
|
|
|
@@ -120,6 +125,41 @@ The reads take `hours`, `version`, `env` (e.g. `prod`), `session_type` (`user` f
|
|
|
120
125
|
To let the agent drive the running game as well (measure frame times, inspect the scene, load a
|
|
121
126
|
level), add the WebMCP server beside this one: `npx -y @jason.today/webmcp@latest --mcp`.
|
|
122
127
|
|
|
128
|
+
## Skills
|
|
129
|
+
|
|
130
|
+
The server serves the Glitchless skills too, over MCP's
|
|
131
|
+
[Skills extension](https://modelcontextprotocol.io/extensions/skills/overview), so an agent whose client loads skills
|
|
132
|
+
from MCP servers gets them without installing a plugin:
|
|
133
|
+
|
|
134
|
+
| Skill | What it does |
|
|
135
|
+
| --- | --- |
|
|
136
|
+
| `instrument` | Adds Glitchless to a game, in its engine |
|
|
137
|
+
| `dashboard` | Works out what the game's developer wants to know, and designs the game's dashboard |
|
|
138
|
+
| `triage` | Finds the most important problem in a game, fixes it and checks the fix |
|
|
139
|
+
| `deck` | Sends a build to a Steam Deck on your network and measures it there (only from this server on your computer, not the hosted one) |
|
|
140
|
+
|
|
141
|
+
In Claude Code (v2.1.331 or later) they show under the server's name: `/glitchless:triage` for a server added as
|
|
142
|
+
`glitchless`. A client without skills over MCP gets the instrument and dashboard skills from the tools instead
|
|
143
|
+
(`glitchless_create_game` with `engine`, `glitchless_dashboard` with `guide: true`). `--no-skills` serves none, for a
|
|
144
|
+
client that has the skills already: the Glitchless plugin for Claude Code runs its copy of this server that way.
|
|
145
|
+
|
|
146
|
+
## Background tasks and questions
|
|
147
|
+
|
|
148
|
+
Two MCP features this server uses when the agent's client says it supports them, on the call itself (protocol
|
|
149
|
+
2026-07-28). Any other client gets the same answers as before.
|
|
150
|
+
|
|
151
|
+
- **Tasks.** A playtest or a game check takes minutes. A client that takes MCP tasks (Claude Code in an interactive
|
|
152
|
+
session) gets a task straight away and the agent keeps working while the bots play; it reads the result when
|
|
153
|
+
the task completes. Stopping the task stops the run: the browser closes, the build (and anything it started) is
|
|
154
|
+
killed or Studio's play test stops, and nothing is saved; that needs glitchless-playtest 0.5.0 or later. A call that
|
|
155
|
+
isn't a task runs to the end, as before. One run at a time in a project: a second call while one runs is refused. Tasks are served on stdio only (`npx glitchless-mcp`), and kept
|
|
156
|
+
for an hour after they finish, in the server's memory.
|
|
157
|
+
- **Questions (elicitation).** `glitchless_sign_in` opens the approve page for you, as above. Before
|
|
158
|
+
`glitchless_create_game` deletes a game, it asks you in a form, "Delete <game> for good?", every time, and deletes
|
|
159
|
+
only when you tick the box and accept. That's on top of the key's "Delete games and their data, for good", not instead of it. A
|
|
160
|
+
client that closes every question unanswered (Claude Code run headless, `claude -p`) can't delete a game this way:
|
|
161
|
+
the agent is told to send you to Settings → Game (with a link) to delete it yourself. The hosted server asks too, for clients on protocol 2026-07-28.
|
|
162
|
+
|
|
123
163
|
## License
|
|
124
164
|
|
|
125
165
|
MIT
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glitchless-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.0",
|
|
4
4
|
"mcpName": "io.github.glitchless-gg/glitchless",
|
|
5
|
-
"description": "Coding agents can build a game. They
|
|
5
|
+
"description": "Coding agents can build a game. They don't know how anyone plays it. Glitchless tells 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": [
|
|
7
7
|
"mcp",
|
|
8
8
|
"mcp-server",
|
|
@@ -65,9 +65,9 @@
|
|
|
65
65
|
"bundle": "esbuild src/index.js --bundle --platform=node --format=esm --target=node20 --external:playwright --outfile=../../plugin/glitchless/mcp/glitchless-mcp.mjs --banner:js=\"import { createRequire as __cr } from 'module'; const require = __cr(import.meta.url);\""
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@modelcontextprotocol/server": "
|
|
68
|
+
"@modelcontextprotocol/server": "~2.4.0",
|
|
69
69
|
"zod": "^4.6.7",
|
|
70
|
-
"glitchless-playtest": "^0.
|
|
70
|
+
"glitchless-playtest": "^0.5.0",
|
|
71
71
|
"glitchless-deck": "^0.1.0"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
package/src/context.js
CHANGED
|
@@ -6,10 +6,12 @@ import { AsyncLocalStorage } from 'node:async_hooks';
|
|
|
6
6
|
import fs from 'node:fs';
|
|
7
7
|
import os from 'node:os';
|
|
8
8
|
import path from 'node:path';
|
|
9
|
-
import { McpServer } from '@modelcontextprotocol/server';
|
|
9
|
+
import { McpServer, CLIENT_CAPABILITIES_META_KEY } from '@modelcontextprotocol/server';
|
|
10
10
|
import { z } from 'zod';
|
|
11
|
+
import { serveSkills } from './served-skills.js';
|
|
12
|
+
import { TASKS, declaresTasks, runAsTask, serveTasks } from './tasks.js';
|
|
11
13
|
|
|
12
|
-
export const VERSION = '0.
|
|
14
|
+
export const VERSION = '0.23.0';
|
|
13
15
|
|
|
14
16
|
// Where `glitchless-mcp login` keeps its workspace key: { url, token, workspace: { id, name }, scopes }.
|
|
15
17
|
export const CREDENTIALS_FILE = path.join(process.env.XDG_CONFIG_HOME || path.join(os.homedir(), '.config'), 'glitchless', 'credentials.json');
|
|
@@ -92,6 +94,14 @@ export const workspaceIntake = () => conn().games?.intake ?? null;
|
|
|
92
94
|
// for a connection without glitchless_create_game, which hands over the steps for the game's engine itself.
|
|
93
95
|
export const SETUP_URL = 'https://raw.githubusercontent.com/glitchless-gg/glitchless/main/docs/agent-setup-prompt.md';
|
|
94
96
|
|
|
97
|
+
// Whether an agent asks the person before it sends the Glitchless team feedback (glitchless_feedback). Off, as
|
|
98
|
+
// Cloudflare's agent feedback is: the agent sends, tells the person what it sent at the end of its turn, and never
|
|
99
|
+
// sends once they've said not to. The tool's description and the server's instructions both take the sentence from
|
|
100
|
+
// here; the skills and the setup prompt only name the tool, so asking first is this one line.
|
|
101
|
+
export const FEEDBACK_ASKS_FIRST = false;
|
|
102
|
+
export const feedbackConsent = () =>
|
|
103
|
+
FEEDBACK_ASKS_FIRST ? 'Ask the person before sending each one, showing what you would send.' : 'You may send one without asking first, but never once the person has said not to.';
|
|
104
|
+
|
|
95
105
|
// Whether this call's connection shows the tools that need the manage scope (over HTTP, by the scopes the person gave
|
|
96
106
|
// it; on stdio every tool shows).
|
|
97
107
|
export const canManage = () => {
|
|
@@ -99,6 +109,13 @@ export const canManage = () => {
|
|
|
99
109
|
return !scopes || scopes.includes('manage');
|
|
100
110
|
};
|
|
101
111
|
|
|
112
|
+
// Whether this call's connection may delete games: over HTTP, by the scopes its token carries (a token can carry fewer
|
|
113
|
+
// than its key); on stdio, Glitchless Cloud decides by the key.
|
|
114
|
+
export const canDeleteGames = () => {
|
|
115
|
+
const scopes = calls.getStore()?.scopes;
|
|
116
|
+
return !scopes || scopes.includes('delete_games');
|
|
117
|
+
};
|
|
118
|
+
|
|
102
119
|
// Where an agent gets the steps that add Glitchless to a game's code, as the end of a sentence: from
|
|
103
120
|
// glitchless_create_game (setup-guide.js) where the connection has it, else the setup prompt.
|
|
104
121
|
export const setupSteps = () =>
|
|
@@ -120,11 +137,25 @@ export async function projectFor(game) {
|
|
|
120
137
|
return hit.id;
|
|
121
138
|
}
|
|
122
139
|
|
|
140
|
+
// After a game is deleted: later calls don't fall back to it.
|
|
141
|
+
export function forgetGame(id) {
|
|
142
|
+
const c = conn();
|
|
143
|
+
if (c.game === id) c.game = null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// The app this call comes from, as it named itself connecting (MCP's clientInfo): { name, version }. A server over
|
|
147
|
+
// HTTP is made anew for each request, so a client that said it only when it connected (before the 2026-07-28 protocol)
|
|
148
|
+
// is named by its connection instead (the hosted server's: the OAuth client's name), with no version.
|
|
149
|
+
export const clientApp = () => {
|
|
150
|
+
const info = calls.getStore()?.server?.server.getClientVersion?.();
|
|
151
|
+
return { name: info?.name || conn().client || null, version: info?.name ? info.version || null : null };
|
|
152
|
+
};
|
|
153
|
+
|
|
123
154
|
// A workspace key names the game in x-glitchless-project. A key for one game sends the game a call names (or
|
|
124
155
|
// GLITCHLESS_GAME) as x-glitchless-game, so Glitchless Cloud refuses it when it isn't the key's game instead of
|
|
125
156
|
// answering, or writing, for the key's own game.
|
|
126
157
|
async function headers(extra = {}) {
|
|
127
|
-
const client = conn().client ||
|
|
158
|
+
const client = conn().client || clientApp().name || 'mcp';
|
|
128
159
|
const named = !isWorkspace() && (calls.getStore()?.game || conn().game);
|
|
129
160
|
return { 'x-glitchless-client': client, ...(apiKey() ? { 'x-glitchless-api-key': apiKey() } : {}), ...(isWorkspace() ? { 'x-glitchless-project': await projectFor(calls.getStore()?.game) } : {}), ...(named ? { 'x-glitchless-game': encodeURIComponent(named) } : {}), ...extra };
|
|
130
161
|
}
|
|
@@ -138,15 +169,59 @@ export async function agent(method, p, body) {
|
|
|
138
169
|
...(body ? { body: JSON.stringify(body) } : {}),
|
|
139
170
|
});
|
|
140
171
|
const data = await res.json().catch(() => ({}));
|
|
141
|
-
|
|
172
|
+
// The answer's code and fields go with the error, for a tool that answers one of them its own way.
|
|
173
|
+
if (!res.ok) throw Object.assign(new Error(`${data.error || `HTTP ${res.status}`}`), { code: data.code ?? null, data });
|
|
142
174
|
return data;
|
|
143
175
|
}
|
|
144
176
|
|
|
177
|
+
// A read the server refused (SPEC §3): it took too long and was stopped (503), or the server is busy with other large
|
|
178
|
+
// reads (429). Told apart by the body's `reason`, since a 429 is also a rate limit. → what to tell the agent, with what
|
|
179
|
+
// to do next in a tool's own terms, or null for any other answer.
|
|
180
|
+
const SMALLER = 'Call again with a smaller hours (for example 168, a week), then widen it if you need more.';
|
|
181
|
+
function refusal(res, text) {
|
|
182
|
+
if (res.status !== 503 && res.status !== 429) return null;
|
|
183
|
+
let data;
|
|
184
|
+
try {
|
|
185
|
+
data = JSON.parse(text);
|
|
186
|
+
} catch {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
if (data?.reason === 'deadline') {
|
|
190
|
+
const after = String(data.error).match(/[\d.]+ seconds?/)?.[0];
|
|
191
|
+
return `This window was too big to read: Glitchless stopped the read${after ? ` after ${after}` : ''}. ${SMALLER}`;
|
|
192
|
+
}
|
|
193
|
+
if (data?.reason === 'busy' && data.behind === 'own') {
|
|
194
|
+
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.';
|
|
195
|
+
}
|
|
196
|
+
if (data?.reason === 'busy') {
|
|
197
|
+
const wait = Number(res.headers.get('retry-after')) || 5;
|
|
198
|
+
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.`;
|
|
199
|
+
}
|
|
200
|
+
return null;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
// The hosted server answers a tool call within one web request, however many reads the tool makes, and each read has
|
|
204
|
+
// 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
|
|
205
|
+
// why, where the agent would otherwise get a dropped connection. (The read itself stops at the server's deadline.)
|
|
206
|
+
export const CALL_LIMITS = { ms: 27_000 };
|
|
207
|
+
function withinCall(read) {
|
|
208
|
+
const call = calls.getStore();
|
|
209
|
+
if (!call?.remote) return read;
|
|
210
|
+
let timer;
|
|
211
|
+
const late = new Promise((_, reject) => {
|
|
212
|
+
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)));
|
|
213
|
+
});
|
|
214
|
+
return Promise.race([read, late]).finally(() => clearTimeout(timer));
|
|
215
|
+
}
|
|
216
|
+
|
|
145
217
|
export async function query(name, params = {}) {
|
|
146
218
|
const qs = new URLSearchParams();
|
|
147
219
|
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)
|
|
220
|
+
const res = await withinCall(conn().fetch(`${base()}/v1/query/${name}?${qs}`, { headers: await headers() }));
|
|
221
|
+
if (!res.ok) {
|
|
222
|
+
const text = await res.text();
|
|
223
|
+
throw new Error(refusal(res, text) ?? `Glitchless API ${name} → HTTP ${res.status}: ${text.slice(0, 200)}${signInHint(res.status)}`);
|
|
224
|
+
}
|
|
150
225
|
const data = await res.json();
|
|
151
226
|
const call = calls.getStore();
|
|
152
227
|
if (call && data?.meta) Object.assign(call, { meta: data.meta, from: params.from });
|
|
@@ -154,9 +229,44 @@ export async function query(name, params = {}) {
|
|
|
154
229
|
}
|
|
155
230
|
|
|
156
231
|
// The tool call being answered: the game it names, the server answering it, the scopes its connection shows tools for
|
|
157
|
-
// (over HTTP),
|
|
232
|
+
// (over HTTP), the meta of its last query, for windowNote(), and its task when it runs as one (tasks.js).
|
|
158
233
|
const calls = new AsyncLocalStorage();
|
|
159
234
|
|
|
235
|
+
// How a tool that takes a while says what it's doing, and hears that it should stop. log(message) is a progress
|
|
236
|
+
// notification on the call when its client gave a progressToken, or the task's statusMessage when the call runs as a
|
|
237
|
+
// task. signal, only when the call runs as a task, fires when the client cancels the task (or the call, before it
|
|
238
|
+
// answered). A call that isn't a task keeps running when its client gives up on it, as it always has: a client whose
|
|
239
|
+
// tool timeout cancels a long playtest still gets its baseline saved.
|
|
240
|
+
//
|
|
241
|
+
// cantStop() says the work ignores signal (an older glitchless-playtest), so a cancelled task says so instead of
|
|
242
|
+
// claiming the run stopped.
|
|
243
|
+
export function callProgress(ctx) {
|
|
244
|
+
const task = calls.getStore()?.task;
|
|
245
|
+
if (task) return { log: task.update, signal: task.signal, cantStop: task.cantStop };
|
|
246
|
+
const token = ctx?.mcpReq?._meta?.progressToken;
|
|
247
|
+
let step = 0;
|
|
248
|
+
const log = (message) => {
|
|
249
|
+
if (token != null) ctx.mcpReq.notify({ method: 'notifications/progress', params: { progressToken: token, progress: ++step, message } }).catch(() => {});
|
|
250
|
+
};
|
|
251
|
+
return { log, signal: undefined, cantStop: () => {} };
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
// Whether this call's client can ask the person something while the call runs (MCP elicitation): mode 'form', fields
|
|
255
|
+
// to fill in, or 'url', a page to open. A tool asks by returning inputRequired(…): a client on the 2026-07-28 protocol
|
|
256
|
+
// asks the person and calls again with the answer, and on an older connection the SDK sends the question itself and
|
|
257
|
+
// calls the tool again. It's read where the SDK reads it: the request's own capabilities on 2026-07-28, else what the
|
|
258
|
+
// client said when it connected. A server over HTTP never hears that (each request gets a server of its own, which
|
|
259
|
+
// couldn't take the answer either), so an older client is never asked there. A bare elicitation: {} is form only.
|
|
260
|
+
export function canElicit(ctx, mode = 'form') {
|
|
261
|
+
const call = calls.getStore();
|
|
262
|
+
const s = call?.server?.server;
|
|
263
|
+
const modern = String(s?.getNegotiatedProtocolVersion?.() ?? '') >= '2026-07-28';
|
|
264
|
+
const caps = modern ? ctx?.mcpReq?.envelope?.[CLIENT_CAPABILITIES_META_KEY] : call?.remote ? undefined : s?.getClientCapabilities?.();
|
|
265
|
+
const e = caps?.elicitation;
|
|
266
|
+
if (!e || typeof e !== 'object') return false;
|
|
267
|
+
return mode === 'url' ? e.url !== undefined : e.form !== undefined || e.url === undefined;
|
|
268
|
+
}
|
|
269
|
+
|
|
160
270
|
// How the window was answered, when an agent should know: by day past 31 days, what is estimated, what a
|
|
161
271
|
// view covers, a range cut to the plan's retention.
|
|
162
272
|
function windowNote() {
|
|
@@ -231,7 +341,7 @@ export const common = {
|
|
|
231
341
|
.min(0.25)
|
|
232
342
|
.max(9600)
|
|
233
343
|
.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."),
|
|
344
|
+
.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 (props, Steam filters, matches and positions read them, and session_type only over data stored before it was kept by type), the latest ones, and its note says from when."),
|
|
235
345
|
version: z.string().optional().describe('Only include sessions from this game version'),
|
|
236
346
|
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
347
|
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")'),
|
|
@@ -253,16 +363,17 @@ export function filters({ version, steam_branch, env, session_type, props } = {}
|
|
|
253
363
|
}
|
|
254
364
|
|
|
255
365
|
// ── the tools ─────────────────────────────────────────────────────
|
|
256
|
-
// Every tool as its file defined it: { name, config, handler, scope, local }. Over HTTP a tool shows only to a
|
|
366
|
+
// Every tool as its file defined it: { name, config, handler, scope, local, task }. Over HTTP a tool shows only to a
|
|
257
367
|
// connection whose scopes include its `scope` (read, dashboard or manage, as a workspace key's), and `local` tools
|
|
258
|
-
// (signing in, playtests, the Steam Deck) are left out: they act on the computer the server runs on.
|
|
368
|
+
// (signing in, playtests, the Steam Deck) are left out: they act on the computer the server runs on. A `task` tool
|
|
369
|
+
// takes minutes, and runs as a task for a client that takes them (tasks.js): on stdio only.
|
|
259
370
|
const tools = [];
|
|
260
371
|
|
|
261
372
|
// The annotations a read gets: it changes nothing and reads only the person's own Glitchless data.
|
|
262
373
|
const READS = { readOnlyHint: true, destructiveHint: false, idempotentHint: true, openWorldHint: false };
|
|
263
374
|
|
|
264
|
-
export function define(name, config, handler, { scope = 'read', local = false } = {}) {
|
|
265
|
-
tools.push({ name, config: { ...config, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false, ...config.annotations } }, handler, scope, local });
|
|
375
|
+
export function define(name, config, handler, { scope = 'read', local = false, task = false } = {}) {
|
|
376
|
+
tools.push({ name, config: { ...config, annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: false, openWorldHint: false, ...config.annotations } }, handler, scope, local, task });
|
|
266
377
|
}
|
|
267
378
|
|
|
268
379
|
// A read-only tool.
|
|
@@ -282,54 +393,85 @@ const titleOf = (t) => t.config.title ?? `${t.name.replace(/^glitchless_/, '').r
|
|
|
282
393
|
const gameField = z.string().optional().describe('The game, by name or id, when signed in to a workspace (glitchless_list_games lists them); later calls keep it. With a key for one game (gl_sk_…), a call that names another game is refused: sign in to the workspace to reach every game.');
|
|
283
394
|
|
|
284
395
|
// A server with the tools. remote: the HTTP server's set (no local tools, and instructions to match); scopes: show
|
|
285
|
-
// only the tools these scopes allow; connection: what every call runs with (default: this process's own)
|
|
286
|
-
|
|
396
|
+
// only the tools these scopes allow; connection: what every call runs with (default: this process's own); skills:
|
|
397
|
+
// serve the skills over MCP (served-skills.js), which the Claude Code plugin's own copy turns off, since the plugin
|
|
398
|
+
// carries them itself.
|
|
399
|
+
//
|
|
400
|
+
// The tools are all there before the server connects and never change while it runs, so it says it sends no
|
|
401
|
+
// tool-list changes (McpServer would say it does). A client that is promised them opens a subscriptions/listen
|
|
402
|
+
// stream and waits: over HTTP that is one request held open per connected agent, for news that never comes. Told
|
|
403
|
+
// there are none, a client doesn't listen, and one that listens anyway is acknowledged with nothing and closed at
|
|
404
|
+
// once. Every tools/list answer is marked stale straight away (ttlMs 0), so a client that asks again gets the
|
|
405
|
+
// current list; one that stays connected through a release keeps the list it loaded until it reconnects.
|
|
406
|
+
//
|
|
407
|
+
// On stdio it also serves tasks (tasks.js), and says so in server/discover's capabilities: a `task` tool called by a
|
|
408
|
+
// client that takes tasks answers with one, and tasks/get, tasks/cancel and tasks/update answer for it. Over HTTP there
|
|
409
|
+
// are none.
|
|
410
|
+
export function createServer({ remote = false, scopes = null, connection: c = null, skills = true } = {}) {
|
|
287
411
|
const server = new McpServer(
|
|
288
412
|
{ 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,
|
|
413
|
+
{ instructions: instructions(remote, scopes), capabilities: { tools: { listChanged: false }, ...(remote ? {} : { extensions: { [TASKS]: {} } }) } },
|
|
290
414
|
);
|
|
415
|
+
if (skills) serveSkills(server, { remote, scopes });
|
|
291
416
|
for (const t of tools) {
|
|
292
417
|
if ((remote && t.local) || (scopes && !scopes.includes(t.scope))) continue;
|
|
293
418
|
const { inputSchema = {}, ...config } = t.config;
|
|
294
419
|
server.registerTool(t.name, { ...config, title: titleOf(t), inputSchema: z.object({ game: gameField, ...inputSchema }) }, (args = {}, ctx) => {
|
|
295
|
-
const
|
|
296
|
-
|
|
420
|
+
const call = { game: args.game, server, remote, scopes, startedAt: Date.now() };
|
|
421
|
+
const handle = () =>
|
|
422
|
+
calls.run(call, async () => {
|
|
297
423
|
try {
|
|
298
424
|
return await t.handler(args, ctx);
|
|
299
425
|
} catch (err) {
|
|
300
426
|
return fail(err);
|
|
301
427
|
}
|
|
302
428
|
});
|
|
429
|
+
// A tool that takes minutes, for a client that said on this call it takes tasks: the task, at once.
|
|
430
|
+
const run = t.task && !remote && declaresTasks(ctx, server.server) ? () => runAsTask((task) => ((call.task = task), handle()), { signal: ctx.mcpReq.signal }) : handle;
|
|
303
431
|
return c ? connections.run(c, run) : run();
|
|
304
432
|
});
|
|
305
433
|
}
|
|
434
|
+
if (!remote) {
|
|
435
|
+
serveTasks(server.server);
|
|
436
|
+
// Only a 2026-07-28 connection can take a task, so initialize's answer (an older client) leaves the extension out;
|
|
437
|
+
// server/discover lists it. Other extensions stay as they are.
|
|
438
|
+
const capabilities = server.server.getCapabilities.bind(server.server);
|
|
439
|
+
server.server.getCapabilities = () => {
|
|
440
|
+
const caps = capabilities();
|
|
441
|
+
if (!caps.extensions?.[TASKS] || String(server.server.getNegotiatedProtocolVersion?.() ?? '') >= '2026-07-28') return caps;
|
|
442
|
+
const { extensions, ...rest } = caps;
|
|
443
|
+
const { [TASKS]: _tasks, ...others } = extensions;
|
|
444
|
+
return Object.keys(others).length ? { ...rest, extensions: others } : rest;
|
|
445
|
+
};
|
|
446
|
+
}
|
|
306
447
|
return server;
|
|
307
448
|
}
|
|
308
449
|
|
|
309
|
-
//
|
|
310
|
-
|
|
450
|
+
// The server's instructions, which an agent reads before any tool. Claude Code keeps 4,096 characters of them (2,048
|
|
451
|
+
// before v2.1.296), and with tool search they and the tools' names are all it loads upfront: so they say what
|
|
452
|
+
// Glitchless is, which tool starts each kind of task and when to reach for the tools, most important first, in under
|
|
453
|
+
// 2,048 characters for every connection (test/instructions.test.js). The rest is in each tool's own description and in
|
|
454
|
+
// the skills (served-skills.js). They name only tools the connection has: scopes as createServer's.
|
|
455
|
+
function instructions(remote, scopes = null) {
|
|
456
|
+
const can = (scope) => !scopes || scopes.includes(scope);
|
|
311
457
|
return [
|
|
312
|
-
|
|
313
|
-
manage
|
|
314
|
-
? "To add Glitchless to a game
|
|
458
|
+
"Glitchless is observability for games made with Unity, Godot, Unreal, Three.js, GameMaker, Roblox, Phaser, Babylon.js or PlayCanvas: what players run into (stutters, crashes, errors, where they quit), the game's own metrics, multiplayer, store reviews and revenue. Use these tools when the person asks to set up Glitchless, analytics or telemetry in a game, or about its players, performance, crashes, metrics or dashboard.",
|
|
459
|
+
can('manage')
|
|
460
|
+
? "To add Glitchless to a game, call glitchless_create_game first, before changing the game's code, with the game's name and its engine, or files: what you find in the game's folder. It returns that engine's steps."
|
|
315
461
|
: `To add Glitchless to a game, follow the setup steps at ${SETUP_URL}: this connection may only read, so the person makes the game in Glitchless, and glitchless_list_games then has its client token.`,
|
|
316
462
|
remote
|
|
317
|
-
? "You're connected to the person's
|
|
318
|
-
: "On Glitchless Cloud, glitchless_sign_in connects you to the person's whole workspace
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
'
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
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. 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
|
-
'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
|
-
]),
|
|
332
|
-
].join(' ');
|
|
463
|
+
? "You're connected to the person's workspace: glitchless_list_games lists its games, and every tool takes game (by name). If a game hasn't sent data yet, say so first and give the person its next_step before answering anything else."
|
|
464
|
+
: "On Glitchless Cloud, glitchless_sign_in connects you to the person's whole workspace.",
|
|
465
|
+
"To read a game, start with glitchless_triage (headline numbers and ranked findings), then drill in: glitchless_performance, glitchless_get_error, glitchless_player_funnel (levels), glitchless_session, glitchless_bug_reports (players' own reports) and glitchless_events (the game's own metrics).",
|
|
466
|
+
`Multiplayer: glitchless_network, glitchless_match and glitchless_servers. Store reviews, vitals and sales: glitchless_store. Revenue: glitchless_revenue. The game's dashboard: glitchless_dashboard${can('dashboard') ? ', and after instrumenting a game, design one that fits it with glitchless_set_dashboard' : ''}.${can('manage') ? ' A read-only link to a board: glitchless_share_links.' : ''}`,
|
|
467
|
+
remote ? '' : 'Before changing game code, run glitchless_playtest with save_as "baseline"; after the change, run it again and treat a FAIL as unfinished work.',
|
|
468
|
+
'After shipping a fix, glitchless_compare_versions confirms it with real players.',
|
|
469
|
+
// Last, as the one thing an agent does for the Glitchless team rather than the person: the tool's own description
|
|
470
|
+
// says it all again.
|
|
471
|
+
`When a Glitchless tool fails in a way you can't get around, a setup step doesn't work, or the person asks for something Glitchless can't do, tell the Glitchless team with glitchless_feedback. ${feedbackConsent()} At the end of your turn, tell the person what you sent and the ID it gave.`,
|
|
472
|
+
]
|
|
473
|
+
.filter(Boolean)
|
|
474
|
+
.join(' ');
|
|
333
475
|
}
|
|
334
476
|
|
|
335
477
|
// An issue in a list: with `resolved` or `came_back` when the game's owner resolved it (glitchless_resolve_error).
|
package/src/hosted-tools.js
CHANGED
package/src/http.js
CHANGED
|
@@ -20,15 +20,17 @@ import './hosted-tools.js';
|
|
|
20
20
|
export const MAX_BODY = 4 * 1024 * 1024;
|
|
21
21
|
|
|
22
22
|
// → { fetch(Request, { authInfo }) → Response, handle(req, res, opts), close() }. opts: { connection (default: this
|
|
23
|
-
// process's own), scopes (default: every tool), token, clientId }.
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
// process's own), scopes (default: every tool), token, clientId }. skills: false serves no skills (served-skills.js),
|
|
24
|
+
// and so does a request to /mcp?skills=off, for a client whose plugin carries the skills itself.
|
|
25
|
+
export function createHttpHandler({ responseMode = 'auto', onerror, skills = true } = {}) {
|
|
26
|
+
const mcp = createMcpHandler(({ authInfo }) => createServer({ remote: true, connection: authInfo?.extra?.connection ?? null, scopes: authInfo?.extra?.scopes ?? null, skills: skills && authInfo?.extra?.skills !== false }), { responseMode, onerror, maxRequestBodySize: MAX_BODY });
|
|
26
27
|
return {
|
|
27
28
|
fetch: mcp.fetch,
|
|
28
29
|
async handle(req, res, { connection = null, scopes = null, token = '', clientId = '' } = {}) {
|
|
29
30
|
const request = await toRequest(req, res);
|
|
30
31
|
if (!request) return;
|
|
31
|
-
|
|
32
|
+
const served = new URL(request.url).searchParams.get('skills') !== 'off';
|
|
33
|
+
await send(res, await mcp.fetch(request, { authInfo: { token, clientId, scopes: scopes ?? [], extra: { connection, scopes, skills: served } } }));
|
|
32
34
|
},
|
|
33
35
|
close: mcp.close,
|
|
34
36
|
};
|
|
@@ -66,7 +68,7 @@ async function send(res, response) {
|
|
|
66
68
|
// The hosted tools at http://<host>:<port>/mcp, reading with this machine's key or self-hosted server (as the stdio
|
|
67
69
|
// server does: GLITCHLESS_URL, GLITCHLESS_API_KEY or a saved sign-in). On this computer only by default, where it
|
|
68
70
|
// checks Host and Origin against DNS rebinding; to listen beyond it, set GLITCHLESS_MCP_TOKEN and clients send it as
|
|
69
|
-
// Authorization: Bearer.
|
|
71
|
+
// Authorization: Bearer. --no-skills serves no skills.
|
|
70
72
|
const LOOPBACK = new Set(['localhost', '127.0.0.1', '[::1]', '::1']);
|
|
71
73
|
const hostname = (value) => {
|
|
72
74
|
try {
|
|
@@ -87,7 +89,7 @@ export async function serve(argv = []) {
|
|
|
87
89
|
const token = process.env.GLITCHLESS_MCP_TOKEN || '';
|
|
88
90
|
const local = LOOPBACK.has(host);
|
|
89
91
|
if (!local && !token) throw new Error(`Listening on ${host} lets other computers in: set GLITCHLESS_MCP_TOKEN, and clients send it as Authorization: Bearer.`);
|
|
90
|
-
const mcp = createHttpHandler();
|
|
92
|
+
const mcp = createHttpHandler({ skills: !argv.includes('--no-skills') });
|
|
91
93
|
const server = http.createServer(async (req, res) => {
|
|
92
94
|
const deny = (status, error, extra = {}) => res.writeHead(status, { 'content-type': 'application/json', ...extra }).end(JSON.stringify({ error }));
|
|
93
95
|
if (new URL(req.url, 'http://local').pathname !== '/mcp') return deny(404, 'Not found: the MCP endpoint is /mcp.');
|
package/src/index.js
CHANGED
|
@@ -12,7 +12,10 @@
|
|
|
12
12
|
//
|
|
13
13
|
// Or serve it over Streamable HTTP, for clients that connect to a URL (http.js):
|
|
14
14
|
//
|
|
15
|
-
// npx -y glitchless-mcp serve [--port 3001] [--host 127.0.0.1]
|
|
15
|
+
// npx -y glitchless-mcp serve [--port 3001] [--host 127.0.0.1] [--no-skills]
|
|
16
|
+
//
|
|
17
|
+
// Both serve the Glitchless skills over MCP too (served-skills.js); --no-skills leaves them out, for a client that
|
|
18
|
+
// already has them, such as the Claude Code plugin's own copy of this server or the DeepSeek Harness plugin.
|
|
16
19
|
//
|
|
17
20
|
// The connection and the list of tools are in context.js; each area's tools are in tools/<area>.js, and a new area
|
|
18
21
|
// is one more file imported in hosted-tools.js (or here, for a tool that acts on this computer).
|
|
@@ -34,5 +37,6 @@ if (process.argv[2] === 'serve') {
|
|
|
34
37
|
await import('./hosted-tools.js');
|
|
35
38
|
await import('./tools/playtest.js');
|
|
36
39
|
await import('./tools/deck.js');
|
|
37
|
-
|
|
40
|
+
const skills = !process.argv.includes('--no-skills');
|
|
41
|
+
serveStdio(() => createServer({ skills }));
|
|
38
42
|
}
|
package/src/login.js
CHANGED
|
@@ -22,11 +22,39 @@ async function call(url, p, body) {
|
|
|
22
22
|
return data;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
//
|
|
26
|
-
//
|
|
25
|
+
// Whether page, the approve page a server named, is that server's own: https on its host or its site (the API at
|
|
26
|
+
// api.glitchless.gg, the page at app.glitchless.gg), or http on this computer for a server on this computer. Nothing
|
|
27
|
+
// else is shown or opened, so a server can't send the person to a page of anyone else's.
|
|
28
|
+
const LOOPBACK = (h) => h === 'localhost' || h.endsWith('.localhost') || h === '[::1]' || /^127\./.test(h);
|
|
29
|
+
export function ownPage(api, page) {
|
|
30
|
+
let a;
|
|
31
|
+
let p;
|
|
32
|
+
try {
|
|
33
|
+
a = new URL(api);
|
|
34
|
+
p = new URL(page);
|
|
35
|
+
} catch {
|
|
36
|
+
return false;
|
|
37
|
+
}
|
|
38
|
+
if (p.username || p.password) return false;
|
|
39
|
+
if (p.protocol === 'http:') return LOOPBACK(p.hostname) && LOOPBACK(a.hostname);
|
|
40
|
+
if (p.protocol !== 'https:') return false;
|
|
41
|
+
const host = a.hostname;
|
|
42
|
+
const site = host.split('.').slice(1).join('.');
|
|
43
|
+
return p.hostname === host || p.hostname.endsWith(`.${host}`) || (site.includes('.') && (p.hostname === site || p.hostname.endsWith(`.${site}`)));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// How long a code lasts, in words: "10 minutes".
|
|
47
|
+
export const lasts = (seconds) => {
|
|
48
|
+
const m = Math.round(seconds / 60);
|
|
49
|
+
return m >= 1 ? `${m} minute${m === 1 ? '' : 's'}` : `${Math.max(1, Math.round(seconds))} seconds`;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// → { verification_url, user_code, expires_in, wait() }: wait() resolves with the saved credentials, or rejects when
|
|
53
|
+
// the person turns it down or the code expires. Throws when the server's approve page isn't its own (ownPage).
|
|
27
54
|
export async function startSignIn({ url = CLOUD_URL, client = `glitchless-mcp on ${os.hostname()}` } = {}) {
|
|
28
55
|
url = url.replace(/\/$/, '');
|
|
29
56
|
const start = await call(url, '/connect', { client });
|
|
57
|
+
if (!ownPage(url, start.verification_url)) throw new Error(`${url} answered with an approve page on another site (${String(start.verification_url).slice(0, 120)}), so it wasn't shown or opened. Sign in only to a Glitchless server you trust, with its own address as url.`);
|
|
30
58
|
const deadline = Date.now() + start.expires_in * 1000;
|
|
31
59
|
let interval = (start.interval || 2) * 1000;
|
|
32
60
|
async function wait() {
|
|
@@ -40,7 +68,7 @@ export async function startSignIn({ url = CLOUD_URL, client = `glitchless-mcp on
|
|
|
40
68
|
}
|
|
41
69
|
throw new Error('The sign-in code expired before it was approved. Start again.');
|
|
42
70
|
}
|
|
43
|
-
return { verification_url: start.verification_url, user_code: start.user_code, wait };
|
|
71
|
+
return { verification_url: start.verification_url, user_code: start.user_code, expires_in: start.expires_in, wait };
|
|
44
72
|
}
|
|
45
73
|
|
|
46
74
|
export function saveCredentials(c) {
|