@maskera/mcp 0.4.8 → 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 CHANGED
@@ -4,8 +4,8 @@ Local Swedish PII redaction for any AI agent or LLM client:
4
4
 
5
5
  1. **One-command proxy wrapper (`maskera-mcp wrap -- <cmd>`)**: starts a local loopback proxy on a free port, verifies zero leaks automatically, injects `ANTHROPIC_BASE_URL`, `OPENAI_BASE_URL`, `MASKERA_PROXY_URL`, and `MASKERA_MCP_URL` into your CLI (`claude`, `codex`, `opencode`, scripts), and prints a session receipt when the command exits.
6
6
  2. **Local LLM proxy + Streamable HTTP MCP (`maskera-mcp proxy` / `maskera-mcp service install`)**: sits between any client that accepts a custom API URL (Claude Code, Codex with an API key, Cursor, OpenCode, Claude Desktop via third-party inference, Python/JS SDKs) and Anthropic/OpenAI, redacts outgoing prompts and tool results locally on-device, and transparently restores placeholders in both JSON and SSE streaming responses. The same warm process also exposes Streamable HTTP MCP at `http://127.0.0.1:8787/mcp` and a live inspector with a built-in self-test button at `/_maskera`. Install it as a persistent local background service (`launchd` on macOS, `systemd --user` on Linux) with `maskera-mcp service install`.
7
- 3. **MCP stdio server (`maskera-mcp`)**: exposes `maskera_read_file`, `maskera_write_file`, `maskera_list_files`, `maskera_search_files`, `maskera_redact`, `maskera_restore`, `maskera_list_sessions`, `maskera_clear_session`, `maskera_status` (plus `maskera_resume` in browser approval mode), along with built-in MCP `prompts` and `resources` (`maskera://skills/maskera/SKILL.md`) over JSON-RPC 2.0 stdio or Streamable HTTP.
8
- 4. **Hook / pipe guard (`maskera-mcp guard`)**: blocks PII in Claude Code / Cursor hooks or Unix pipelines (`exit 2`, never echoes raw PII) or redacts streams via `--redact`.
7
+ 3. **MCP stdio server (`maskera-mcp`)**: exposes `maskera_read_file`, `maskera_redact_file`, `maskera_write_file`, `maskera_list_files`, `maskera_search_files`, `maskera_redact`, `maskera_restore`, `maskera_list_sessions`, `maskera_clear_session`, `maskera_status` (plus `maskera_resume` in browser approval mode), with local PDF, DOCX, XLSX, and UTF-8 text support, along with built-in MCP `prompts` and `resources` (`maskera://skills/maskera/SKILL.md`) over JSON-RPC 2.0 stdio or Streamable HTTP.
8
+ 4. **File redaction & hook / pipe guard (`maskera-mcp redact` / `maskera-mcp guard`)**: redact local PDF, DOCX, XLSX, and text files on disk (burning PDF pixels and stripping metadata/hyperlinks), or block/redact PII in Claude Code / Cursor hooks and Unix pipelines (`exit 2`, never echoes raw PII; supports `--file <path>` and `--redact`).
9
9
  5. **Client installer and diagnostics (`maskera-mcp install` / `maskera-mcp doctor`)**: auto-detects or configures clients (`--apply`, `--project`, `--with-hook`), runs an automatic Swedish PII self-test + live `/mcp` probe, and prints (or saves via `--receipt <file.json>`) a zero-PII setup receipt (`maskera-setup-receipt/v1`).
10
10
 
11
11
  All redaction runs 100% locally using `maskera` (deterministic Swedish rules + the open Swedish ONNX NER model `joelhagvall/maskera-sv-ner`, about 59 MB in the default q8 build on Node, 43 MB in q4).
@@ -111,8 +111,9 @@ Or configure stdio manually:
111
111
 
112
112
  Tools (all declare `inputSchema`, `outputSchema`, and MCP tool `annotations`):
113
113
  - `maskera_list_files`: List files inside allowed workspace roots without reading contents.
114
- - `maskera_search_files`: Search UTF-8 files locally and redact every matched line before returning (supports searching by an existing placeholder like `[NAMN_1]`).
115
- - `maskera_read_file`: Read a local UTF-8 file already redacted, storing the restore map locally under `session_id`.
114
+ - `maskera_search_files`: Search UTF-8, PDF, DOCX, and XLSX files locally and redact every matched line before returning (supports searching by an existing placeholder like `[NAMN_1]`).
115
+ - `maskera_read_file`: Read a local UTF-8, PDF, DOCX, or XLSX file already redacted, storing the restore map locally under `session_id`.
116
+ - `maskera_redact_file`: Produce a truly redacted copy of a local PDF (burned pixels + stripped metadata), DOCX, XLSX, or text file on disk without exposing raw PII to the LLM.
116
117
  - `maskera_write_file`: Restore placeholders from `session_id` and write directly to disk without exposing raw PII back to the LLM. Without `session_id` it uses the latest session that knows every placeholder in the text, and refuses when several sessions would restore it differently.
117
118
  - `maskera_redact`: Redact text locally (`mode: "auto"` or `"rules"`, `profile: "general" | "clinical"`, `custom_terms`).
118
119
  - `maskera_restore`: Restore placeholders using `session_id` or an explicit map (hidden and blocked under `--no-raw-restore`, or gated under `--approval-mode browser|native`).
@@ -137,6 +138,10 @@ echo '{"prompt":"Ring 070-174 06 58"}' | npx -y @maskera/mcp guard
137
138
 
138
139
  # Redact any pipe locally (pass --no-proxy to force in-process execution)
139
140
  cat klient.txt | npx -y @maskera/mcp guard --redact
141
+
142
+ # Redact a local PDF, DOCX, XLSX, or text file on disk (burns PDF pixels + scrubs metadata)
143
+ npx -y @maskera/mcp redact journal.pdf -o journal.masked.pdf
144
+ npx -y @maskera/mcp guard --file journal.pdf
140
145
  ```
141
146
 
142
147
  ## 4. Agent skill (`SKILL.md`)