@zerolingua/mcp 0.3.0 → 0.3.2

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
@@ -26,7 +26,7 @@ The server needs **Node.js 20** or later, as the MCP SDK v2 it runs on does.
26
26
  -e ZL_SITE_URL=https://example.com \
27
27
  -e ZL_USER=youruser \
28
28
  -e "ZL_APP_PASSWORD=xxxx xxxx xxxx xxxx" \
29
- -- npx -y @zerolingua/mcp
29
+ -- npx -y @zerolingua/mcp@latest
30
30
  ```
31
31
 
32
32
  Claude Desktop (`claude_desktop_config.json`):
@@ -36,7 +36,7 @@ The server needs **Node.js 20** or later, as the MCP SDK v2 it runs on does.
36
36
  "mcpServers": {
37
37
  "zero-lingua": {
38
38
  "command": "npx",
39
- "args": ["-y", "@zerolingua/mcp"],
39
+ "args": ["-y", "@zerolingua/mcp@latest"],
40
40
  "env": {
41
41
  "ZL_SITE_URL": "https://example.com",
42
42
  "ZL_USER": "youruser",
@@ -47,6 +47,9 @@ The server needs **Node.js 20** or later, as the MCP SDK v2 it runs on does.
47
47
  }
48
48
  ```
49
49
 
50
+ `@latest` makes npx check npm each time the host starts the server, so a new version arrives with the next restart;
51
+ without it npx may keep running the copy it already cached.
52
+
50
53
  ## Tools
51
54
 
52
55
  | tool | what it does |
