zazalens-mcp 1.4.0 → 1.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 +42 -24
- package/bin/cli.mjs +23 -9
- package/bin/config.mjs +7 -6
- package/bin/extra-clients.mjs +79 -0
- package/package.json +8 -4
package/README.md
CHANGED
|
@@ -6,50 +6,68 @@ This repository is intended for `https://github.com/89joshuaugwu/zazalens-mcp`.
|
|
|
6
6
|
|
|
7
7
|
Zaza Lens reads hidden Unicode characters in text and supported metadata in PNG, JPEG and WebP images. A tool name or metadata value is a clue, **not proof that content came from AI**. The server cannot reliably identify AI-written text, detect invisible image watermarks or verify Content Credentials signatures. It does not claim to erase AI fingerprints.
|
|
8
8
|
|
|
9
|
-
## Install
|
|
9
|
+
## Install from npm (recommended)
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
Install Node.js 22+ (Node.js 24 LTS recommended) and Git first. In PowerShell, clone into a **permanent** folder, separate from other projects:
|
|
11
|
+
Zaza Lens MCP **v1.4.0 is available on npm** at https://www.npmjs.com/package/zazalens-mcp. Install Node.js 22 or newer, then run **one** command for your assistant:
|
|
14
12
|
|
|
15
13
|
```powershell
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
cd .\zazalens-mcp
|
|
20
|
-
node .\setup\check.mjs
|
|
21
|
-
node .\bin\cli.mjs setup both --source local
|
|
14
|
+
npx -y zazalens-mcp@1.4.0 setup codex
|
|
15
|
+
npx -y zazalens-mcp@1.4.0 setup claude
|
|
16
|
+
npx -y zazalens-mcp@1.4.0 setup both
|
|
22
17
|
```
|
|
23
18
|
|
|
24
|
-
|
|
19
|
+
The version is pinned to avoid silently switching to future code. The installer previews its changes, asks for consent, and backs up existing configurations. Local image-folder access is **OFF by default**. If Zaza Lens is already connected from an older Git clone or ZIP, review the existing MCP entry and append `--replace` only when you want to change it.
|
|
25
20
|
|
|
26
|
-
|
|
21
|
+
Verify the downloaded package without changing your assistant settings:
|
|
27
22
|
|
|
28
|
-
|
|
23
|
+
```powershell
|
|
24
|
+
npx -y zazalens-mcp@1.4.0 doctor
|
|
25
|
+
npx -y zazalens-mcp@1.4.0 setup both --dry-run
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
To uninstall Zaza Lens entries (other MCP servers remain):
|
|
29
29
|
|
|
30
30
|
```powershell
|
|
31
|
-
|
|
31
|
+
npx -y zazalens-mcp@1.4.0 uninstall both
|
|
32
32
|
```
|
|
33
33
|
|
|
34
|
-
|
|
34
|
+
## More AI assistants (v1.5.0 development preview)
|
|
35
|
+
|
|
36
|
+
This branch adds installers for **Gemini CLI**, **Cursor (global)**, **GitHub Copilot / VS Code's native Copilot harness**, and **Windsurf**, in addition to Codex and Claude Desktop. These are MCP **clients**; the AI model behind a client may differ.
|
|
37
|
+
|
|
38
|
+
The official npm release remains **v1.4.0** until v1.5.0 is independently tested and published. Do not use the following `npx@1.5.0` commands yet. To test this source branch, use `node bin/cli.mjs setup <client> --source local --dry-run` and review its config changes.
|
|
39
|
+
|
|
40
|
+
Once v1.5.0 is published, these commands will become available:
|
|
35
41
|
|
|
36
42
|
```powershell
|
|
37
|
-
|
|
43
|
+
npx -y zazalens-mcp@1.5.0 setup gemini
|
|
44
|
+
npx -y zazalens-mcp@1.5.0 setup cursor
|
|
45
|
+
npx -y zazalens-mcp@1.5.0 setup copilot
|
|
46
|
+
npx -y zazalens-mcp@1.5.0 setup windsurf
|
|
38
47
|
```
|
|
39
48
|
|
|
40
|
-
|
|
49
|
+
The `both` option remains **Codex + Claude Desktop** for backward compatibility. The new `all` option configures all six clients; it may create settings even for apps you have not installed, so use it only when you intend to do so. Use `uninstall <client>` to remove only the Zaza Lens entry and keep other servers.
|
|
50
|
+
|
|
51
|
+
Settings are stored in the app's **user-level** configuration: `~/.gemini/settings.json`, `~/.cursor/mcp.json`, `~/.copilot/mcp-config.json` (or `$COPILOT_HOME/mcp-config.json`), and `~/.codeium/windsurf/mcp_config.json`. Copilot now prefers its **native** configuration instead of the deprecated `.vscode/mcp.json` format.
|
|
52
|
+
|
|
53
|
+
Official client references: [Gemini CLI](https://geminicli.com/docs/tools/mcp-server/), [Cursor](https://cursor.com/docs/mcp), [GitHub Copilot MCP](https://code.visualstudio.com/docs/agents/reference/mcp-configuration).
|
|
41
54
|
|
|
42
|
-
|
|
55
|
+
## Alternative: permanent local Git clone
|
|
56
|
+
|
|
57
|
+
For a source-based installation that avoids npm downloads on each MCP startup, install Node.js 22+ and Git, then run in PowerShell:
|
|
43
58
|
|
|
44
59
|
```powershell
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
60
|
+
New-Item -ItemType Directory -Force "$HOME\Tools" | Out-Null
|
|
61
|
+
cd "$HOME\Tools"
|
|
62
|
+
git clone https://github.com/89joshuaugwu/zazalens-mcp.git
|
|
63
|
+
cd .\zazalens-mcp
|
|
64
|
+
node .\setup\check.mjs
|
|
65
|
+
node .\bin\cli.mjs setup both --source local
|
|
48
66
|
```
|
|
49
67
|
|
|
50
|
-
|
|
68
|
+
You can replace `both` with `codex` or `claude`. Keep the cloned directory in place, because the assistant launches `mcp/stdio.mjs` from this path. For local-only verification, use `node .\bin\cli.mjs doctor`; for config removal, use `node .\bin\cli.mjs uninstall both`.
|
|
51
69
|
|
|
52
|
-
|
|
70
|
+
The older GitHub-backed `npx -y github:89joshuaugwu/zazalens-mcp ...` command can fail with `EALLOWGIT` on npm 12. **Do not disable npm Git security settings globally** to work around this.
|
|
53
71
|
|
|
54
72
|
### Verify installation and troubleshoot
|
|
55
73
|
|
|
@@ -127,7 +145,7 @@ The local implementation supports legacy 2025-11-25 initialization and current 2
|
|
|
127
145
|
|
|
128
146
|
For the full Next.js website, use the separate `Zaza-Lens-Website-NextJS-MCP.zip` bundle, not this local-MCP-only repository. The website can expose an optional, disabled-by-default, bearer-token-protected `/mcp` endpoint, but production public use requires authentication and abuse prevention. See `SETUP-FOR-EVERYONE.md`.
|
|
129
147
|
|
|
130
|
-
**Licensing:**
|
|
148
|
+
**Licensing:** The public MCP source is distributed under the [MIT License](LICENSE). Other bundled projects, including the private website, may use different notices or terms.
|
|
131
149
|
|
|
132
150
|
**Safety/privacy:** The scanner does not prove AI authorship or make content immune to provenance checks. Review individual metadata changes and keep required disclosures. Never give an untrusted MCP access to confidential files without reviewing its code and permissions.
|
|
133
151
|
|
package/bin/cli.mjs
CHANGED
|
@@ -6,6 +6,14 @@ import {spawnSync} from 'node:child_process';
|
|
|
6
6
|
import {createInterface} from 'node:readline/promises';
|
|
7
7
|
import {prepareSetup,prepareUninstall,saveConfig} from './config.mjs';
|
|
8
8
|
|
|
9
|
+
const SUPPORTED_CLIENTS=['codex','claude','gemini','cursor','copilot','windsurf'];
|
|
10
|
+
function expandTarget(target){
|
|
11
|
+
if(target==='both') return ['codex','claude'];
|
|
12
|
+
if(target==='all') return [...SUPPORTED_CLIENTS];
|
|
13
|
+
if(SUPPORTED_CLIENTS.includes(target)) return [target];
|
|
14
|
+
throw new Error('Choose codex, claude, gemini, cursor, copilot, windsurf, both, or all.');
|
|
15
|
+
}
|
|
16
|
+
|
|
9
17
|
function help() {
|
|
10
18
|
console.log(`Zaza Lens MCP: inspect evidence, preserve originals.
|
|
11
19
|
|
|
@@ -14,8 +22,14 @@ Commands:
|
|
|
14
22
|
zazalens-mcp doctor Verify the local package
|
|
15
23
|
zazalens-mcp setup codex Connect to Codex CLI / VS Code extension
|
|
16
24
|
zazalens-mcp setup claude Connect to Claude Desktop
|
|
17
|
-
zazalens-mcp setup both Connect to
|
|
18
|
-
zazalens-mcp
|
|
25
|
+
zazalens-mcp setup both Connect to Codex and Claude Desktop (unchanged)
|
|
26
|
+
zazalens-mcp setup gemini Connect to Gemini CLI
|
|
27
|
+
zazalens-mcp setup cursor Connect to Cursor (global)
|
|
28
|
+
zazalens-mcp setup copilot Connect to native GitHub Copilot / VS Code MCP
|
|
29
|
+
zazalens-mcp setup windsurf Connect to Windsurf Cascade
|
|
30
|
+
zazalens-mcp setup all Configure all six supported apps
|
|
31
|
+
zazalens-mcp uninstall both Remove Zaza Lens from Codex and Claude
|
|
32
|
+
zazalens-mcp uninstall all Remove Zaza Lens from all supported apps
|
|
19
33
|
|
|
20
34
|
Setup options:
|
|
21
35
|
--source local Run from a permanent Git clone, no npm download
|
|
@@ -32,9 +46,11 @@ First install from GitHub (Node.js 22+):
|
|
|
32
46
|
cd zazalens-mcp
|
|
33
47
|
node bin/cli.mjs setup both --source local
|
|
34
48
|
|
|
35
|
-
|
|
36
|
-
npx -y zazalens-mcp@1.
|
|
37
|
-
npx -y zazalens-mcp@1.
|
|
49
|
+
Published v1.4.0 supports Codex and Claude. After publishing v1.5.0:
|
|
50
|
+
npx -y zazalens-mcp@1.5.0 setup gemini
|
|
51
|
+
npx -y zazalens-mcp@1.5.0 setup cursor
|
|
52
|
+
npx -y zazalens-mcp@1.5.0 setup copilot
|
|
53
|
+
npx -y zazalens-mcp@1.5.0 setup windsurf
|
|
38
54
|
|
|
39
55
|
Local file access is OFF unless --allow-images is supplied.
|
|
40
56
|
`);
|
|
@@ -74,7 +90,7 @@ async function askConsent(){
|
|
|
74
90
|
}
|
|
75
91
|
|
|
76
92
|
async function install(target,args){
|
|
77
|
-
|
|
93
|
+
const targets=expandTarget(target);
|
|
78
94
|
const options=parseOptions(args);
|
|
79
95
|
selfTest();
|
|
80
96
|
if(options.allowedDir){
|
|
@@ -83,7 +99,6 @@ async function install(target,args){
|
|
|
83
99
|
if(!info.isDirectory()) throw new Error('--allow-images must point to an existing folder.');
|
|
84
100
|
options.allowedDir=absolute;
|
|
85
101
|
}
|
|
86
|
-
const targets=target==='both'?['codex','claude']:[target];
|
|
87
102
|
const plans=[];
|
|
88
103
|
for(const client of targets) plans.push(await prepareSetup(client,options));
|
|
89
104
|
console.log('');
|
|
@@ -107,14 +122,13 @@ async function install(target,args){
|
|
|
107
122
|
|
|
108
123
|
|
|
109
124
|
async function uninstall(target,args){
|
|
110
|
-
|
|
125
|
+
const targets=expandTarget(target);
|
|
111
126
|
let dryRun=false,yes=false;
|
|
112
127
|
for(const arg of args){
|
|
113
128
|
if(arg==='--dry-run')dryRun=true;
|
|
114
129
|
else if(arg==='--yes')yes=true;
|
|
115
130
|
else throw new Error('Unknown uninstall option: '+arg);
|
|
116
131
|
}
|
|
117
|
-
const targets=target==='both'?['codex','claude']:[target];
|
|
118
132
|
const plans=[];
|
|
119
133
|
for(const client of targets)plans.push(await prepareUninstall(client));
|
|
120
134
|
console.log('Zaza Lens MCP uninstall (configuration only)');
|
package/bin/config.mjs
CHANGED
|
@@ -3,11 +3,12 @@ import path from 'node:path';
|
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
4
|
import crypto from 'node:crypto';
|
|
5
5
|
import { fileURLToPath } from 'node:url';
|
|
6
|
+
import {extraConfigPaths,prepareExtraClient,removeExtraClient,EXTRA_CLIENTS} from './extra-clients.mjs';
|
|
6
7
|
|
|
7
8
|
export const SERVER = 'zaza_lens';
|
|
8
9
|
export const CLAUDE_SERVER = 'zaza-lens';
|
|
9
10
|
export const GITHUB_SPEC = 'github:89joshuaugwu/zazalens-mcp';
|
|
10
|
-
export const NPM_SPEC = 'zazalens-mcp@1.
|
|
11
|
+
export const NPM_SPEC = 'zazalens-mcp@1.5.0';
|
|
11
12
|
export const LOCAL_ENTRY = fileURLToPath(new URL('../mcp/stdio.mjs', import.meta.url));
|
|
12
13
|
|
|
13
14
|
function isObject(value) {
|
|
@@ -41,7 +42,7 @@ export function configPaths({platform = process.platform, home = os.homedir(), e
|
|
|
41
42
|
: platform === 'darwin'
|
|
42
43
|
? pm.join(home, 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json')
|
|
43
44
|
: pm.join(home, '.config', 'Claude', 'claude_desktop_config.json');
|
|
44
|
-
return {claude, codex: pm.join(home, '.codex', 'config.toml')};
|
|
45
|
+
return {claude, codex: pm.join(home, '.codex', 'config.toml'), ...extraConfigPaths({platform,home,env})};
|
|
45
46
|
}
|
|
46
47
|
|
|
47
48
|
export function tomlString(value) {return JSON.stringify(value);}
|
|
@@ -201,18 +202,18 @@ export function removeClaude(content) {
|
|
|
201
202
|
export async function prepareUninstall(client, {platform=process.platform,home=os.homedir(),env=process.env}={}) {
|
|
202
203
|
const paths=configPaths({platform,home,env});
|
|
203
204
|
const filePath=paths[client];
|
|
204
|
-
if(!filePath)throw new Error('
|
|
205
|
+
if(!filePath)throw new Error('Unsupported MCP client: '+client);
|
|
205
206
|
const previous=await getCurrentFile(filePath);
|
|
206
|
-
const result=client==='codex'?removeCodex(previous.content):removeClaude(previous.content);
|
|
207
|
+
const result=client==='codex'?removeCodex(previous.content):client==='claude'?removeClaude(previous.content):removeExtraClient(client,previous.content);
|
|
207
208
|
return {client,filePath,previous,...result};
|
|
208
209
|
}
|
|
209
210
|
|
|
210
211
|
export async function prepareSetup(client, {source='npm',ref='',allowedDir='',replace=false,platform=process.platform,home=os.homedir(),env=process.env} = {}) {
|
|
211
212
|
const paths=configPaths({platform,home,env});
|
|
212
213
|
const filePath=paths[client];
|
|
213
|
-
if(!filePath) throw new Error('
|
|
214
|
+
if(!filePath) throw new Error('Unsupported MCP client: '+client);
|
|
214
215
|
const previous=await getCurrentFile(filePath);
|
|
215
216
|
const spec=launchSpec({source,ref,platform});
|
|
216
|
-
const result=client==='codex'
|
|
217
|
+
const result=client==='codex'?prepareCodex(previous.content,spec,allowedDir,replace):client==='claude'?prepareClaude(previous.content,spec,allowedDir,replace):prepareExtraClient(client,previous.content,spec,allowedDir,replace);
|
|
217
218
|
return {client,filePath,previous,...result,spec};
|
|
218
219
|
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
|
|
3
|
+
export const EXTRA_CLIENTS = Object.freeze(['gemini','cursor','copilot','windsurf']);
|
|
4
|
+
const ENTRY = 'zaza-lens';
|
|
5
|
+
|
|
6
|
+
function plain(value) {
|
|
7
|
+
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export function extraConfigPaths({platform,home,env={}}) {
|
|
11
|
+
const pm=platform==='win32' ? path.win32 : path.posix;
|
|
12
|
+
const copilotBase=env.COPILOT_HOME || pm.join(home,'.copilot');
|
|
13
|
+
if(!pm.isAbsolute(copilotBase)) {
|
|
14
|
+
throw new Error('COPILOT_HOME must be an absolute directory when set.');
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
gemini:pm.join(home,'.gemini','settings.json'),
|
|
18
|
+
cursor:pm.join(home,'.cursor','mcp.json'),
|
|
19
|
+
copilot:pm.join(copilotBase,'mcp-config.json'),
|
|
20
|
+
windsurf:pm.join(home,'.codeium','windsurf','mcp_config.json')
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function validateClient(client) {
|
|
25
|
+
if(!EXTRA_CLIENTS.includes(client)) throw new Error('Unknown MCP client: '+client);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function parseConfig(client,oldContent) {
|
|
29
|
+
if(typeof oldContent!=='string') throw new Error('Expected JSON settings text.');
|
|
30
|
+
let data;
|
|
31
|
+
try {data=oldContent.trim()?JSON.parse(oldContent):{};}
|
|
32
|
+
catch {throw new Error(client+' configuration contains invalid JSON; it was not changed.');}
|
|
33
|
+
if(!plain(data)) throw new Error(client+' settings must be a JSON object.');
|
|
34
|
+
if(data.mcpServers!==undefined && !plain(data.mcpServers)) {
|
|
35
|
+
throw new Error(client+' mcpServers must be a JSON object.');
|
|
36
|
+
}
|
|
37
|
+
return data;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function ours(value) {
|
|
41
|
+
if(!plain(value) || typeof value.command!=='string' || !Array.isArray(value.args)) return false;
|
|
42
|
+
if(!value.args.every(part=>typeof part==='string'))return false;
|
|
43
|
+
const joined=[value.command,...value.args].join(' ').replace(/\\/g,'/');
|
|
44
|
+
return /zazalens-mcp|zaza[-_]lens|\/mcp\/stdio\.mjs/i.test(joined);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function wanted(client,spec,allowedDir) {
|
|
48
|
+
const configured = {
|
|
49
|
+
...(client==='cursor'||client==='copilot'?{type:'stdio'}:{}),
|
|
50
|
+
command:spec.command,
|
|
51
|
+
args:[...spec.args]
|
|
52
|
+
};
|
|
53
|
+
if(allowedDir) configured.env={ZAZA_MCP_ALLOWED_DIRS:allowedDir};
|
|
54
|
+
return configured;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function prepareExtraClient(client,oldContent,spec,allowedDir='',replace=false) {
|
|
58
|
+
validateClient(client);
|
|
59
|
+
const data=parseConfig(client,oldContent);
|
|
60
|
+
const desired=wanted(client,spec,allowedDir);
|
|
61
|
+
const current=data.mcpServers?.[ENTRY];
|
|
62
|
+
if(current!==undefined) {
|
|
63
|
+
if(JSON.stringify(current)===JSON.stringify(desired)) return {changed:false,content:oldContent,reason:'already configured'};
|
|
64
|
+
if(!replace) throw new Error(client+' already has zaza-lens. Re-run with --replace only after reviewing that entry.');
|
|
65
|
+
if(!ours(current)) throw new Error('Existing '+client+' entry does not appear to belong to Zaza Lens; refusing to replace it.');
|
|
66
|
+
}
|
|
67
|
+
data.mcpServers={...(data.mcpServers||{}),[ENTRY]:desired};
|
|
68
|
+
return {changed:true,content:JSON.stringify(data,null,2)+'\n'};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function removeExtraClient(client,oldContent) {
|
|
72
|
+
validateClient(client);
|
|
73
|
+
const data=parseConfig(client,oldContent);
|
|
74
|
+
const current=data.mcpServers?.[ENTRY];
|
|
75
|
+
if(current===undefined) return {changed:false,content:oldContent,reason:'not installed'};
|
|
76
|
+
if(!ours(current)) throw new Error('Existing '+client+' entry does not appear to belong to Zaza Lens; refusing to remove it.');
|
|
77
|
+
delete data.mcpServers[ENTRY];
|
|
78
|
+
return {changed:true,content:JSON.stringify(data,null,2)+'\n'};
|
|
79
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zazalens-mcp",
|
|
3
|
-
"version": "1.
|
|
4
|
-
"description": "Local-first Zaza Lens MCP with
|
|
3
|
+
"version": "1.5.0",
|
|
4
|
+
"description": "Local-first Zaza Lens MCP with safe installers for Codex, Claude Desktop, Gemini CLI, Cursor, Copilot and Windsurf.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
7
|
"node": ">=22"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"repository": {
|
|
17
17
|
"type": "git",
|
|
18
|
-
"url": "https://github.com/89joshuaugwu/zazalens-mcp.git"
|
|
18
|
+
"url": "git+https://github.com/89joshuaugwu/zazalens-mcp.git"
|
|
19
19
|
},
|
|
20
20
|
"bin": {
|
|
21
21
|
"zazalens-mcp": "bin/cli.mjs"
|
|
@@ -40,7 +40,11 @@
|
|
|
40
40
|
"unicode",
|
|
41
41
|
"image-metadata",
|
|
42
42
|
"codex",
|
|
43
|
-
"claude"
|
|
43
|
+
"claude",
|
|
44
|
+
"gemini-cli",
|
|
45
|
+
"cursor",
|
|
46
|
+
"github-copilot",
|
|
47
|
+
"windsurf"
|
|
44
48
|
],
|
|
45
49
|
"license": "MIT",
|
|
46
50
|
"homepage": "https://zazalens.vercel.app/connect",
|