glitchless-mcp 0.10.0 → 0.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -91,7 +91,7 @@ above go in its environment.
91
91
  | --- | --- |
92
92
  | `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 |
93
93
  | `glitchless_sign_in` | Connect to a Glitchless Cloud workspace: a link and a code for the person to approve |
94
- | `glitchless_create_game` | A new game in the workspace, with its client token and intake URL |
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
97
  | `glitchless_overview` | Headline numbers: sessions, players, crash-free sessions, frame time against the budget, rage quits |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "glitchless-mcp",
3
- "version": "0.10.0",
3
+ "version": "0.10.2",
4
4
  "mcpName": "io.github.glitchless-gg/glitchless",
5
5
  "description": "Game observability and analytics MCP server for Unity, Godot, Unreal, Three.js, Phaser and GameMaker games. Coding agents (Claude Code, Codex, Cursor and others) read your players' stutters, crashes, custom metrics and ranked findings, 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.10.0';
12
+ export const VERSION = '0.10.2';
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');
@@ -55,11 +55,17 @@ export function useCredentials({ url, token }) {
55
55
  export async function workspaceGames(fresh = false) {
56
56
  const c = conn();
57
57
  if (!fresh && c.games && Date.now() - c.games.at < 30_000) return c.games.list;
58
- const { games: list } = await agent('GET', '/games');
59
- c.games = { at: Date.now(), list };
58
+ const { games: list, intake } = await agent('GET', '/games');
59
+ c.games = { at: Date.now(), list, intake };
60
60
  return list;
61
61
  }
62
62
 
63
+ // The intake address games send to, as the last game list gave it.
64
+ export const workspaceIntake = () => conn().games?.intake ?? null;
65
+
66
+ // How to add Glitchless to a game, in any engine: the setup steps a coding agent follows (docs/agent-setup-prompt.md).
67
+ export const SETUP_URL = 'https://raw.githubusercontent.com/glitchless-gg/glitchless/main/docs/agent-setup-prompt.md';
68
+
63
69
  export async function projectFor(game) {
64
70
  const c = conn();
65
71
  const want = game || c.game;
@@ -70,7 +76,8 @@ export async function projectFor(game) {
70
76
  list = await workspaceGames(true);
71
77
  hit = find();
72
78
  }
73
- if (!hit) throw new Error(want ? `No game called "${want}" in this workspace. Games: ${list.map((g) => g.name).join(', ') || 'none yet'}.` : `Name the game this is about (game: "<name>"): ${list.map((g) => g.name).join(', ') || 'none yet; glitchless_create_game makes one'}.`);
79
+ if (!list.length) throw new Error(`This workspace has no games yet: glitchless_list_games says how to make one (or the demo game, with a week of sample play), and the setup steps for adding Glitchless to a game are at ${SETUP_URL}.`);
80
+ if (!hit) throw new Error(want ? `No game called "${want}" in this workspace. Games: ${list.map((g) => g.name).join(', ')}.` : `Name the game this is about (game: "<name>"): ${list.map((g) => g.name).join(', ')}.`);
74
81
  c.game = hit.id;
75
82
  return hit.id;
76
83
  }
@@ -137,7 +144,7 @@ export async function resolveService(service) {
137
144
  if (service) return service;
138
145
  if (defaultService()) return defaultService();
139
146
  const { services } = await query('services');
140
- if (!services?.length) throw new Error('No games are reporting to Glitchless yet. Add the SDK and play a level first.');
147
+ if (!services?.length) throw new Error(`No game has sent Glitchless any data yet. glitchless_list_games gives each game's client token and what to do next; the setup steps for adding the SDK are at ${SETUP_URL}. Data shows a few minutes after a level is played.`);
141
148
  return services.sort((a, b) => b.last_seen - a.last_seen)[0].service;
142
149
  }
143
150
 
