@lefine/mcp 1.0.0-rc.0 → 1.0.0-rc.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 +3 -3
- package/bin/lefine-mcp.js +8 -0
- package/bin/meta.js +31 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -8,7 +8,7 @@ Lefine as an MCP server for Claude, Cursor, VS Code, Codex and other AI apps. It
|
|
|
8
8
|
2. **Adds local tools** that only a process on your machine can offer: upload a picture or a whole folder,
|
|
9
9
|
import your translation files, and read which Lefine project a code folder belongs to.
|
|
10
10
|
|
|
11
|
-
|
|
11
|
+
Who approves a publish depends on how you signed in. An AI app you connected with `npx @lefine/mcp setup` (sign-in in the browser) asks a person first, in the app or on a Lefine approval page. A plain API key (`LEFINE_TOKEN`) publishes right away, unless the workspace owner turned on **Ask me before agents publish or change content** (Lefine, Settings, API keys, Agent approvals). That switch is off by default.
|
|
12
12
|
|
|
13
13
|
## Install
|
|
14
14
|
|
|
@@ -43,7 +43,7 @@ From the server (always in sync, listed with `tools/list` and kept for 5 minutes
|
|
|
43
43
|
| `lefine_lookup` | Find a page, key, media file, app, project, type or global by name ("z5k privacy page"). |
|
|
44
44
|
| `lefine_read` | Run an action that only reads. |
|
|
45
45
|
| `lefine_write` | Run an action that writes drafts. Nothing goes live. `steps` runs up to 50 at once. |
|
|
46
|
-
| `lefine_publish` | Run an action that goes live.
|
|
46
|
+
| `lefine_publish` | Run an action that goes live. A connected AI app asks a person first (a batch is one yes for the exact list); an API key publishes right away unless Agent approvals is on. |
|
|
47
47
|
| `lefine_edit` | Change fields of one page, global or key by name, as a draft. `dryRun` shows the diff. |
|
|
48
48
|
| `lefine_launch`, `lefine_launch_status` | Take the workspace into a new market; read how it went. |
|
|
49
49
|
|
|
@@ -99,7 +99,7 @@ What the local tools can read and write, exactly:
|
|
|
99
99
|
- **The key stays on your machine.** It goes only to the server it was saved for and never appears in tool
|
|
100
100
|
output. `lefine.ts` and `lefine.config.*` are read as text: a cloned repository cannot run code by starting
|
|
101
101
|
this server. Text from your files is marked as data in answers; do not let an agent treat it as instructions.
|
|
102
|
-
- **Publishing asks a person first
|
|
102
|
+
- **Publishing asks a person first for a connected AI app, not for an API key.** With `LEFINE_TOKEN` and Agent approvals off (the default), a publish runs at once; each change is still recorded. Turn Agent approvals on in Lefine settings, or use `--read-only`, if an agent must not publish alone.
|
|
103
103
|
- Not covered: a folder renamed between the path check and the read could redirect the open. Someone who can
|
|
104
104
|
do that already has your account's files.
|
|
105
105
|
|
package/bin/lefine-mcp.js
CHANGED
|
@@ -8,8 +8,16 @@ import { readFileSync } from "node:fs";
|
|
|
8
8
|
import { createRequire } from "node:module";
|
|
9
9
|
import { dirname, join } from "node:path";
|
|
10
10
|
import { pathToFileURL } from "node:url";
|
|
11
|
+
import { metaOutput } from "./meta.js";
|
|
11
12
|
import { routeArgs } from "./route.js";
|
|
12
13
|
|
|
14
|
+
const own = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf-8"));
|
|
15
|
+
const meta = metaOutput(process.argv.slice(2), own.version);
|
|
16
|
+
if (meta !== null) {
|
|
17
|
+
process.stdout.write(meta);
|
|
18
|
+
process.exit(0);
|
|
19
|
+
}
|
|
20
|
+
|
|
13
21
|
const manifest = createRequire(import.meta.url).resolve("lefine/package.json");
|
|
14
22
|
const { bin } = JSON.parse(readFileSync(manifest, "utf-8"));
|
|
15
23
|
const args = process.argv.slice(2);
|
package/bin/meta.js
ADDED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// `--version` and `--help` of the `lefine-mcp` bin: its own name and version, and the flags the server takes.
|
|
2
|
+
// Pure, so a test can read it. Only as the first argument: `setup --help` still belongs to `lefine setup`.
|
|
3
|
+
|
|
4
|
+
export const HELP = `lefine-mcp: Lefine's MCP server and setup (npx @lefine/mcp)
|
|
5
|
+
|
|
6
|
+
Usage:
|
|
7
|
+
npx @lefine/mcp in a terminal: the setup wizard
|
|
8
|
+
npx @lefine/mcp setup [flags] add Lefine to your AI apps (--list, --remove, --doctor, --print, --yes, --client <name>, --readonly, --project)
|
|
9
|
+
npx @lefine/mcp [flags] started by an AI app (stdin is not a terminal): the stdio server
|
|
10
|
+
|
|
11
|
+
Server flags:
|
|
12
|
+
--read-only only reading tools (also asks the server for a read ceiling)
|
|
13
|
+
--toolsets <list> only these modules, comma separated (strings, content, studio, social, sites, brain, integrations)
|
|
14
|
+
--allow-dir <dir> a folder besides the working folder that local tools may read (repeatable)
|
|
15
|
+
--tools-ttl <seconds> how long the server's tool list is kept (default 300)
|
|
16
|
+
--version, --help
|
|
17
|
+
|
|
18
|
+
Sign in: npx @lefine/mcp setup (or npx lefine login, or set LEFINE_TOKEN)
|
|
19
|
+
Environment: LEFINE_TOKEN, LEFINE_API_URL, LEFINE_PROFILE, LEFINE_MCP_READ_ONLY=1, LEFINE_MCP_TOOLSETS,
|
|
20
|
+
LEFINE_MCP_ALLOW_DIRS, LEFINE_MCP_TOOLS_TTL
|
|
21
|
+
Publishing: an API key publishes right away unless Agent approvals is on in Lefine settings.
|
|
22
|
+
Logs go to stderr; stdout carries only MCP messages.
|
|
23
|
+
`;
|
|
24
|
+
|
|
25
|
+
/** What to print for `--version` / `--help` as the first argument, or null when the call is something else. */
|
|
26
|
+
export function metaOutput(args, version) {
|
|
27
|
+
const [first] = args;
|
|
28
|
+
if (first === "--version" || first === "-v") return `${version}\n`;
|
|
29
|
+
if (first === "--help" || first === "-h") return HELP;
|
|
30
|
+
return null;
|
|
31
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lefine/mcp",
|
|
3
|
-
"version": "1.0.0-rc.
|
|
3
|
+
"version": "1.0.0-rc.2",
|
|
4
4
|
"description": "Set up Lefine in your AI apps with one command (npx @lefine/mcp), and the stdio server an app starts",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -36,6 +36,6 @@
|
|
|
36
36
|
"node": ">=20"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"lefine": "^0.
|
|
39
|
+
"lefine": "^0.11.1"
|
|
40
40
|
}
|
|
41
41
|
}
|