securedact-mcp
The Securedact MCP server is a local-first privacy layer for AI workflows. You can:
Analyze text (
analyze_text): Detect and classify sensitive data (PII, identifiers, contextual info) locally, without external transmission.Redact text (
redact_text): Replace detected sensitive values with stable typed placeholders (e.g.,[EMAIL_1]) according to a named privacy policy, returning anok/review_required/blockedstatus and a mapping for later restoration.Restore text (
restore_text): Reverse redaction by substituting placeholders with original values using a caller-supplied mapping.Create safe copy (
create_safe_copy): Write sanitized content to a.txtor.mdfile in a pre-configured safe directory (SECUREDACT_SAFE_COPY_DIR), preventing overwrites.Manage contextual models: Install, verify, update, or remove English/Dutch Flair models from Hugging Face for offline, local operation.
Fail-closed operation: The system fails closed if required contextual capability is unavailable, and can be configured to permit deterministic/rule-based mode.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@securedact-mcpRedact any sensitive data from this text."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Securedact MCP
Securedact MCP is an Apache-2.0 local MCP server and reusable Python privacy engine. It detects sensitive text, applies versioned policies, redacts locally, and validates residual output before marking sanitized content approved.
MCP mode does not automatically intercept every prompt. The host must invoke the tool and send only
sanitized_textwhenstatus == "ok"; a misconfigured or malicious MCP host can bypass that ordinary MCP workflow. Provider-native enforced hooks are separate integration assets: when a supported provider invokes such a hook at its prompt lifecycle boundary, it can apply the same deterministic decision before normal model processing. See SecuRedact Enforced.
Safe default workflow
Use prepare_for_external_ai for normal external-AI preparation:
{
"text": "Contact alex@example.test",
"policy": "strict_external_ai",
"language": "auto",
"response_mode": "minimal"
}Approved response:
{
"schema_version": "1",
"status": "ok",
"sanitized_text": "Contact [EMAIL_1]",
"counts": {"email": 1},
"policy": "strict_external_ai",
"policy_version": 1,
"policy_digest": "...",
"reason_codes": []
}review_required and blocked responses never contain approved
sanitized_text. Minimal responses contain no original text, raw entity values,
mapping, exception body, stack trace, model path, or restoration handle unless
restore_capable was explicitly selected.
Related MCP server: Security Guard MCP
Architecture and trust boundary
flowchart LR
H["MCP host"] --> M["Securedact MCP"]
M --> D["deterministic detectors"]
M --> C["contextual detectors"]
D --> P["policy engine"]
C --> P
P --> R["redactor"]
R --> V["residual validator"]
V --> O["approved sanitized output"]
O --> W["host-controlled downstream workflow"]
H -. "host may bypass MCP" .-> WThe server has no provider clients, OpenAI-compatible proxy, reverse proxy, website, desktop chatbot, provider credentials, or provider-specific forwarding. See ADR 0001 and the threat model.
Tools
Tool | Intended use | Sensitive-response behavior |
| Recommended complete safe workflow | Minimal by default |
| Lower-level local analysis/review | Minimal; offsets in |
| Lower-level compatibility operation | Minimal by default; explicit |
| Consume a local opaque session | Single-use by default; direct mappings require explicit trusted legacy mode |
| Write approved | Returns no mapping or absolute path |
Response modes are minimal, review, debug, and restore_capable. Debug is
disabled unless the process was started with
SECUREDACT_ENABLE_DEBUG_RESPONSES=1; an MCP request cannot enable it. In-memory
restoration sessions use cryptographic random handles, bounded capacity,
expiration, concurrency protection, and single-use consumption. Process exit
destroys all sessions.
See MCP tools, response privacy, and restoration sessions.
Installation
Python >=3.12,<3.13 is supported.
For a normal installation from PyPI:
py -3.12 -m pip install "securedact-mcp[ml]"
securedact-mcp setupOn Linux or macOS, use python3.12 -m pip install "securedact-mcp[ml]";
python -m pip install "securedact-mcp[ml]" is also appropriate when python
already selects a supported 3.12 environment.
setup checks the package, Python and ML dependencies, inspects local model
state, offers the existing consent-based model installer, runs the existing
offline verifier, and offers the packaged Claude Code and Gemini CLI
integrations when those hosts are detected. It uses the providers' official
plugin/extension commands and is safe to rerun. It does not call a provider
model API, accept provider trust automatically, or download a contextual model
unless the user explicitly selects model setup and accepts the existing
upstream prompt.
Manual model commands remain available for advanced or unattended operation:
securedact-mcp install
securedact-mcp models verify
securedact-mcpThe last command starts a local stdio server. Standard output is reserved for
MCP protocol messages. securedact-mcp setup --non-interactive reports state
without implying upstream acceptance or configuring a new provider. Use
--host claude, --host gemini, or --host all for targeted interactive
provider setup.
Developer/source installation
To work from a reviewed source checkout instead:
git clone https://github.com/GigantesHJI/securedact-mcp.git
cd securedact-mcp
python -m pip install ".[ml]"
securedact-mcp setupNo model checkpoint is included in the repository or wheel, and startup never downloads one. Securedact does not redistribute these model weights. Upstream model weights retain their own licenses and are not relicensed by Apache-2.0. See model installation and third-party licenses.
Deterministic-only local development must be explicitly selected:
$env:SECUREDACT_REQUIRE_FLAIR = "0"
securedact-mcpProduction defaults to requiring contextual capability and fails closed while a configured model is missing, loading, corrupt, or unavailable.
Host packages
Tested configuration assets and safe-workflow instructions are under
integrations/ for Codex, Cursor, and Windsurf. The automated MCP client harness
validates server startup, tool listing, calls, minimal response shape, stdout
integrity, and shutdown. It does not prove that a real host invokes the tool for
every prompt. See the compatibility evidence.
Policies and Python API
Built-ins include default, strict_external_ai, gdpr, identifiers_only,
and review_all_contextual; compatibility policies remain available. Local
organization policy files load only from the controlled policy directory, use a
strict declarative schema, and cannot disable fail-closed invariants. Unknown,
duplicate, oversized, malformed, or symlinked policies fail closed.
from securedact_core import RedactionRequest, SecuredactEngine
engine = SecuredactEngine.from_environment()
result = engine.prepare(
RedactionRequest(
text="Contact alex@example.test",
policy="strict_external_ai",
)
)from_environment() preserves the contextual-model requirement. Standalone
deterministic development requires SECUREDACT_REQUIRE_FLAIR=0; applications may
also inject tested detector implementations. See public API
and policies.
Reproducible development
The committed uv.lock resolves runtime, ML, development, benchmark, and
security extras for Python 3.12.
uv sync --frozen --extra dev --extra benchmark
uv run python scripts\verify.pyNever use real personal information, private documents, credentials, customer logs, or model weights in tests, issues, screenshots, fixtures, or pull requests. See CONTRIBUTING.md.
Evaluation and performance
uv run python -m securedact_eval quality --mode deterministic --gate `
--thresholds benchmarks\thresholds.json `
--baseline benchmarks\baselines\quality-deterministic.json
uv run python -m securedact_eval performance --mode deterministicThe versioned synthetic corpus reports exact and relaxed span precision, recall, F1, false-positive and false-negative rates, per-entity/language/domain/split results, action/category accuracy, and bootstrap recall intervals. True negatives are document-level negative examples, not token-level safety. The GDPR-related suite is detection evaluation, not legal compliance certification. Real Flair and GPU benchmarks require an explicitly configured local model and are not ordinary CI. See benchmarking. The benchmark framework documents local data tiers and large profiles; the migration plan defines its future extraction boundary. For a failure before GitHub executes repository steps, use the CI troubleshooting decision tree. Local success does not replace a required GitHub check.
Security and limitations
No prompt, finding, mapping, restoration handle, secret, model input, or restored output is logged by application code.
Deterministic and contextual detection can miss novel, ambiguous, or adversarial disclosure; coreference and universal obfuscation resistance are not claimed.
Review offsets let a trusted local client with the original input reconstruct a value; keep review responses local.
Host behavior and downstream provider behavior are outside the trust boundary.
Repository security settings documented in files still require administrator verification.
Report vulnerabilities privately using SECURITY.md. Do not put vulnerability details or real data in a public issue.
License
Original repository source and documentation are licensed under the Apache License 2.0. Copyright attribution is recorded in NOTICE. Third-party dependencies and model weights retain their own licenses.
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceAn MCP proxy that pseudo-anonymizes PII before data reaches external AI providers like Claude, ChatGPT, or Gemini.18MIT
- FlicenseNot gradedqualityBmaintenanceEnables secure interaction between LLMs and MCP tools by applying zero-trust security controls, including sensitive data masking, file system protection, and policy enforcement.
- AlicenseNot gradedqualityDmaintenanceA local, containerized MCP server that uses a local LLM to sanitize documents by removing or transforming PII before content is sent to public LLM services.MIT
- AlicenseAqualityAmaintenanceMCP server and CLI for detecting, redacting, and auditing PHI in medical text before it reaches AI agents.4MIT
Related MCP Connectors
Classify data safety before storing or sharing. GDPR, HIPAA, PCI-DSS, CCPA. AI-powered.
Security firewall for AI agents — scans MCP calls for injection, secrets, and risks.
Zero-config MCP security scanner for AI-generated apps. 25K+ vulnerability patterns.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/GigantesHJI/securedact-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server