@pixel-normal-edit/mcp 2.0.5 → 2.0.6

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 (2) hide show
  1. package/package.json +1 -1
  2. package/tools/workspace.js +14 -4
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pixel-normal-edit/mcp",
3
- "version": "2.0.5",
3
+ "version": "2.0.6",
4
4
  "description": "MCP server for Pixel Normal Edit canvas - enables AI agents to draw pixel art",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -19,14 +19,24 @@ function register(server) {
19
19
  {},
20
20
  () => ({ action: 'getActiveTabId' }));
21
21
 
22
- registerTool(server, 'workspace_create_tab',
22
+ const { sendCommand } = require('../core/server');
23
+ server.tool('workspace_create_tab',
23
24
  'Create a new blank canvas tab',
24
25
  {
25
26
  name: z.string().optional().describe('Tab name'),
26
- width: z.number().int().default(32).describe('Canvas width'),
27
- height: z.number().int().default(32).describe('Canvas height')
27
+ width: z.number().int().optional().describe('Canvas width'),
28
+ height: z.number().int().optional().describe('Canvas height')
28
29
  },
29
- (p) => ({ action: 'createTab', ...p }));
30
+ async (p) => {
31
+ if (p.width === undefined || p.height === undefined) {
32
+ return {
33
+ isError: true,
34
+ content: [{ type: 'text', text: 'Please provide the width and height dimensions (resize) when creating a new canvas.' }]
35
+ };
36
+ }
37
+ return sendCommand({ action: 'createTab', ...p });
38
+ }
39
+ );
30
40
 
31
41
  registerTool(server, 'workspace_switch_tab',
32
42
  'Switch to a different tab by ID (get IDs from workspace_list_tabs)',