spritecook-mcp 0.2.0 → 0.2.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "spritecook-mcp",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "SpriteCook MCP Server - Connect your AI agent (Cursor, VS Code, Claude) to SpriteCook for pixel art and game asset generation.",
5
5
  "keywords": [
6
6
  "spritecook",
package/src/editors.mjs CHANGED
@@ -62,6 +62,18 @@ export function readExistingKey() {
62
62
  }
63
63
  } catch { /* ignore */ }
64
64
 
65
+ // Check Antigravity
66
+ try {
67
+ const antigravityPath = getAntigravityConfigPath();
68
+ if (antigravityPath && existsSync(antigravityPath)) {
69
+ const config = JSON.parse(readFileSync(antigravityPath, 'utf-8'));
70
+ const auth = config?.mcpServers?.spritecook?.headers?.Authorization;
71
+ if (auth && auth.startsWith('Bearer sc_live_')) {
72
+ return auth.replace('Bearer ', '');
73
+ }
74
+ }
75
+ } catch { /* ignore */ }
76
+
65
77
  return null;
66
78
  }
67
79
 
@@ -79,6 +91,17 @@ function isRunningInCursor() {
79
91
  return false;
80
92
  }
81
93
 
94
+ function isRunningInAntigravity() {
95
+ const env = process.env;
96
+ // Antigravity may set its own env vars or identify via TERM_PROGRAM
97
+ if (env.ANTIGRAVITY_CHANNEL) return true;
98
+ if (env.TERM_PROGRAM === 'antigravity') return true;
99
+ // Antigravity is a VS Code fork - check for antigravity-specific paths
100
+ const ipcHandle = env.VSCODE_GIT_IPC_HANDLE || env.VSCODE_IPC_HOOK_CLI || '';
101
+ if (ipcHandle.toLowerCase().includes('antigravity')) return true;
102
+ return false;
103
+ }
104
+
82
105
  function isRunningInVSCode() {
83
106
  const env = process.env;
84
107
  if (env.TERM_PROGRAM === 'vscode') return true;
@@ -142,6 +165,16 @@ export function detectEditors() {
142
165
  write: (apiKey) => writeClaudeCodeConfig(claudeCodeConfigPath, apiKey),
143
166
  });
144
167
 
168
+ // Antigravity (Google) - user-level mcp_config.json
169
+ const antigravityPath = getAntigravityConfigPath();
170
+ const antigravityDetected = isRunningInAntigravity() || (antigravityPath ? existsSync(join(antigravityPath, '..')) : false);
171
+ editors.push({
172
+ name: 'Antigravity',
173
+ detected: antigravityDetected,
174
+ configPath: antigravityPath,
175
+ write: (apiKey) => writeAntigravityConfig(antigravityPath, apiKey),
176
+ });
177
+
145
178
  return editors;
146
179
  }
147
180
 
@@ -252,6 +285,34 @@ function writeClaudeDesktopConfig(configPath, apiKey) {
252
285
  writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
253
286
  }
254
287
 
288
+ function writeAntigravityConfig(configPath, apiKey) {
289
+ if (!configPath) {
290
+ warn('Antigravity config path not found for this platform.');
291
+ return;
292
+ }
293
+ const mcpUrl = getMcpUrl();
294
+
295
+ let config = {};
296
+ if (existsSync(configPath)) {
297
+ try {
298
+ config = JSON.parse(readFileSync(configPath, 'utf-8'));
299
+ } catch {
300
+ // Start fresh
301
+ }
302
+ }
303
+
304
+ if (!config.mcpServers) config.mcpServers = {};
305
+ config.mcpServers.spritecook = {
306
+ url: mcpUrl,
307
+ headers: {
308
+ Authorization: `Bearer ${apiKey}`,
309
+ },
310
+ };
311
+
312
+ ensureDir(join(configPath, '..'));
313
+ writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf-8');
314
+ }
315
+
255
316
  function writeClaudeCodeConfig(configPath, apiKey) {
256
317
  const mcpUrl = getMcpUrl();
257
318
 
@@ -278,6 +339,24 @@ function writeClaudeCodeConfig(configPath, apiKey) {
278
339
 
279
340
  // ── Helpers ─────────────────────────────────────────────────────────────
280
341
 
342
+ function getAntigravityConfigPath() {
343
+ const platform = process.platform;
344
+ const home = homedir();
345
+
346
+ if (platform === 'darwin') {
347
+ return join(home, 'Library', 'Application Support', 'Google', 'Antigravity', 'mcp_config.json');
348
+ }
349
+ if (platform === 'win32') {
350
+ const appData = process.env.APPDATA || join(home, 'AppData', 'Roaming');
351
+ return join(appData, 'Google', 'Antigravity', 'mcp_config.json');
352
+ }
353
+ if (platform === 'linux') {
354
+ return join(home, '.config', 'Google', 'Antigravity', 'mcp_config.json');
355
+ }
356
+
357
+ return null;
358
+ }
359
+
281
360
  function getClaudeDesktopConfigPath() {
282
361
  const platform = process.platform;
283
362
  const home = homedir();
package/src/setup.mjs CHANGED
@@ -78,6 +78,7 @@ export async function run() {
78
78
  selected: e.detected,
79
79
  })),
80
80
  hint: 'Space to toggle, Enter to confirm',
81
+ instructions: false,
81
82
  });
82
83
 
83
84
  const selected = editors.filter((e) => response.editors?.includes(e.name));