spritecook-mcp 0.2.13 → 0.2.17

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.
Files changed (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +12 -2
  3. package/package.json +2 -2
  4. package/src/skill.mjs +131 -115
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 SpriteCook
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -13,7 +13,9 @@ This will:
13
13
  1. **Authenticate** your SpriteCook account (browser-based or manual API key)
14
14
  2. **Detect** your editors (Cursor, VS Code, Claude Desktop, Claude Code)
15
15
  3. **Configure** MCP connections automatically
16
- 4. **Install** an optional agent skill for smarter AI integration
16
+ 4. **Install** an optional agent skill for smarter AI integration
17
+
18
+ The optional skills include current guidance for model discovery, GPT-Image-2 quality settings, guided character workflows, saved presets, multi-image style guide references, importing local image bytes with `import_asset(...)`, cleaning up backgrounds with `remove_background(...)`, renaming assets with `update_asset_label(...)`, recovering lost asset IDs with `list_recent_assets(...)`, using the primary asset URL instead of lower-level variant fields, and exporting SpriteCook character animations into Godot-ready scenes.
17
19
 
18
20
  ## What You Get
19
21
 
@@ -23,7 +25,15 @@ After setup, your AI agent can generate pixel art and game assets directly:
23
25
 
24
26
  > "Create a character sprite sheet for my platformer game"
25
27
 
26
- > "Make a set of potion icons with transparent backgrounds"
28
+ > "Make a set of potion icons with transparent backgrounds"
29
+
30
+ > "Use my character preset for a new idle sprite"
31
+
32
+ > "Import this local boss PNG, then animate it with a slow idle motion"
33
+
34
+ > "Remove the background from this character asset and give me the transparent PNG"
35
+
36
+ > "Rename the generated sword asset to Iron Sword Pickup"
27
37
 
28
38
  ## Manual Configuration
29
39
 
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "spritecook-mcp",
3
- "version": "0.2.13",
3
+ "version": "0.2.17",
4
4
  "mcpName": "ai.spritecook/generate",
5
- "description": "SpriteCook MCP Server - Connect your AI agent (Cursor, VS Code, Claude) to SpriteCook for pixel art and game asset generation.",
5
+ "description": "SpriteCook MCP Server - Connect your AI agent to SpriteCook for game asset generation, saved presets, import, background cleanup, asset organization, inspection, and animation.",
6
6
  "keywords": [
7
7
  "spritecook",
8
8
  "mcp",
package/src/skill.mjs CHANGED
@@ -1,124 +1,140 @@
1
- import { execSync } from 'node:child_process';
2
- import { platform } from 'node:os';
3
- import { mkdirSync, writeFileSync } from 'node:fs';
4
- import { basename, dirname, join } from 'node:path';
5
- import prompts from 'prompts';
6
- import { success, info, warn } from './ui.mjs';
7
-
8
- const SKILLS = [
9
- {
10
- name: 'spritecook-workflow-essentials',
11
- rawUrl: 'https://raw.githubusercontent.com/SpriteCook/skills/main/skills/spritecook-workflow-essentials/SKILL.md',
12
- },
1
+ import { execSync } from 'node:child_process';
2
+ import { platform } from 'node:os';
3
+ import { mkdirSync, writeFileSync } from 'node:fs';
4
+ import { basename, dirname, join } from 'node:path';
5
+ import prompts from 'prompts';
6
+ import { success, info, warn } from './ui.mjs';
7
+
8
+ const SKILLS = [
9
+ {
10
+ name: 'spritecook-workflow-essentials',
11
+ rawUrl: 'https://raw.githubusercontent.com/SpriteCook/skills/main/skills/spritecook-workflow-essentials/SKILL.md',
12
+ },
13
13
  {
14
14
  name: 'spritecook-generate-sprites',
15
15
  rawUrl: 'https://raw.githubusercontent.com/SpriteCook/skills/main/skills/spritecook-generate-sprites/SKILL.md',
16
16
  },
17
+ {
18
+ name: 'spritecook-generate-tilesets',
19
+ rawUrl: 'https://raw.githubusercontent.com/SpriteCook/skills/main/skills/spritecook-generate-tilesets/SKILL.md',
20
+ },
17
21
  {
18
22
  name: 'spritecook-animate-assets',
19
23
  rawUrl: 'https://raw.githubusercontent.com/SpriteCook/skills/main/skills/spritecook-animate-assets/SKILL.md',
20
24
  },
25
+ {
26
+ name: 'spritecook-use-presets',
27
+ rawUrl: 'https://raw.githubusercontent.com/SpriteCook/skills/main/skills/spritecook-use-presets/SKILL.md',
28
+ },
29
+ {
30
+ name: 'spritecook-use-assets-in-godot',
31
+ rawUrl: 'https://raw.githubusercontent.com/SpriteCook/skills/main/skills/spritecook-use-assets-in-godot/SKILL.md',
32
+ },
33
+ {
34
+ name: 'spritecook-use-dual-grid-tilesets',
35
+ rawUrl: 'https://raw.githubusercontent.com/SpriteCook/skills/main/skills/spritecook-use-dual-grid-tilesets/SKILL.md',
36
+ },
21
37
  ];
22
-
23
- /**
24
- * Download SKILL.md directly from GitHub and write it into each
25
- * selected editor's skill directory. Used as a fallback when
26
- * `npx skills add` fails (e.g. git not installed).
27
- *
28
- * @param {Array<{skillDirs:{project:string|null,global:string|null}, _chosenScope?:string}>} editors
29
- */
30
- async function fallbackInstall(editors) {
31
- info('Trying direct download fallback...');
32
-
33
- const skillBodies = [];
34
- try {
35
- for (const skill of SKILLS) {
36
- const res = await fetch(skill.rawUrl);
37
- if (!res.ok) throw new Error(`${skill.name}: HTTP ${res.status}`);
38
- skillBodies.push({
39
- name: skill.name,
40
- body: await res.text(),
41
- });
42
- }
43
- } catch (e) {
44
- warn(`Could not download skill files: ${e.message}`);
45
- return false;
46
- }
47
-
48
- let wrote = 0;
49
- for (const editor of editors) {
50
- const dirs = editor.skillDirs;
51
- if (!dirs) continue;
52
-
53
- const scope = editor._chosenScope || 'project';
54
- const dir = dirs[scope] || dirs.project || dirs.global;
55
- if (!dir) continue;
56
-
57
- const skillsRoot = basename(dir) === 'spritecook' ? dirname(dir) : dir;
58
-
59
- try {
60
- for (const skill of skillBodies) {
61
- const skillDir = join(skillsRoot, skill.name);
62
- mkdirSync(skillDir, { recursive: true });
63
- writeFileSync(join(skillDir, 'SKILL.md'), skill.body, 'utf-8');
64
- wrote++;
65
- }
66
- } catch {
67
- // best-effort, skip on failure
68
- }
69
- }
70
-
71
- if (wrote > 0) {
72
- success(`Agent skills installed via direct download (${wrote} files written).`);
73
- return true;
74
- }
75
- return false;
76
- }
77
-
78
- /**
79
- * Install or update the SpriteCook agent skill.
80
- *
81
- * Primary: `npx skills add SpriteCook/skills --skill '*'` (requires git).
82
- * Fallback: download SKILL.md directly from GitHub and place it
83
- * in each selected editor's skill directory.
84
- *
85
- * @param {Array} [selectedEditors] - editors the user chose in step 3
86
- */
87
- export async function maybeInstallSkill(selectedEditors = []) {
88
- info('The agent skill teaches your AI how to generate sprites autonomously.');
89
- const response = await prompts({
90
- type: 'confirm',
91
- name: 'install',
92
- message: 'Install SpriteCook agent skill? (highly recommended)',
93
- initial: true,
94
- });
95
-
96
- if (!response.install) {
97
- return;
98
- }
99
-
100
- info('Installing skills via npx skills add SpriteCook/skills --skill "*" ...');
101
-
102
- try {
103
- const npxCmd = platform() === 'win32' ? 'npx.cmd' : 'npx';
104
- execSync(`${npxCmd} -y skills add SpriteCook/skills --skill "*"`, {
105
- stdio: 'inherit',
106
- timeout: 60_000,
107
- });
108
- success('Agent skills installed.');
109
- return;
110
- } catch {
111
- // Primary method failed -- try fallback
112
- }
113
-
114
- // ── Fallback: direct download ────────────────────────────────────
115
- if (selectedEditors.length > 0) {
116
- const ok = await fallbackInstall(selectedEditors);
117
- if (ok) return;
118
- }
119
-
120
- warn('Skill install failed (git may not be installed).');
121
- console.log(' You can install it manually later:');
122
- console.log(' npx skills add SpriteCook/skills --skill "*"');
123
- console.log(' Or install git and re-run this setup.');
124
- }
38
+
39
+ /**
40
+ * Download SKILL.md directly from GitHub and write it into each
41
+ * selected editor's skill directory. Used as a fallback when
42
+ * `npx skills add` fails (e.g. git not installed).
43
+ *
44
+ * @param {Array<{skillDirs:{project:string|null,global:string|null}, _chosenScope?:string}>} editors
45
+ */
46
+ async function fallbackInstall(editors) {
47
+ info('Trying direct download fallback...');
48
+
49
+ const skillBodies = [];
50
+ try {
51
+ for (const skill of SKILLS) {
52
+ const res = await fetch(skill.rawUrl);
53
+ if (!res.ok) throw new Error(`${skill.name}: HTTP ${res.status}`);
54
+ skillBodies.push({
55
+ name: skill.name,
56
+ body: await res.text(),
57
+ });
58
+ }
59
+ } catch (e) {
60
+ warn(`Could not download skill files: ${e.message}`);
61
+ return false;
62
+ }
63
+
64
+ let wrote = 0;
65
+ for (const editor of editors) {
66
+ const dirs = editor.skillDirs;
67
+ if (!dirs) continue;
68
+
69
+ const scope = editor._chosenScope || 'project';
70
+ const dir = dirs[scope] || dirs.project || dirs.global;
71
+ if (!dir) continue;
72
+
73
+ const skillsRoot = basename(dir) === 'spritecook' ? dirname(dir) : dir;
74
+
75
+ try {
76
+ for (const skill of skillBodies) {
77
+ const skillDir = join(skillsRoot, skill.name);
78
+ mkdirSync(skillDir, { recursive: true });
79
+ writeFileSync(join(skillDir, 'SKILL.md'), skill.body, 'utf-8');
80
+ wrote++;
81
+ }
82
+ } catch {
83
+ // best-effort, skip on failure
84
+ }
85
+ }
86
+
87
+ if (wrote > 0) {
88
+ success(`Agent skills installed via direct download (${wrote} files written).`);
89
+ return true;
90
+ }
91
+ return false;
92
+ }
93
+
94
+ /**
95
+ * Install or update the SpriteCook agent skill.
96
+ *
97
+ * Primary: `npx skills add SpriteCook/skills --skill '*'` (requires git).
98
+ * Fallback: download SKILL.md directly from GitHub and place it
99
+ * in each selected editor's skill directory.
100
+ *
101
+ * @param {Array} [selectedEditors] - editors the user chose in step 3
102
+ */
103
+ export async function maybeInstallSkill(selectedEditors = []) {
104
+ info('The agent skill teaches your AI how to generate sprites autonomously.');
105
+ const response = await prompts({
106
+ type: 'confirm',
107
+ name: 'install',
108
+ message: 'Install SpriteCook agent skill? (highly recommended)',
109
+ initial: true,
110
+ });
111
+
112
+ if (!response.install) {
113
+ return;
114
+ }
115
+
116
+ info('Installing skills via npx skills add SpriteCook/skills --skill "*" ...');
117
+
118
+ try {
119
+ const npxCmd = platform() === 'win32' ? 'npx.cmd' : 'npx';
120
+ execSync(`${npxCmd} -y skills add SpriteCook/skills --skill "*"`, {
121
+ stdio: 'inherit',
122
+ timeout: 60_000,
123
+ });
124
+ success('Agent skills installed.');
125
+ return;
126
+ } catch {
127
+ // Primary method failed -- try fallback
128
+ }
129
+
130
+ // ── Fallback: direct download ────────────────────────────────────
131
+ if (selectedEditors.length > 0) {
132
+ const ok = await fallbackInstall(selectedEditors);
133
+ if (ok) return;
134
+ }
135
+
136
+ warn('Skill install failed (git may not be installed).');
137
+ console.log(' You can install it manually later:');
138
+ console.log(' npx skills add SpriteCook/skills --skill "*"');
139
+ console.log(' Or install git and re-run this setup.');
140
+ }