package/index.js CHANGED
@@ -37,7 +37,7 @@ if ( missing.length ) {
37
37
  * the opening exchange and pins one instance to it.
38
38
  */
39
39
  function buildServer() {
40
- const server = new McpServer( { name: 'zero-lingua', version: '0.3.0' } );
40
+ const server = new McpServer( { name: 'zero-lingua', version: '0.3.2' } );
41
41
  for ( const tool of TOOLS ) {
42
42
  server.registerTool(
43
43
  tool.name,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerolingua/mcp",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "description": "MCP server for Zerø Lingua — lets AI agents read a site's strings, write translations, and approve pending work through the plugin's licensed REST surface. Speaks MCP 2026-07-28 and the 2025 era.",
5
5
  "type": "module",
6
6
  "scripts": {
package/tools.js CHANGED
@@ -50,7 +50,7 @@ const SELECTOR = z
50
50
  .int()
51
51
  .min( 1 )
52
52
  .optional()
53
- .describe( 'one post id: that post, the components it uses and the JSON loops it renders' ),
53
+ .describe( 'one post id: that post, the components it uses, the JSON loops it renders and the posts its query loops show that owe work (its rows\' `loops`) — each a unit of its own' ),
54
54
  site_identity: z.literal( true ).optional().describe( 'the site name and tagline' ),
55
55
  } )
56
56
  .optional()
@@ -118,7 +118,9 @@ export const TOOLS = [
118
118
  'counts by status (`translated`, `needs_review` = translated but not signed off, `partial`, ' +
119
119
  '`untranslated`). Each language also carries `words`: the same items counted in the panel\'s ' +
120
120
  'vocabulary — `translated`, `needs_review`, `in_progress`, `not_translated` — which are the words a ' +
121
- "selector's `status` takes in translate_set and approve_set. Serving is approved-only, so " +
121
+ "selector's `status` takes in translate_set and approve_set. An item with nothing to translate in a " +
122
+ 'language (only locked texts, figures with a unit or machine values, or a language it does not exist ' +
123
+ 'in) is counted in `items.none` and in no word. Serving is approved-only, so ' +
122
124
  '`needs_review` work is NOT live yet. The scan is bounded: when `scanned.complete` is false, drill ' +
123
125
  "into list_items per type for the rest. Use this to answer “what's left to do, where?”.",
124
126
  method: 'GET',
@@ -135,8 +137,13 @@ export const TOOLS = [
135
137
  'Paginate with offset/limit; `search` filters by text. Each item carries `id` and `kind` — pass ' +
136
138
  'those to item_strings, or as a selector\'s `targets`. The same `type` words are a selector\'s ' +
137
139
  '`scope.type`; for `strings` the answer also lists the pool\'s `kinds`, for `terms` its ' +
138
- '`taxonomies` — the values a selector\'s `kinds` / `taxonomies` filters take. Listing is for ' +
139
- 'reading: to act on a whole type, give translate_set / approve_set a `scope` instead of paging.',
140
+ '`taxonomies` — the values a selector\'s `kinds` / `taxonomies` filters take. A post\'s `status` ' +
141
+ 'is its STATE: its own text and the posts its query loops show, each of those one unit — a page whose ' +
142
+ 'own text is done reads `in_progress` while a card it shows owes work. Its rows in `langs` carry ' +
143
+ '`loops`, the ids of those cards that owe work in that language (each an item of its own, kind ' +
144
+ '`post`), and `loopsDrafts`, those whose only debt is drafts — approve clears them, translate sends ' +
145
+ 'only their untranslated figures with a unit (in no count); the counts stay the post\'s own text. Listing is for reading: to act on a whole type, give ' +
146
+ 'translate_set / approve_set a `scope` instead of paging.',
140
147
  method: 'GET',
141
148
  route: 'list-items',
142
149
  input: z.object( {
@@ -202,7 +209,9 @@ export const TOOLS = [
202
209
  description:
203
210
  "The review gate's sign-off for ONE post in ONE language — the right tool for «approve this " +
204
211
  'page»: its draft translations start serving publicly (once the language is live — see ' +
205
- 'site_status). Requires publish rights on that post. The answer carries `approved` (rows signed ' +
212
+ 'site_status). Requires publish rights on that post. It approves the post\'s own drafts; to approve ' +
213
+ 'the drafts of the posts its loops show too (its rows\' `loops`), use approve_set with ' +
214
+ '`scope.document`. The answer carries `approved` (rows signed ' +
206
215
  'off), `items[]` (the repainted rows) and `refused[]`: what was NOT approved, by identity — ' +
207
216
  '`{id, kind: "string", lang, reason, message, in}` with `reason` `approve_tier` (a site-wide or ' +
208
217
  'shared string beyond your rights: a human with broader rights finishes it in the panel) or ' +
@@ -253,9 +262,12 @@ export const TOOLS = [
253
262
  'You describe the set in `selector`; the SERVER resolves it, splits it and checks your rights per ' +
254
263
  'unit, so never list or split the items yourself. ' +
255
264
  '(1) Call with `dry_run: true` FIRST and tell the user the number: `strings` (string × language ' +
256
- 'cells that would be paid for), `source_chars`, `budget` (`fits` | `exceeds` | `uncapped` against ' +
265
+ 'cells that would be paid for), `figures` (how many of them are figures with a unit, «126 Stk.»: sent, ' +
266
+ 'and shown as work by no count), `source_chars`, `budget` (`fits` | `exceeds` | `uncapped` against ' +
257
267
  'what is left of the month), `mode`, and `complete` (false = the numbers are «at least»). Nothing ' +
258
- 'is written. ' +
268
+ 'is written. A `scope.document` also translates the posts its loops show that owe work, each under ' +
269
+ 'its own rights, so its estimate counts them: say it before spending. A `scope.type` holds only ' +
270
+ 'that type\'s posts. ' +
259
271
  '(2) Call again with the SAME selector and no `dry_run`. Read `mode` from the answer, never assume ' +
260
272
  'it — the server decides it. `mode: "request"` (a `scope.document` or at most 50 `targets`; ' +
261
273
  'under `force`, any set but a whole `scope.type`): translated in this request, a chunk at a time — ' +
@@ -267,14 +279,16 @@ export const TOOLS = [
267
279
  'with queue_status, and never call translate_set again to hurry it. `stopped` {reason, message} ' +
268
280
  '= the run stops short (`hash_cap`, a per-action ceiling this site set; the budget; the license; ' +
269
281
  'the key…) and has no cursor to continue: tell the user. ' +
270
- 'What was NOT done arrives by identity in `refused[]` — `{id, kind, lang, reason, message, in?}`, ' +
282
+ 'What was NOT done arrives by identity in `refused[]` — `{id, kind, lang, reason, message, in?, text?}`, ' +
271
283
  'listing up to 200, with the whole count in `refused_total` where the answer has one — relay it, ' +
272
284
  'do not retry it: `not_found`, `forbidden` (you ' +
273
285
  'cannot edit that post), `translate_tier` (a string shared beyond your rights), ' +
274
- '`translation_locked` (under `force`). A string that is already translated is not a refusal: it ' +
275
- 'is simply not sent again. `force: true` re-translates existing translations, always in request ' +
276
- 'mode — and never over a whole `scope.type` (400 `zl_selector_force_queued`: narrow it to a ' +
277
- 'document or `targets`). AI output lands as ' +
286
+ '`translation_locked` (under `force`), `answer_refused` (the engine answered but lost a mark or a ' +
287
+ 'link of the original, so nothing was placed; `text` is the opening of its source, for the user to ' +
288
+ 'find it and translate it by hand). A string that is already translated is not a refusal: it ' +
289
+ 'is simply not sent again. `force: true` re-translates existing translations, in request ' +
290
+ 'mode — over a whole `scope.type` it is queued and leaves locked and human-written ' +
291
+ 'translations as they are (the dry-run counts them in `spared`). AI output lands as ' +
278
292
  'DRAFTS unless the site auto-approves — sign it off with approve_item / approve_set. For ' +
279
293
  'translations you produced yourself use save_translations.',
280
294
  method: 'POST',
@@ -295,7 +309,8 @@ export const TOOLS = [
295
309
  description:
296
310
  "The review gate's sign-off for a SET — many pages, terms, menus or strings, in one or more " +
297
311
  'languages; approved text serves publicly once its language is live (site_status). For one post ' +
298
- 'in one language approve_item is simpler. Describe the set in `selector` (the usual filter is ' +
312
+ 'in one language approve_item is simpler; `scope.document` also approves the drafts of the posts ' +
313
+ 'its loops show, each under its own rights. Describe the set in `selector` (the usual filter is ' +
299
314
  '`status: ["needs_review"]`); the SERVER resolves it and checks your rights per unit and per ' +
300
315
  'string. ' +
301
316
  '(1) Call with `dry_run: true` FIRST and tell the user the number: `units`, `cells` (unit × ' +