glitchless-mcp 0.11.0 → 0.12.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 +2 -0
- package/package.json +1 -1
- package/src/context.js +1 -1
- package/src/tools/core.js +12 -3
- package/src/tools/workspace.js +96 -2
package/README.md
CHANGED
|
@@ -94,6 +94,8 @@ above go in its environment.
|
|
|
94
94
|
| `glitchless_create_game` | A new game in the workspace, with its client token and intake URL; `demo: true` makes the demo game (a week of sample play) |
|
|
95
95
|
| `glitchless_share_board` | A read-only link to one board page, for a dev log, Discord or a game's "Live stats" link; `glitchless_list_share_links` and `glitchless_revoke_share_link` manage them |
|
|
96
96
|
| `glitchless_triage` | Ranked findings: stutter per level and what it correlates with, leaks, top errors, difficulty spikes. Start here |
|
|
97
|
+
| `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); `clear: true` removes the mark |
|
|
98
|
+
| `glitchless_alerts` | A game's alerts: where they go, which rules are on, the weekly summary, the env, and the last sends; `glitchless_set_alerts` turns rules, the weekly summary and email on or off, sets the env, removes the webhook and sends a test (a webhook URL is added in Settings → Alerts) |
|
|
97
99
|
| `glitchless_overview` | Headline numbers: sessions, players, crash-free sessions, frame time against the budget, rage quits |
|
|
98
100
|
| `glitchless_performance` | Frame time per level, with draw calls, geometry counts and game gauges |
|
|
99
101
|
| `glitchless_get_error` | One error issue, with its stack and the gameplay before it |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "glitchless-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.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, Phaser and GameMaker games, build the game's own dashboard, and run playtest bots.",
|
|
6
6
|
"keywords": [
|
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.12.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');
|
package/src/tools/core.js
CHANGED
|
@@ -15,7 +15,16 @@ tool('glitchless_list_games', 'List the games: with a workspace key, every game
|
|
|
15
15
|
return reply(`No games in this workspace yet. ${make} Then add Glitchless to the game's code with its client token: the setup steps are at ${SETUP_URL}. ${CANT_EDIT.replaceAll('<the game>', 'my game')}`, []);
|
|
16
16
|
}
|
|
17
17
|
const intake = workspaceIntake();
|
|
18
|
-
|
|
18
|
+
const rows = list.map((g) => (g.services?.length ? g : { ...g, next_step: nextStep(g, intake) }));
|
|
19
|
+
// A new workspace starts with the demo game only: say it's sample play, and how the person's own game gets in.
|
|
20
|
+
if (list.every((g) => g.demo)) {
|
|
21
|
+
const who = await agent('GET', '/whoami').catch(() => null);
|
|
22
|
+
const add = who?.scopes?.includes('manage')
|
|
23
|
+
? "To add the person's own game, glitchless_create_game with its name."
|
|
24
|
+
: `To add the person's own game, they name it in Glitchless (${who?.dashboard ?? 'the dashboard'}): this connection may only read, so it can't create games.`;
|
|
25
|
+
return reply(`Only the demo game so far: ${list[0].name} is a week of sample play to try every tool on (start with glitchless_triage on it). ${add} Then Glitchless goes into the game's code with its client token: the setup steps are at ${SETUP_URL}. ${CANT_EDIT.replaceAll('<the game>', 'my game')}`, rows);
|
|
26
|
+
}
|
|
27
|
+
return reply(`${list.length} game(s) in this workspace. Name one with game in any tool:`, rows);
|
|
19
28
|
}
|
|
20
29
|
const { services } = await query('services');
|
|
21
30
|
return reply(`${services.length} game(s) reporting to ${base()}`, services.map((s) => ({ ...s, last_seen: new Date(s.last_seen).toISOString() })));
|
|
@@ -23,13 +32,13 @@ tool('glitchless_list_games', 'List the games: with a workspace key, every game
|
|
|
23
32
|
|
|
24
33
|
tool(
|
|
25
34
|
'glitchless_triage',
|
|
26
|
-
"Ranked findings for a game: performance spikes per level (with the gauges, counter bursts and events they correlate with), memory leaks, top errors, difficulty spikes / rage-quit hotspots, walls (a level, or one value of a level start's attribute such as a tier), version regressions, settings that run slow (a session property), the network (a whole lobby lagging at once: the server; one kind of connection, platform or region lagging; disconnects rising in a release) and the game's dedicated servers (falling behind when full, a crash that ends matches, memory that keeps climbing) — ranked by severity and player impact, each with evidence and a suggested fix, and naming a session property when most of a problem falls on one value. Start here when asked 'what's wrong with my game?'.",
|
|
35
|
+
"Ranked findings for a game: performance spikes per level (with the gauges, counter bursts and events they correlate with), memory leaks, top errors, difficulty spikes / rage-quit hotspots, walls (a level, or one value of a level start's attribute such as a tier), version regressions, settings that run slow (a session property), the network (a whole lobby lagging at once: the server; one kind of connection, platform or region lagging; disconnects rising in a release) and the game's dedicated servers (falling behind when full, a crash that ends matches, memory that keeps climbing) — ranked by severity and player impact, each with evidence and a suggested fix, and naming a session property when most of a problem falls on one value. Findings the game's owner marked known (glitchless_mark_known) come after the rest with `known` and its note: accepted, not new. One that got worse since has `came_back` instead. Start here when asked 'what's wrong with my game?'.",
|
|
27
36
|
{ ...common },
|
|
28
37
|
async ({ service, hours, ...f }) => {
|
|
29
38
|
const svc = await resolveService(service);
|
|
30
39
|
const { version } = f;
|
|
31
40
|
const { findings, meta } = await query('findings', { service: svc, ...filters(f), ...range(hours) });
|
|
32
|
-
const brief = findings.map((f, i) => `${i + 1}. [${f.severity.toUpperCase()}] ${f.title}`).join('\n');
|
|
41
|
+
const brief = findings.map((f, i) => `${i + 1}. [${f.severity.toUpperCase()}${f.known ? ', KNOWN' : ''}] ${f.title}${f.known ? ` (known: ${f.known.note})` : f.came_back ? ` (marked known, back: ${f.came_back.why})` : ''}`).join('\n');
|
|
33
42
|
return reply(`Findings for ${svc} (${hours || 24}h${version ? `, ${version}` : ''}):\n${brief || 'Nothing unusual.'}\n\nFull findings with evidence (window ${new Date(meta?.from).toISOString()} → now):`, findings);
|
|
34
43
|
},
|
|
35
44
|
);
|
package/src/tools/workspace.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// A workspace's games, for an agent signed in with a workspace key (glitchless_sign_in, `glitchless-mcp login`, or
|
|
2
|
-
// OAuth over HTTP): sign in, create a game,
|
|
3
|
-
// saving their dashboards are the other tools, with `game`.
|
|
2
|
+
// OAuth over HTTP): sign in, create a game, make or revoke share links, mark findings known, and read and change a
|
|
3
|
+
// game's alerts. Listing games, reading any of them and saving their dashboards are the other tools, with `game`.
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { define, base, isWorkspace, agent, workspaceGames, projectFor, resolveService, reply, useCredentials, readCredentials } from '../context.js';
|
|
6
6
|
import { startSignIn, CLOUD_URL } from '../login.js';
|
|
@@ -94,6 +94,100 @@ act(
|
|
|
94
94
|
{ annotations: { readOnlyHint: true, idempotentHint: true } },
|
|
95
95
|
);
|
|
96
96
|
|
|
97
|
+
act(
|
|
98
|
+
'glitchless_mark_known',
|
|
99
|
+
"Mark a standing finding as known, so the weekly summary email stops listing it: the game's owner has looked at it and accepts it (a slow first launch they chose, a freeze they can't avoid). glitchless_triage still shows it, after the rest, with `known` and the note. finding is a finding's id from glitchless_triage, or the start of one (\"perf-level-tutorial_1_\" covers those levels). until (YYYY-MM-DD) brings it back the day after; until_worse brings it back if it gets a quarter worse than over the last 7 days (its severity, the share of sessions it hits or its key number), and needs the finding to show now. clear: true removes the mark. Without finding, lists the game's known findings. Only the person's say-so makes a finding known: ask before marking one. Needs an Owner's or Admin's key, as alert settings do.",
|
|
100
|
+
{
|
|
101
|
+
finding: z.string().optional().describe('A finding id from glitchless_triage, e.g. "load-ttff", or the start of one, e.g. "perf-level-tutorial_1_"'),
|
|
102
|
+
note: z.string().optional().describe('Why it is accepted, in a few words (200 characters at most), e.g. "First launch compiles shaders; accepted"'),
|
|
103
|
+
until: z.string().optional().describe('YYYY-MM-DD: known through that day, listed again from the day after'),
|
|
104
|
+
until_worse: z.boolean().optional().describe('Known only while it is no worse than it is now'),
|
|
105
|
+
clear: z.boolean().optional().describe('Remove the mark, so the weekly summary lists it again'),
|
|
106
|
+
},
|
|
107
|
+
async ({ finding, note, until, until_worse, clear, game }) => {
|
|
108
|
+
const pid = await projectFor(game);
|
|
109
|
+
if (!finding) {
|
|
110
|
+
const { known } = await agent('GET', `/games/${pid}/known`);
|
|
111
|
+
return reply(known.length ? `${known.length} known finding(s), left out of the weekly summary:` : 'No known findings: the weekly summary lists every finding worth fixing.', known);
|
|
112
|
+
}
|
|
113
|
+
if (!clear && !note) throw new Error('say why it is known in note (a few words), or pass clear: true to remove the mark');
|
|
114
|
+
const { known } = await agent('POST', `/games/${pid}/known`, clear ? { finding, clear: true } : { finding, note, until, until_worse });
|
|
115
|
+
return reply(clear ? `${finding} is no longer known: the weekly summary lists it again when it is worth fixing.` : `Marked ${finding} as known. The weekly summary leaves it out; glitchless_triage shows it after the rest, with the note. Known findings:`, known);
|
|
116
|
+
},
|
|
117
|
+
// It replaces an entry's note, and clear removes one.
|
|
118
|
+
{ title: 'Mark finding known', annotations: { destructiveHint: true, idempotentHint: true } },
|
|
119
|
+
);
|
|
120
|
+
|
|
121
|
+
// What each alert rule tells the team (server/src/alerts.js ALERT_RULES).
|
|
122
|
+
const RULES = {
|
|
123
|
+
crashes: 'more players crash in the last 6 hours than usual for those hours',
|
|
124
|
+
new_error: 'a new error is spreading',
|
|
125
|
+
release: 'the newest version stutters or crashes for more players than the one before',
|
|
126
|
+
quiet: 'the game went quiet (and a note when sessions are back)',
|
|
127
|
+
store: "a store limit that cuts the game's visibility (Google Play's bad-behaviour thresholds)",
|
|
128
|
+
plan: "the plan's play sessions for the month reach 80% and 100%",
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
// A game's alert settings (GET /v1/agent/games/:game/alerts) in a few lines.
|
|
132
|
+
function alertLines({ alerts: a, log = [] }) {
|
|
133
|
+
const channels = [a.webhook && `${a.webhook.format} webhook (${a.webhook.host}, ${a.webhook.hint})`, a.email && `email to ${a.emailRecipients} member(s)`].filter(Boolean);
|
|
134
|
+
const rules = Object.keys(RULES).map((r) => ` ${a.rules[r] ? 'on ' : 'off'} ${r}: ${RULES[r]}`);
|
|
135
|
+
const sent = log.slice(0, 5).map((x) => ` ${x.at ? new Date(x.at).toISOString().slice(0, 16).replace('T', ' ') : '?'} ${x.test ? '(test) ' : ''}${x.title} → ${(x.sent ?? []).map((s) => `${s.channel} ${s.ok ? 'ok' : `failed: ${s.error ?? '?'}`}`).join(', ') || 'nowhere'}`);
|
|
136
|
+
return [
|
|
137
|
+
`Alerts are ${a.on ? 'on' : 'off'}${a.on ? '' : channels.length ? ': every rule and the weekly summary are off' : ': nowhere to send yet (a webhook is added in Settings → Alerts; email: glitchless_set_alerts email: true)'}.`,
|
|
138
|
+
`Channels: ${channels.join(' and ') || 'none'}.`,
|
|
139
|
+
`Rules:\n${rules.join('\n')}`,
|
|
140
|
+
`Weekly summary (Mondays, the findings worth fixing): ${a.weekly ? 'on' : 'off'}. Sessions counted: ${a.env ? `env ${a.env}` : 'any env'}. Known findings left out of it: ${a.known?.length ?? 0} (glitchless_mark_known).`,
|
|
141
|
+
`Last sends:\n${sent.join('\n') || ' none yet'}`,
|
|
142
|
+
].join('\n');
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
define(
|
|
146
|
+
'glitchless_alerts',
|
|
147
|
+
{
|
|
148
|
+
title: 'Alerts',
|
|
149
|
+
description:
|
|
150
|
+
"A game's alerts: where they go (a Discord or Slack webhook, email to the workspace's members), which rules are on (crashes, new_error, release, quiet, store, plan), the weekly summary of findings worth fixing, the env they count, how many findings are marked known, and the last sends with what each channel answered. glitchless_set_alerts changes them.",
|
|
151
|
+
inputSchema: {},
|
|
152
|
+
annotations: { readOnlyHint: true, idempotentHint: true },
|
|
153
|
+
},
|
|
154
|
+
async ({ game }) => {
|
|
155
|
+
const pid = await projectFor(game);
|
|
156
|
+
const view = await agent('GET', `/games/${pid}/alerts`);
|
|
157
|
+
return reply(alertLines(view), view);
|
|
158
|
+
},
|
|
159
|
+
);
|
|
160
|
+
|
|
161
|
+
act(
|
|
162
|
+
'glitchless_set_alerts',
|
|
163
|
+
"Change a game's alerts: turn rules on or off (crashes: more players crash than usual; new_error: a new error spreading; release: the newest version worse than the one before; quiet: the game went quiet; store: a store limit that cuts visibility; plan: the plan's play sessions running out), the weekly summary, email to the workspace's members, the env alerts count (\"\" for any), remove the webhook, or send a test alert to every channel. Only what you pass changes. A webhook URL can't be added here: the person pastes it in Settings → Alerts, as it's a secret. To stop the weekly summary listing one finding, use glitchless_mark_known instead of turning it off. Ask the person before changing their alerts. Needs an Owner's or Admin's key.",
|
|
164
|
+
{
|
|
165
|
+
rules: z
|
|
166
|
+
.object(Object.fromEntries(Object.entries(RULES).map(([r, what]) => [r, z.boolean().optional().describe(what)])))
|
|
167
|
+
.partial()
|
|
168
|
+
.optional()
|
|
169
|
+
.describe('Rules to turn on (true) or off (false); the rest stay as they are'),
|
|
170
|
+
weekly: z.boolean().optional().describe('The weekly summary on Mondays: how the week went and the findings worth fixing'),
|
|
171
|
+
email: z.boolean().optional().describe("Email every active member of the workspace"),
|
|
172
|
+
env: z.string().optional().describe('Count only sessions from this env (as the game passes it to init, e.g. "prod"); "" for any'),
|
|
173
|
+
remove_webhook: z.boolean().optional().describe('Remove the Discord or Slack webhook'),
|
|
174
|
+
test: z.boolean().optional().describe('Then send a test alert to every channel, to check they arrive'),
|
|
175
|
+
},
|
|
176
|
+
async ({ rules, weekly, email, env, remove_webhook, test, game }) => {
|
|
177
|
+
const pid = await projectFor(game);
|
|
178
|
+
const change = { ...(rules && Object.keys(rules).length ? { rules } : {}), ...(weekly !== undefined ? { weekly } : {}), ...(email !== undefined ? { email } : {}), ...(env !== undefined ? { env } : {}), ...(remove_webhook ? { webhook: null } : {}) };
|
|
179
|
+
if (!Object.keys(change).length && !test) throw new Error('pass what to change (rules, weekly, email, env, remove_webhook) or test: true; glitchless_alerts reads the settings');
|
|
180
|
+
const view = Object.keys(change).length ? await agent('POST', `/games/${pid}/alerts`, change) : await agent('GET', `/games/${pid}/alerts`);
|
|
181
|
+
if (!test) return reply(`Saved.\n${alertLines(view)}`, view);
|
|
182
|
+
const { sent } = await agent('POST', `/games/${pid}/alerts/test`);
|
|
183
|
+
// Read again, so the last sends include the test.
|
|
184
|
+
const after = await agent('GET', `/games/${pid}/alerts`);
|
|
185
|
+
return reply(`${Object.keys(change).length ? 'Saved, and sent' : 'Sent'} a test alert: ${sent.map((s) => `${s.channel} ${s.ok ? 'ok' : `failed (${s.error ?? '?'})`}`).join(', ')}.\n${alertLines(after)}`, { ...after, sent });
|
|
186
|
+
},
|
|
187
|
+
// It replaces settings, removes a webhook, and a test posts to Discord, Slack or email.
|
|
188
|
+
{ title: 'Change alerts', annotations: { destructiveHint: true, idempotentHint: false, openWorldHint: true } },
|
|
189
|
+
);
|
|
190
|
+
|
|
97
191
|
act(
|
|
98
192
|
'glitchless_revoke_share_link',
|
|
99
193
|
'Revoke a share link: it stops working at once, for everyone who has it.',
|