# Troubleshooting and boundaries

> Resolve common issues with @maskera/mcp and maskera: 502 fail-closed, Codex with ChatGPT login, offline models, loopback protection, and known boundaries.
>
> Canonical: https://maskera.dev/en/docs/troubleshooting (en) · sv: https://maskera.dev/docs/felsokning · Markdown: https://maskera.dev/en/docs/troubleshooting.md · Overview for agents: https://maskera.dev/llms.txt

Common issues, why Maskera blocks rather than silently forwarding unredacted text, and where local masking stops.

[Overview](https://maskera.dev/en/docs) · [@maskera/mcp](https://maskera.dev/en/docs/mcp) · [Client guides](https://maskera.dev/en/docs/clients) · [SDK & operations](https://maskera.dev/en/docs/sdk) · [Troubleshooting](https://maskera.dev/en/docs/troubleshooting)

First step when debugging

Run npx -y @maskera/mcp doctor \--root . to see which layer failed (Node version, directory access, ONNX model, or local proxy).

## Common errors and fixes

| Symptom | Cause | Fix |
| --- | --- | --- |
| Proxy returns 502 | Local NER failed to run or the upstream API is unreachable. | Check stderr or run doctor. If you only want deterministic rules, pass \--rules-only. |
| Codex with ChatGPT login rejects [http://127.0.0.1:8787](http://127.0.0.1:8787) | ChatGPT sign-in requires HTTPS for a custom base URL. | Use the MCP server (codex mcp add maskera -- npx -y @maskera/mcp \--root .) instead of the proxy. |
| Claude Desktop gets 401 from Anthropic | Auth scheme is still set to Bearer. | Switch auth scheme to x-api-key and verify base URL is [http://127.0.0.1:8787](http://127.0.0.1:8787) without /v1. |
| HTTP 403 on /\_maskera or /mcp | Host or Origin header does not match the loopback listener. | Always open [http://127.0.0.1:8787/\_maskera](http://127.0.0.1:8787/_maskera) directly and call /mcp without a foreign Origin header. |
| Access denied on maskera\_read\_file | The path or a symlink points outside \--root. | Start with the right \--root <dir> (repeatable for multiple folders). |
| maskera\_restore is missing or rejected | The server runs with \--no-raw-restore or ?no\_raw\_restore=1. | Use maskera\_write\_file to restore directly to disk, or \--approval-mode browser. |

## Running completely offline

When your workstation or server cannot reach Hugging Face, place the model directory on local disk and disable remote fetches.

Terminal

```
# Install the package and download the model once, pinned to the published revision
npm install -g @maskera/mcp
hf download joelhagvall/maskera-sv-ner onnx/model_q4.onnx config.json \
  tokenizer.json tokenizer_config.json special_tokens_map.json \
  --revision e0d5d017383c2732c5cc3c962fd1afdd73bb8035 \
  --local-dir /opt/models/maskera-sv-ner-v24

# Then run with no network access
MASKERA_MODEL_PATH=/opt/models \
MASKERA_MODEL_ID=maskera-sv-ner-v24 \
MASKERA_ALLOW_REMOTE_MODELS=0 \
maskera-mcp doctor --root .
```

## Limitations

- Maskera is built for Swedish (and mixed Swedish/English) text. Other languages are only partially covered.
- Images and scanned PDFs must be converted to text via OCR before passing through Maskera.
- A neural model can miss unusual names or typos (see measured numbers on [/en/accuracy](https://maskera.dev/en/accuracy)). Add known client names and case IDs via \--custom-term.
- A skill guides agent behaviour but can be bypassed if the agent has unrestricted shell tools. Hard enforcement requires the local proxy or restricting file access to Maskera MCP.

## Read next

- [Overview →Pick a mode and check that masking works.](https://maskera.dev/en/docs)
- [@maskera/mcp →Proxy, MCP server and hook for AI agents.](https://maskera.dev/en/docs/mcp)
- [Client guides →Ready-made steps for Claude, Codex, Cursor and more.](https://maskera.dev/en/docs/clients)
- [SDK & operations →Masking in your own TypeScript and JavaScript code.](https://maskera.dev/en/docs/sdk)

- [Agent setup prompt (setup-prompt.md)](https://maskera.dev/setup-prompt.md)
- [Machine-readable index (llms.txt)](https://maskera.dev/llms.txt)
- [@maskera/mcp on npm](https://www.npmjs.com/package/@maskera/mcp)
- [maskera on npm](https://www.npmjs.com/package/maskera)
- [Source code on GitHub](https://github.com/joelhagvall/maskera)
- [Model on Hugging Face](https://huggingface.co/joelhagvall/maskera-sv-ner)

Product

- [Products](https://maskera.dev/en/services)
- [Documentation](https://maskera.dev/en/docs)
- [Industries](https://maskera.dev/en/industries)
- [Accuracy](https://maskera.dev/en/accuracy)
- [Customer portal](https://app.maskera.dev/en/login?utm_source=maskera_dev&utm_medium=referral&utm_content=footer_portal)

Trust

- [Security](https://maskera.dev/en/security)
- [Privacy & transparency](https://maskera.dev/en/privacy)
- [FAQ](https://maskera.dev/en/faq)
- [Privacy policy](https://maskera.dev/en/privacy-policy)
- [Test data](https://maskera.dev/en/test-data)

Project

- [Open source](https://github.com/joelhagvall/maskera)
- [Custom-trained Swedish AI model](https://huggingface.co/joelhagvall/maskera-sv-ner)
- [White paper (PDF)](https://maskera.dev/whitepaper.pdf)
- [About & contact](https://maskera.dev/en/about)

A product of [Hägvall Labs AB](https://hagvall-labs.com).
