@zerolingua/mcp 0.4.3 → 0.5.0
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 +6 -2
- package/index.js +1 -1
- package/package.json +1 -1
- package/tools.js +69 -3
package/README.md
CHANGED
|
@@ -64,10 +64,13 @@ The server needs **Node.js 20** or later, as the MCP SDK v2 it runs on does.
|
|
|
64
64
|
| `approve_set` | sign off a set, chunk by chunk, by cursor |
|
|
65
65
|
| `queue_status` | follow the queued jobs `translate_set` started |
|
|
66
66
|
| `keep_original` | mark texts that need no translation (served as written) |
|
|
67
|
+
| `get_settings` | read writing style (all roles) or non-secret site settings (admin), with optional text sample |
|
|
68
|
+
| `update_settings` | adjust writing style: site brief, formality, per-language tone and glossary (admin, dry run first) |
|
|
67
69
|
|
|
68
70
|
`translate_set`, `approve_set` and `queue_status` need **Zerø Lingua 0.8.0** or
|
|
69
|
-
later on the site
|
|
70
|
-
|
|
71
|
+
later on the site, `keep_original` needs **0.11.2**, and `get_settings` /
|
|
72
|
+
`update_settings` need **0.16.0**; against an older plugin they answer
|
|
73
|
+
`404 rest_no_route`, and the others keep working.
|
|
71
74
|
|
|
72
75
|
## Working with sets
|
|
73
76
|
|
|
@@ -128,6 +131,7 @@ tool, authenticated with the user's own Application Password.
|
|
|
128
131
|
|
|
129
132
|
## Versions
|
|
130
133
|
|
|
134
|
+
- **0.5.0** (Zerø Lingua 0.16.0): `get_settings` and `update_settings`. Translators can read the writing style (site brief, formality, per-language tone, glossary); administrators can read all non-secret settings (plus an optional 12-text sample) and patch those five writing-style fields with `dry_run: true` first and an undoable `previous` patch. API keys, endpoints, licence, privacy and agent settings are never returned or writable.
|
|
131
135
|
- **0.4.3** — the tools say what Zerø Lingua 0.13 does: `translate_set` with `force` never
|
|
132
136
|
re-translates what a person wrote or locked; a save an agent sends with the same text writes
|
|
133
137
|
nothing; a locked text is refused as `translation_locked`, and `skipped_why` names each refusal.
|
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.
|
|
40
|
+
const server = new McpServer( { name: 'zero-lingua', version: '0.5.0' } );
|
|
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
|
+
"version": "0.5.0",
|
|
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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The
|
|
2
|
+
* The twelve Zerø Lingua tools: their schemas, their teaching descriptions, and
|
|
3
3
|
* the one HTTP call each of them is.
|
|
4
4
|
*
|
|
5
5
|
* This process holds ZERO domain logic on purpose. Placeholder guarding, the
|
|
@@ -97,6 +97,12 @@ const CURSOR = z
|
|
|
97
97
|
.optional()
|
|
98
98
|
.describe( 'the `cursor` of the previous answer of this run; send it with the SAME selector' );
|
|
99
99
|
|
|
100
|
+
/** The three registers a language takes: '' inherits the site's, as get_settings shows. */
|
|
101
|
+
const FORMALITY = z.enum( [ '', 'formal', 'informal' ] );
|
|
102
|
+
|
|
103
|
+
/** One level of an update_settings patch: the known keys described, any other one still sent, so the server names it. */
|
|
104
|
+
const open = ( shape ) => z.object( shape ).catchall( z.unknown() );
|
|
105
|
+
|
|
100
106
|
export const TOOLS = [
|
|
101
107
|
{
|
|
102
108
|
name: 'site_status',
|
|
@@ -332,9 +338,9 @@ export const TOOLS = [
|
|
|
332
338
|
'the site\'s per-action ceiling), or `unknown` — neither in the queue nor among the last 20 ' +
|
|
333
339
|
'finished jobs. `unknown` cannot tell a job that never existed from one that was cleared or one ' +
|
|
334
340
|
'that finished long ago: it is neither success nor failure, so read the result in ' +
|
|
335
|
-
'pending_overview or list_items. Without `id`: `jobs[]` ({id, lang}) lists
|
|
341
|
+
'pending_overview or list_items. Without `id`: `jobs[]` ({id, lang}) lists your live set jobs (all for administrators); foreign jobs return `unknown`. ' +
|
|
336
342
|
'Every answer carries `queue` (the AI queue — a non-empty `stopped`, with its `cause`, means it is ' +
|
|
337
|
-
'paused: tell the user) and `budget` (the
|
|
343
|
+
'paused: tell the user) and `budget` (only `over`, or the full meter for administrators). Queued work runs in the background and ' +
|
|
338
344
|
'the provider\'s batch mode can take hours: poll at a relaxed pace, never in a tight loop, and ' +
|
|
339
345
|
'never re-send translate_set to hurry it.',
|
|
340
346
|
method: 'GET',
|
|
@@ -366,6 +372,66 @@ export const TOOLS = [
|
|
|
366
372
|
locked: z.boolean().optional().describe( 'default true; false takes the mark off' ),
|
|
367
373
|
} ),
|
|
368
374
|
},
|
|
375
|
+
{
|
|
376
|
+
name: 'get_settings',
|
|
377
|
+
title: 'Read the writing style and settings',
|
|
378
|
+
description:
|
|
379
|
+
'How this site wants its translations written. Every translator reads the writing style: `ai.context` ' +
|
|
380
|
+
'(the site brief sent with every AI translation), `ai.formality`, each language\'s `formality` and `tone` ' +
|
|
381
|
+
'in `languages[]` (an empty `formality` inherits `ai.formality`) and the `glossary` (`keep`: terms never ' +
|
|
382
|
+
'translated; `terms`: a preferred translation per language). The answer depends on your role, so read ' +
|
|
383
|
+
'`tier`: `translator` gets only that style; `admin` also gets every other setting an agent may read ' +
|
|
384
|
+
'(languages, URLs, switcher, content, the AI engine without its keys, automation), `writable` (what ' +
|
|
385
|
+
'update_settings accepts, with its limits) and `pinned` (what a wp-config constant or a filter fixes). ' +
|
|
386
|
+
'`can_update` says whether update_settings is open to you. `only` narrows an admin answer to some groups, ' +
|
|
387
|
+
'for example ["ai","glossary"]. `sample: true` (admin) adds up to 12 recent texts of the site: read them ' +
|
|
388
|
+
'to learn its voice before you propose a brief or a tone. API keys, endpoints, licence, privacy and agent ' +
|
|
389
|
+
'settings are never returned.',
|
|
390
|
+
method: 'GET',
|
|
391
|
+
route: 'settings',
|
|
392
|
+
input: z.object( {
|
|
393
|
+
only: z.array( z.string() ).optional().describe( 'admin: the groups to return, such as ["ai","languages","glossary"]; omit for all' ),
|
|
394
|
+
sample: z.boolean().optional().describe( 'admin: add up to 12 recent texts of the site, to read its voice' ),
|
|
395
|
+
} ),
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
name: 'update_settings',
|
|
399
|
+
title: 'Adjust the writing style',
|
|
400
|
+
description:
|
|
401
|
+
'Adjust how the site\'s AI engine and its agents write FUTURE translations: the site brief, the formality, ' +
|
|
402
|
+
'the tone of each language and the glossary. Existing translations stay as they are; to redo them, use ' +
|
|
403
|
+
'translate_set. Administrators only; through Remote MCP the connection also needs the `zl:configure` ' +
|
|
404
|
+
'permission. `patch` is a merge patch in the shape get_settings reads: {"ai": {"context": "...", ' +
|
|
405
|
+
'"formality": "formal"}, "languages": {"es": {"formality": "informal", "tone": "..."}}, "glossary": ' +
|
|
406
|
+
'{"keep": {"Brand": true}, "terms": {"Read more": {"es": "Leer más"}}}}. In the glossary `null` deletes ' +
|
|
407
|
+
'a term, or one language of it (at most 20 deletions per call). Only those five settings are writable: ' +
|
|
408
|
+
'any other path is refused by name (`setting_read_only` says where a person changes it, ' +
|
|
409
|
+
'`setting_forbidden`, `setting_unknown`, `invalid_value`), and one refusal writes nothing. ' +
|
|
410
|
+
'(1) Call with `dry_run: true` FIRST and show the user `changed[]` ({path, from, to}). (2) Call again ' +
|
|
411
|
+
'without `dry_run`. Keep `previous`: sent back as `patch`, it undoes the call.',
|
|
412
|
+
method: 'POST',
|
|
413
|
+
route: 'settings',
|
|
414
|
+
input: z.object( {
|
|
415
|
+
patch: open( {
|
|
416
|
+
ai: open( {
|
|
417
|
+
context: z.string().optional().describe( 'the site brief: who the site is for, its voice, what to avoid' ),
|
|
418
|
+
formality: FORMALITY.optional(),
|
|
419
|
+
} ).optional(),
|
|
420
|
+
languages: z
|
|
421
|
+
.record( z.string(), open( { formality: FORMALITY.optional(), tone: z.string().optional() } ) )
|
|
422
|
+
.optional()
|
|
423
|
+
.describe( 'by language code from site_status' ),
|
|
424
|
+
glossary: open( {
|
|
425
|
+
keep: z.record( z.string(), z.boolean().nullable() ).optional().describe( 'term => true keeps it as written; null takes it off' ),
|
|
426
|
+
terms: z
|
|
427
|
+
.record( z.string(), z.record( z.string(), z.string().nullable() ).nullable() )
|
|
428
|
+
.optional()
|
|
429
|
+
.describe( 'term => {code: preferred translation}; null deletes the term or that language' ),
|
|
430
|
+
} ).optional(),
|
|
431
|
+
} ).describe( 'only the settings to change' ),
|
|
432
|
+
dry_run: z.boolean().optional().describe( 'true = say what would change and write nothing' ),
|
|
433
|
+
} ),
|
|
434
|
+
},
|
|
369
435
|
];
|
|
370
436
|
|
|
371
437
|
/** One honest error result: the agent should relay this, not retry blindly. */
|