@@ -240,7 +247,7 @@ function instructions(remote) {
240
247
  return [
241
248
  'Glitchless is observability for games made with Three.js, Phaser, Babylon.js, PlayCanvas, Unity, Godot, Unreal or GameMaker.',
242
249
  remote
243
- ? "You're connected to the person's Glitchless workspace: glitchless_list_games lists every game, glitchless_create_game makes one and hands back its client token, every tool takes game (by name), and glitchless_share_board makes a read-only link to a board."
250
+ ? "You're connected to the person's Glitchless workspace: glitchless_list_games lists every game (and says what to do when there is none, or a game has no data yet), glitchless_create_game makes one and hands back its client token (demo: true makes the demo game, Zoomies with a week of sample play, to try every tool on before a real game sends data), every tool takes game (by name), and glitchless_share_board makes a read-only link to a board."
244
251
  : "On Glitchless Cloud, glitchless_sign_in connects you to the person's whole workspace (they approve a code in the browser): then glitchless_list_games lists every game, glitchless_create_game makes one and hands back its client token, every tool takes game (by name), and glitchless_share_board makes a read-only link to a board.",
245
252
  'Start with glitchless_triage to get ranked, evidence-backed findings for a game, then drill in with glitchless_performance, glitchless_get_error, glitchless_death_hotspots or glitchless_session.',
246
253
  'When players or playtesters send bug reports from inside the game (an F8 form or a button), glitchless_bug_reports lists them with what they wrote, the level and where they stood, and opens one with its screenshot.',
package/src/tools/core.js CHANGED
@@ -1,12 +1,21 @@
1
1
  // The built-in reads: which games report, findings, headline numbers, frame time, errors, levels,
2
2
  // death hotspots and one session in detail.
3
3
  import { z } from 'zod';
4
- import { base, query, resolveService, range, reply, common, tool, slimIssue, slimGroup, filters, isWorkspace, workspaceGames } from '../context.js';
4
+ import { base, query, resolveService, range, reply, common, tool, slimIssue, slimGroup, filters, isWorkspace, workspaceGames, workspaceIntake, agent, SETUP_URL } from '../context.js';
5
5
 
6
6
  tool('glitchless_list_games', 'List the games: with a workspace key, every game in the workspace (its id, name, client token and the services reporting to it); with a key for one game, its services, versions, environments and when they were last seen.', {}, async () => {
7
7
  if (isWorkspace()) {
8
8
  const list = await workspaceGames(true);
9
- return reply(`${list.length} game(s) in this workspace. Name one with game in any tool:`, list);
9
+ if (!list.length) {
10
+ // Someone who connected an app before making a game: say what to do, and what this connection may do about it.
11
+ const who = await agent('GET', '/whoami').catch(() => null);
12
+ const make = who?.scopes?.includes('manage')
13
+ ? 'Make one with glitchless_create_game (name: the game\'s name), or try every tool first on the demo game: glitchless_create_game with demo: true adds Zoomies with a week of sample play.'
14
+ : `Make one in Glitchless (${who?.dashboard ?? 'the dashboard'}): this connection may only read, so it can't create games. To let it, connect again and tick "Create games and share links".`;
15
+ return reply(`No games in this workspace yet. ${make} Then add Glitchless to the game with its client token: the setup steps are at ${SETUP_URL}.`, []);
16
+ }
17
+ const intake = workspaceIntake();
18
+ return reply(`${list.length} game(s) in this workspace. Name one with game in any tool:`, list.map((g) => (g.services?.length ? g : { ...g, next_step: nextStep(g, intake) })));
10
19
  }
11
20
  const { services } = await query('services');
12
21
  return reply(`${services.length} game(s) reporting to ${base()}`, services.map((s) => ({ ...s, last_seen: new Date(s.last_seen).toISOString() })));
@@ -119,3 +128,10 @@ tool(
119
128
  return reply(`Session ${session_id}`, { session: d.session, timeline: timeline.slice(0, 150), frames: d.frames.map(({ ctx, ...f }) => ({ ...f, ...ctx })).slice(0, 120), ...(ticks.length ? { server_windows: ticks.slice(0, 120) } : {}) });
120
129
  },
121
130
  );
131
+
132
+ // What to do about a game that hasn't sent anything yet: the demo game's sample play is on its way; any other game needs
133
+ // the SDK, which its coding agent adds from the setup steps with the game's client token.
134
+ function nextStep(game, intake) {
135
+ if (game.demo) return 'This is the demo game: its sample play can be read a few minutes after it was made. Ask again shortly.';
136
+ return `No data yet. To add Glitchless to ${game.name}, give the game's coding agent (Claude Code, Cursor, Codex and others) the setup steps at ${SETUP_URL} with client_token ${game.client_token}${intake ? ` and intake ${intake}` : ''}, then play a level: data shows a few minutes later.`;
137
+ }
@@ -48,12 +48,17 @@ act(
48
48
 
49
49
  act(
50
50
  'glitchless_create_game',
51
- "Create a game in the signed-in workspace. Returns its client token (gl_pub_…, the public key game builds send with) and the intake URL to put in the game's Glitchless.init; the instrument skill says where for each engine. Later calls can name it with game.",
52
- { name: z.string().describe("The game's name, as players know it") },
53
- async ({ name }) => {
54
- const made = await agent('POST', '/games', { name });
51
+ "Create a game in the signed-in workspace. Returns its client token (gl_pub_…, the public key game builds send with) and the intake URL to put in the game's Glitchless.init; the instrument skill says where for each engine. Later calls can name it with game. With demo: true it makes the demo game instead: Zoomies with a week of sample play (findings, levels, errors, sessions and a dashboard), for trying every tool before a real game sends data. A workspace has one demo game, and it takes no room from the plan's games.",
52
+ {
53
+ name: z.string().optional().describe("The game's name, as players know it (not needed with demo)"),
54
+ demo: z.boolean().optional().describe('Make the demo game, with a week of sample play'),
55
+ },
56
+ async ({ name, demo }) => {
57
+ if (!demo && !name) throw new Error("give the game's name, or demo: true for the demo game");
58
+ const made = await agent('POST', '/games', demo ? { demo: true } : { name });
55
59
  await workspaceGames(true);
56
60
  await projectFor(made.game.id);
61
+ if (demo) return reply(`Made the demo game, ${made.game.name}: a week of sample play from Zoomies, readable a few minutes from now. Then try glitchless_triage on it.`, made);
57
62
  return reply(`Created ${made.game.name}. Initialise Glitchless with this client token and intake:`, made);
58
63
  },
59
64
  );