@bestimmaa/posprint-mcp 0.1.0 → 0.1.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/README.md CHANGED
@@ -12,7 +12,7 @@ The tool is intentionally named `print` so clients can map natural user phrasing
12
12
  ## Run With npx
13
13
 
14
14
  ```bash
15
- npx @bestimmaa/posprint-mcp
15
+ npx --package=@bestimmaa/posprint-mcp posprint-mcp
16
16
  ```
17
17
 
18
18
  ## Install
@@ -44,7 +44,7 @@ For one-off use without installation, configure the command through `npx`.
44
44
  "mcpServers": {
45
45
  "posprint": {
46
46
  "command": "npx",
47
- "args": ["--yes", "@bestimmaa/posprint-mcp"]
47
+ "args": ["--yes", "--package=@bestimmaa/posprint-mcp", "posprint-mcp"]
48
48
  }
49
49
  }
50
50
  }
@@ -66,6 +66,14 @@ export async function handlePrintReceipt(input) {
66
66
  issues: error.issues
67
67
  });
68
68
  }
69
+ if (error instanceof Error &&
70
+ ("INVALID_URI" === error.code ||
71
+ "UNSUPPORTED_SCHEME" === error.code ||
72
+ "UNSUPPORTED_PATH" === error.code)) {
73
+ throw new AppError("VALIDATION_ERROR", error.message, {
74
+ printerUri: error.code
75
+ });
76
+ }
69
77
  const mapped = mapUnknownError(error);
70
78
  if (mapped.code === "UNKNOWN_ERROR") {
71
79
  throw new AppError("PRINTER_ERROR", "Printer job failed", {
@@ -1,7 +1,7 @@
1
1
  import { z } from "zod";
2
2
  const printReceiptSchema = z
3
3
  .object({
4
- printerUri: z.string().trim().url("printerUri must be a valid URI"),
4
+ printerUri: z.string().trim().min(1, "printerUri cannot be empty"),
5
5
  markdown: z.string().min(1, "markdown cannot be empty"),
6
6
  mode: z.enum(["preview", "confirm"]),
7
7
  confirmationToken: z.string().min(1, "confirmationToken cannot be empty").optional(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bestimmaa/posprint-mcp",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "MCP server for printing markdown receipts on POS printers.",
5
5
  "license": "MIT",
6
6
  "type": "module",