@mosvera/mcp 0.1.4 → 0.1.5

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
@@ -18,7 +18,7 @@ deterministic provider payloads that other tools can consume.
18
18
 
19
19
  The easiest path for non-command-line users is the Mosvera MCP Bundle:
20
20
 
21
- 1. Download `mosvera-mcp-0.1.4.mcpb` from the latest
21
+ 1. Download `mosvera-mcp-0.1.5.mcpb` from the latest
22
22
  [GitHub release](https://github.com/mosvera/mcp/releases).
23
23
  2. Double-click the file, drag it into Claude Desktop, or install it from
24
24
  Claude Desktop Settings → Extensions → Advanced settings → Install
@@ -176,7 +176,7 @@ npm run mcpb:inspect
176
176
  The MCPB pack step creates:
177
177
 
178
178
  ```text
179
- build/mosvera/mosvera-mcp-0.1.4.mcpb
179
+ build/mosvera/mosvera-mcp-0.1.5.mcpb
180
180
  ```
181
181
 
182
182
  ## Package Boundaries
package/dist/context.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { type LoadedProject, type RegistryDiagnostic, type Validator } from "@mosvera/runtime";
2
2
  import type { ToolContext } from "./types.ts";
3
- export declare const SERVER_VERSION = "0.1.4";
3
+ export declare const SERVER_VERSION = "0.1.5";
4
4
  export interface CliOptions {
5
5
  registryDir?: string;
6
6
  readOnlyMode: boolean;
package/dist/context.js CHANGED
@@ -12,7 +12,7 @@ import { loadProject, RegistryProjectError } from "@mosvera/runtime/node";
12
12
  import { fluxAdapter } from "@mosvera/provider-flux";
13
13
  import { openaiAdapter } from "@mosvera/provider-openai";
14
14
  import { sdxlAdapter } from "@mosvera/provider-sdxl";
15
- export const SERVER_VERSION = "0.1.4";
15
+ export const SERVER_VERSION = "0.1.5";
16
16
  function flagValue(argv, name) {
17
17
  const direct = argv.find((arg) => arg.startsWith(`${name}=`));
18
18
  if (direct !== undefined)
@@ -24,14 +24,23 @@ function flagValue(argv, name) {
24
24
  }
25
25
  function booleanFlag(argv, name) {
26
26
  const direct = argv.find((arg) => arg.startsWith(`${name}=`));
27
- if (direct !== undefined)
28
- return !["", "0", "false", "no"].includes(direct.slice(name.length + 1).toLowerCase());
27
+ if (direct !== undefined) {
28
+ const value = direct.slice(name.length + 1).toLowerCase();
29
+ if (value.includes("${"))
30
+ return false;
31
+ return !["", "0", "false", "no"].includes(value);
32
+ }
29
33
  return argv.includes(name);
30
34
  }
35
+ function configValue(value) {
36
+ if (value === undefined || value.length === 0 || value.includes("${"))
37
+ return undefined;
38
+ return value;
39
+ }
31
40
  export function parseCliOptions(argv) {
32
- const registryArg = flagValue(argv, "--registry");
33
- const envRegistry = process.env.MOSVERA_REGISTRY_DIR;
34
- const envReadOnly = process.env.MOSVERA_MCP_READ_ONLY ?? process.env.MOSVERA_READ_ONLY;
41
+ const registryArg = configValue(flagValue(argv, "--registry"));
42
+ const envRegistry = configValue(process.env.MOSVERA_REGISTRY_DIR);
43
+ const envReadOnly = configValue(process.env.MOSVERA_MCP_READ_ONLY ?? process.env.MOSVERA_READ_ONLY);
35
44
  const parsed = {
36
45
  readOnlyMode: booleanFlag(argv, "--read-only") ||
37
46
  booleanFlag(argv, "--readonly") ||
@@ -157,6 +157,14 @@ function writeDisabled(ctx) {
157
157
  function toolFail(failure) {
158
158
  return fail(failure.error, failure.message, failure.detail);
159
159
  }
160
+ function topCssVariables(cssVariables, limit = 40) {
161
+ const entries = Object.entries(cssVariables).sort(([a], [b]) => a.localeCompare(b));
162
+ if (entries.length === 0)
163
+ return "No CSS variables were produced.";
164
+ const visible = entries.slice(0, limit).map(([key, value]) => `${key}: ${value};`);
165
+ const remaining = entries.length - visible.length;
166
+ return `${visible.join("\n")}${remaining > 0 ? `\n...and ${remaining} more CSS variable${remaining === 1 ? "" : "s"}.` : ""}`;
167
+ }
160
168
  export function runServerStatus(ctx) {
161
169
  const diagnostics = [...ctx.loadDiagnostics, ...registryDiagnostics(ctx.project, ctx.validator)];
162
170
  const registry = ctx.project.registry;
@@ -167,7 +175,15 @@ export function runServerStatus(ctx) {
167
175
  compositions: Object.keys(registry.compositions ?? {}).length,
168
176
  manifests: Object.keys(ctx.project.manifests).length,
169
177
  };
170
- return ok("Mosvera MCP server is ready.", {
178
+ const message = [
179
+ "Mosvera MCP server is ready.",
180
+ `Registry: ${ctx.registryDir}`,
181
+ `Writable: ${ctx.registryWritable ? "yes" : "no"}`,
182
+ `Read-only mode: ${ctx.readOnlyMode ? "yes" : "no"}`,
183
+ `Write tools enabled: ${ctx.registryWritable && !ctx.readOnlyMode ? "yes" : "no"}`,
184
+ `Loaded: ${counts.compositions} aesthetics, ${counts.templates} templates, ${counts.modifiers} modifiers, ${counts.palettes} palettes, ${counts.manifests} manifests.`,
185
+ ].join("\n");
186
+ return ok(message, {
171
187
  registry_path: ctx.registryDir,
172
188
  registry_writable: ctx.registryWritable,
173
189
  read_only_mode: ctx.readOnlyMode,
@@ -287,7 +303,14 @@ export function runCompileDesignTokens(ctx, args) {
287
303
  cssOptions.prefix = args.css_prefix;
288
304
  const tokens = compileDesignTokens(resolved.canonical, tokenOptions);
289
305
  const css_variables = toCssVariables(tokens, cssOptions);
290
- return ok("Compiled portable design tokens.", { source: resolved.source, canonical: resolved.canonical, tokens, css_variables });
306
+ const sections = Object.keys(tokens).sort();
307
+ const message = [
308
+ "Compiled portable design tokens.",
309
+ `Token sections: ${sections.length > 0 ? sections.join(", ") : "none"}.`,
310
+ "CSS variables:",
311
+ topCssVariables(css_variables),
312
+ ].join("\n");
313
+ return ok(message, { source: resolved.source, canonical: resolved.canonical, tokens, css_variables });
291
314
  }
292
315
  export function runCompileProviderPayload(ctx, args) {
293
316
  const input = { aesthetic: args.aesthetic };
@@ -2,7 +2,7 @@
2
2
  "manifest_version": "0.3",
3
3
  "name": "mosvera-mcp",
4
4
  "display_name": "Mosvera",
5
- "version": "0.1.4",
5
+ "version": "0.1.5",
6
6
  "description": "Resolve, compile, and save local Mosvera aesthetics from Claude Desktop.",
7
7
  "long_description": "Mosvera runs locally against your own aesthetic registry. It lets Claude list named aesthetics, resolve them to canonical Mosvera models, compile portable design tokens and CSS variables, and save registry documents without sending provider requests or storing secrets.",
8
8
  "author": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mosvera/mcp",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "description": "Run Mosvera as local MCP tools for agents, editors, and Claude Desktop.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",
@@ -41,8 +41,8 @@
41
41
  "ci": "npm run build && npm run typecheck && npm test",
42
42
  "clean": "rm -rf dist",
43
43
  "mcpb:stage": "npm run build && node scripts/stage-mcpb.mjs",
44
- "mcpb:pack": "npm run mcpb:stage && mcpb pack build/mcpb/mosvera build/mosvera/mosvera-mcp-0.1.4.mcpb",
45
- "mcpb:inspect": "node scripts/inspect-mcpb.mjs build/mosvera/mosvera-mcp-0.1.4.mcpb",
44
+ "mcpb:pack": "npm run mcpb:stage && mcpb pack build/mcpb/mosvera build/mosvera/mosvera-mcp-0.1.5.mcpb",
45
+ "mcpb:inspect": "node scripts/inspect-mcpb.mjs build/mosvera/mosvera-mcp-0.1.5.mcpb",
46
46
  "prepublishOnly": "npm run build && npm run typecheck && npm test",
47
47
  "start": "tsx src/server.ts",
48
48
  "test": "vitest run",