# Securedact MCP [Health: Active]

**Category:** 🔒 Security  
**Repository:** https://github.com/GigantesHJI/securedact-mcp  
**GitHub Stars:** 3  
**Views:** 3  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/securedact-mcp

## Description
Local-first privacy MCP server for sensitive AI workflows

## Tools
Capabilities this server exposes over MCP:

- **prepare_for_external_ai** — Use this before sending user-supplied or potentially sensitive text to an external AI service.

SecuRedact inspects and sanitizes the text locally and returns the policy-approved
representation; this tool does not transmit the text externally. It is the recommended
default for outbound AI workflows. Use analyze_text for inspection-only classifications,
redact_text for the lower-level compatibility path, create_safe_copy when a sanitized file
is required, and restore_text only to reverse a prior local session in a trusted context.

Returns a JSON object with 'status' ('ok', 'review_required', or 'blocked'), 'sanitized_text'
(present only when approved), 'counts', 'policy', and optionally 'restoration_session'
(when response_mode is 'restore_capable').
- **analyze_text** — Inspect text locally and report detected sensitive content without producing sanitized output.

Use this when you need to understand what PII, secrets, or credentials are present (counts,
entity types, and, with review/debug modes, positions) but do not need redacted text for
transmission. The original text is not modified and no sanitized representation is returned.
For a policy-approved, ready-to-send result use prepare_for_external_ai; for a sanitized file
use create_safe_copy; for reversing a prior local session use restore_text.

Returns a JSON object with 'status' ('ok', 'review_required', or 'blocked'), 'policy',
'policy_version', 'policy_digest', 'counts' (entity-type tallies), and, when response_mode is
'review' or 'debug', a 'findings' list. 'debug' additionally returns 'debug_details'.
- **redact_text** — Direct/lower-level redaction entry point; prefer prepare_for_external_ai for normal outbound workflows.

In its normal modes this performs the same local sanitization as prepare_for_external_ai and
returns the approved result, so most agents should call prepare_for_external_ai instead. Use
redact_text when you specifically need this lower-level compatibility path, or the 'legacy'
mode for local review of raw redaction internals. The 'legacy' mode returns potentially
sensitive local-review details and is never selected by default.

Returns, for normal modes, the same approved result as prepare_for_external_ai (status,
sanitized_text, counts). For 'legacy' mode it returns a result with deprecation_code
'legacy_sensitive_response' containing local-review redaction data.
- **restore_text** — Reverse a prior SecuRedact protection step in a trusted, local-only context.

Use this ONLY after you previously received a restoration_session from SecuRedact (for example
from prepare_for_external_ai with response_mode 'restore_capable') and now need to reconstruct
the original text locally for trusted review. Restoration can reveal the original sensitive
values (PII, secrets, credentials); it is a trusted-local operation, not a step to prepare
data for external transmission. Never call it to sanitize or prepare text for an external AI;
for that use prepare_for_external_ai. Never call it on text you did not previously protect
with SecuRedact.

Security boundary: all processing is local and nothing leaves the machine. The 'mapping' form
requires trusted_local_review=true and exposes raw originals, so its output must never be
transmitted. Returns a JSON object with 'status' ('ok' or 'blocked'), 'restored_text'
(present only on success), and 'reason_codes' describing any failure.
- **create_safe_copy** — Sanitize text locally and write the approved result to a new file in the Safe Copies directory.

Use this when you need a sanitized on-disk copy (for storage, handoff, or archival) rather than
an in-memory sanitized string. For the sanitized text only, use prepare_for_external_ai; for
inspection-only use analyze_text; for reversing a prior session use restore_text.

Side effects: a new file is written to the directory set by SECUREDACT_SAFE_COPY_DIR. The
supplied 'content' is not modified and no existing file is overwritten. The filename must be a
bare '.txt' or '.md' basename (no path separators or directory traversal). The operation
blocks and reports 'blocked' if the directory is unconfigured, the filename is invalid, or
policy blocks the content.

Returns a JSON object with 'status' ('ok' or 'blocked'), 'filename', and 'counts'.
- **securedact_read_file** — Safely read a local file and return only its sanitized (PII/secrets removed) text.

Use this when you must ingest a local file's contents for use with an external AI but want
path-traversal, size, and binary defenses plus sanitization applied first. If the content is
already in memory, use prepare_for_external_ai; for a sanitized file on disk, use
create_safe_copy.

Side effects: reads a file from local disk and never transmits it. Sensitive paths and escapes
are blocked before any file content is read. The returned 'sanitized_text' is safe to forward.

Returns a JSON object with 'status' ('ok' or 'blocked'), 'path', and 'sanitized_text'
(present only when approved).

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "securedact-mcp": {
    "command": "uvx",
    "args": ["securedact-mcp"]
  }
}
```

## Documentation

## What the Securedact MCP MCP server does

The Securedact MCP MCP server provides a local privacy layer for AI workflows. It identifies personal data, GDPR-sensitive information, credentials, API keys, tokens, secrets, and other sensitive content, then evaluates that content against versioned policies. Approved results can be redacted, validated, and returned for downstream use.

The server also provides protected local-file access. Its file-reading tool checks paths before reading, rejects traversal and symlink escapes, blocks protected locations such as `.env`, and refuses binary files. A safe-copy tool can write approved text or Markdown beneath one configured root without returning a mapping or absolute path.

The project includes a HIPAA Safe Harbor mechanical de-identification aid with an 18-category mapping and US-specific identifier checks. This is a processing aid rather than a compliance certification or replacement for expert determination.

## How it works

The Securedact MCP MCP server accepts requests from an MCP host over a local stdio process. Detection may use deterministic detectors and contextual detectors, followed by policy evaluation, redaction, and residual-output validation. The normal workflow is `prepare_for_external_ai`: the host supplies text and a policy, then should forward only `sanitized_text` when the result status is `ok`.

Responses default to `minimal`. Review responses expose locations without raw values, while debug responses can include more sensitive details only when debugging has been enabled before process start. Restoration uses in-memory, opaque sessions with expiration, bounded capacity, concurrency protection, and single-use consumption by default. Sessions disappear when the process exits.

MCP mode is not an automatic prompt interceptor. A host can bypass the workflow or be configured incorrectly, so the server does not by itself guarantee that every prompt, tool call, or file leaves the environment sanitized.

## Setup and configuration

Install Python 3.12 and the package from PyPI:

```bash
python3.12 -m pip install "securedact-mcp[ml]"
securedact-mcp setup
```

The setup command checks the package, Python version, dependencies, and local model state. It can offer consent-based model installation and detected Claude Code or Gemini CLI integrations. Manual commands include `securedact-mcp install`, `securedact-mcp models verify`, and `securedact-mcp` to start the stdio server.

Set `SECUREDACT_ENABLE_DEBUG_RESPONSES=1` before starting the process to permit debug responses. An MCP request cannot enable debugging. Deterministic-only operation can be demonstrated by setting `SECUREDACT_REQUIRE_FLAIR=0`.

## Tools and capabilities

The Securedact MCP MCP server exposes:

- `prepare_for_external_ai` for the recommended complete preparation flow.
- `analyze_text` for lower-level local analysis and review.
- `redact_text` for lower-level redaction, with legacy mode deprecated.
- `restore_text` for consuming local restoration sessions.
- `create_safe_copy` for writing approved `.txt` or `.md` content.
- `securedact_read_file` for sanitized, guarded local-file reads.

## Limitations and notes

The server has no provider client, proxy, website, provider credential handling, or provider-specific forwarding. Local-first processing does not mean every leak is prevented. Sensitive legacy modes require explicit selection, and direct mappings require trusted legacy mode. Debug output should be treated as sensitive.

_Full upstream README: https://allmcps.com/mcp/securedact-mcp/readme_

