Strac MCP DLP

io.github.strac-io由 GitHub 帳號 strac-io 發布v0.1.1更新於 Oct 24, 2026

Detect and redact PII, PHI, PCI and secrets in text and files before an AI agent sees them.

已驗證STDIO僅桌面檔案與儲存安全與監控

概覽

AI 產生的概覽

Strac MCP DLP 讓 AI 助理在文字與本機檔案進入模型之前,偵測並遮蔽 PII、PHI、支付資料與金鑰。

可以做什麼
  • 對文字進行遮蔽或掃描,回傳淨化後的字串或偵測到的類型與位置清單
  • 透過 OCR 與分類器掃描本機檔案,例如圖片、PDF、掃描件、設定檔與原始碼
  • 將本機檔案的遮蔽副本寫入磁碟,不會更動原始檔案
  • 為獲授權的呼叫端把 Strac 保管庫權杖還原成原始值
  • 可選擇遮蔽樣式:佔位符、遮罩、清空或保管庫連結
適用情境
適合助理需要處理不可信或使用者提供的內容(工單、信箱、CRM 紀錄、文件)時,在內容進入提示詞、日誌或下游系統之前先移除或標記敏感值。
執行需求
以 Python 套件形式在本機透過 stdio 執行(pip install strac-mcp-dlp),也可加上傳輸參數以 HTTP 服務方式執行。需要 Strac 帳號與 STRAC_API_KEY 環境變數,金鑰前綴為 sk_live_ 或 sk_test_。可選 STRAC_API_BASE 與 STRAC_API_TIMEOUT。需要連線至 Strac API 的對外 HTTPS 網路。
安裝前請注意
文字與檔案會傳送到 Strac API 進行分類,本機不做任何分類;較大的檔案以及傳給 redact_file 的內容會上傳到你的 Strac 文件保管庫。請勿把 STRAC_API_KEY 提交到版本控制,sk_live_ 金鑰屬於伺服器端憑證。redact_file 會寫出新檔案,只有在開啟 overwrite 時才會覆蓋既有的目標檔案。include_matched_text 會回傳原始敏感值,預設為關閉。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Strac MCP DLP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

Strac MCP DLP — PII/PHI/PCI & secret redaction for AI agents (MCP)

An open-source Model Context Protocol server that gives any AI agent — Claude, Cursor, VS Code, your own — a way to find and strip sensitive data before it reaches the model.

[Claude, OpenAI, Gemini and Copilot connecting through Strac to Slack, Google Workspace, Microsoft 365, Jira, GitHub, Salesforce, Box, Dropbox and more]

Point your agent at it, and redact_text turns

Please onboard the user with SSN 123-45-6789 and email [email protected]

into

Please onboard the user with SSN [REDACTED] and email [REDACTED]

...along with a structured list of what was found. It works the same on images, PDFs and scanned documents.

This is a thin client over the Strac DLP API. Bring your own API key; all detection and redaction happens server-side at Strac.


Why

Agents are now wired into inboxes, ticketing systems, CRMs, databases and file stores. Every MCP tool call is a chance for an SSN, a card number, a patient record or an AWS key to be pulled into a prompt — and from there into a model provider's logs, a vector store, a Slack summary or a support ticket.

Filtering that data after the model has seen it is too late. This server puts the check in front of the model: detect first, redact, then let the agent reason over text that no longer carries the sensitive values.


This server is one door into Strac

Redacting a string you hand it is the smallest thing Strac does. The product is coverage: connect Strac to the SaaS and cloud apps where your sensitive data already lives, and it discovers, classifies, redacts and remediates it there — continuously, under your policies, with an audit trail — rather than waiting for someone to paste it into a prompt.

Slack, Google Workspace, Microsoft 365, Salesforce, Zendesk, Box, Dropbox, Jira, Confluence, GitHub, Notion, OneDrive, SharePoint, Snowflake, Databricks, BigQuery, Postgres, MongoDB, AWS, Azure, GCP, browsers and endpoints — 60+ integrations, agentless, no code to write.

That matters most when those systems are reached over MCP. When an agent — Claude Code, Claude Desktop, Cursor, GitHub Copilot, OpenAI Codex — pulls a Salesforce record or a Drive file through an MCP connector, Strac redacts the sensitive data inline, before the agent receives it. That is the difference between asking an agent to redact and enforcing it whether or not it asks.

strac.io/mcp-integrations is that product. This repo is its developer-facing sliver: the same detection engine, reachable from any MCP client, for when you want to sanitise a string or a file yourself.

[Strac MCP risk console showing every LLM tool invocation across connected platforms, with PII events flagged for review]

Every MCP invocation your agents make — tools called, files read, the identity behind the prompt — captured and inspected.


60-second quickstart

1. Install

bash
pip install strac-mcp-dlp

2. Request an API key

Request a key, or email [email protected].

Keys are prefixed sk_live_ (production) or sk_test_ (sandbox); the server picks the matching endpoint automatically.

3. Add it to your MCP client

Claude Desktop — ~/Library/Application Support/Claude/claude_desktop_config.json on macOS, %APPDATA%\Claude\claude_desktop_config.json on Windows:

json
{  "mcpServers": {    "strac-dlp": {      "command": "strac-mcp-dlp",      "env": {        "STRAC_API_KEY": "sk_live_your_key_here"      }    }  }}

Claude Code:

bash
claude mcp add strac-dlp --env STRAC_API_KEY=sk_live_your_key_here -- strac-mcp-dlp

Cursor — .cursor/mcp.json in your project, or ~/.cursor/mcp.json globally: use the same block as Claude Desktop.

4. Restart your client and ask it to redact something

Use Strac to redact this before I paste it into the ticket: "Customer Jane Doe, SSN 123-45-6789, card 4111 1111 1111 1111."

No install at all, if you have uv:

json
{  "mcpServers": {    "strac-dlp": {      "command": "uvx",      "args": ["strac-mcp-dlp"],      "env": { "STRAC_API_KEY": "sk_live_your_key_here" }    }  }}

See examples/ for ready-to-copy config files.


Tools

  • redact_text

    • Redact PII, PHI, PCI and secrets out of a block of text, returning the sanitised string plus what was found
    • Inputs:
      • text (string): the text to redact
      • redact_field_mode (string, optional): REDACTED (default), BLANK, MASK_SEVEN_X or TOKEN_LINK_PLAINTEXT
      • include_matched_text (boolean, optional): also return the raw sensitive values. Off by default
    • Call it before putting untrusted or user-supplied text into a prompt, a log line, a ticket or any downstream system
    • redact_text(text="SSN 123-45-6789") → "SSN [REDACTED]"
  • detect_sensitive_data

    • Report which sensitive data types are present in text, without changing it
    • Inputs:
      • text (string): the text to scan
      • include_matched_text (boolean, optional): also return the raw values. Off by default
    • Use it to decide whether text is safe to send onward
    • detect_sensitive_data(text="call me at [email protected]") → EMAIL
  • detect_file

    • Scan a local file — image, PDF, scan, config or source — using Strac OCR and classifiers
    • Inputs:
      • path (string): path to the file to scan
      • include_matched_text (boolean, optional): also return the raw values. Off by default
    • The file is never modified
    • detect_file(path="./w2.pdf") → TAX_ID_NUMBER, NAME, ADDRESS
  • redact_file

    • Write a redacted copy of a local file to disk
    • Inputs:
      • path (string): path to the file to redact
      • output_path (string, optional): where to write the copy. Defaults to a .redacted suffix beside the original. Pointing it at the source is refused
      • overwrite (boolean, optional): allow replacing an existing destination. Off by default
    • The original is never modified
    • redact_file(path="./w2.pdf") → ./w2.redacted.pdf
  • detokenize

    • Resolve Strac vault tokens (tkn_…) back to their original values, for authorised callers
    • Inputs:
      • token_ids (string[]): the token identifiers to resolve. Maximum 10 per call
    • Requires an IP-allowlisted server-to-server key in live mode
    • detokenize(token_ids=["tkn_abc"]) → "111-22-3333"

Redaction styles

redact_text takes a redact_field_mode:

ModeResult
REDACTED (default)[REDACTED]
MASK_SEVEN_XXXXXXXX
BLANKremoved entirely
TOKEN_LINK_PLAINTEXT<sensitive_data: https://…/detokenize/tkn_…> — a link to the value in the Strac vault, so an authorised human can still retrieve it

Redaction that doesn't leak

By default these tools return the types and positions of what they found, not the values:

json
{  "redacted_text": "Please onboard the user with SSN [REDACTED]",  "detection_count": 1,  "data_element_types": ["TAX_ID_NUMBER"],  "detections": [{ "type": "TAX_ID_NUMBER", "begin_index": 33, "end_index": 44, "length": 11 }]}

Returning the matched text alongside the redacted text would hand the model exactly the data you just removed. Pass include_matched_text=true when a caller genuinely needs the raw values.


What gets detected

Strac ships 191 built-in data elements across 10 categories, plus custom elements you define with regex or your own trained model:

CategoryElementsExamples
Identification126SSN/TIN, passports, driver licences and national IDs across ~60 countries — Aadhaar, PAN, PESEL, BSN, Fiscal Code, IRD — plus NPI and DEA registration numbers
Secrets30AWS access and secret keys, GitHub and GitLab tokens, Slack tokens, GCP credentials, Azure storage and service-principal keys, private keys, JDBC and MongoDB connection strings, seed phrases
Financial Account10Card number and tail, CVV, expiry, bank account and routing numbers, IBAN, SWIFT
Advertisement Identifiers7Apple IDFA and IDFV, Google GAID, Roku, Amazon Fire OS, Huawei OAID
Contact6Name, address, email, phone, date of birth, age
Device Tracking5IP address, MAC address, IMEI, webpage URL, date/time
Asset3Source code, VIN, vehicle licence plate
Document Properties2Invoice, password-protected document
Content Moderation1Offensive content
Intellectual Property1Chemical/molecular structure

Every element named individually: Strac Catalog of Sensitive Data Elements.

Detection runs on text and, via OCR, on PDFs, JPEGs, PNGs, DOCX, XLSX, screenshots and .msg email files — which is what detect_file and redact_file reach.

One caveat worth setting expectations on: the type values these MCP tools return depend on which endpoint answered, and the two use different vocabularies for the same element. A US Social Security Number comes back as TAX_ID_NUMBER from redact_text and as SOCIAL_SECURITY_NUMBER from detect_sensitive_data — which additionally reports SSN under reported_element_types. Both vocabularies are surfaced as returned rather than normalised, so nothing is invented on your behalf. Which elements are detected at all depends on what is enabled for your account; the full catalog above is what runs across your connected apps, where policies, remediation and audit live.


Configuration

VariableRequiredDefault
STRAC_API_KEYyes—
STRAC_API_BASEnohttps://api.live.tokenidvault.com for sk_live_ keys, https://api.test.tokenidvault.com for sk_test_ keys
STRAC_API_TIMEOUTno60 seconds

Without a key, every tool returns: Set STRAC_API_KEY — request one at https://www.strac.io/mcp-integrations.

The server speaks stdio by default. strac-mcp-dlp --transport streamable-http serves HTTP instead.


How it works

Your MCP client spawns this server locally; it forwards each tool call to the Strac API over HTTPS with your X-Api-Key, and returns the result. Nothing is classified or redacted on your machine, and this repository contains no detection models.

Your data element definitions, custom policies, remediation rules and audit trail live in your Strac account, not in this repo — which is why the same key that powers these five tools also governs every connected app.

MCP client  ──stdio──▶  strac-mcp-dlp  ──HTTPS──▶  Strac DLP API(Claude, Cursor,        (this repo,                 (classifiers, OCR, your agent)             ~600 lines)                 vault, policies, audit)

Limits inherited from the API: 4 MB for inline content, 10 MB for document uploads, 10 tokens per detokenize call.


Development

bash
git clone https://github.com/strac-io/strac-mcp-dlpcd strac-mcp-dlppython3 -m venv .venv.venv/bin/pip install -e ".[dev]".venv/bin/python -m pytest

The test suite mocks the Strac API with respx, so it runs without a key. To try the server by hand:

bash
STRAC_API_KEY=sk_test_… .venv/bin/python -m strac_mcp_dlp

Or point the MCP Inspector at it:

bash
STRAC_API_KEY=sk_test_… npx @modelcontextprotocol/inspector strac-mcp-dlp

FAQ

Do I need a Strac account?

Yes. This is a thin client over the Strac DLP API and every call is authenticated — there is no anonymous mode. Request a key at strac.io/mcp-integrations or email [email protected].

Does my data stay on my machine?

No. Text and files you pass to these tools are sent to the Strac API over HTTPS for classification. Nothing is classified locally — this repository contains no detection models, no classifier and no vault. detect_file sends files under 4 MB inline without storing them; larger files, and anything passed to redact_file, are uploaded to your Strac document vault.

Which MCP clients does it work with?

Any client that speaks stdio — Claude Desktop, Claude Code, Cursor, VS Code and others. --transport streamable-http is available if you need to run it as a service rather than a subprocess.

Does it detect secrets, or only PII?

Both. Alongside personal, health and payment data, Strac classifies AWS access and secret keys, GitHub and GitLab tokens, Slack tokens, GCP credentials, Azure storage and service-principal keys, private keys, and JDBC and MongoDB connection strings. See the full catalog.

Why doesn't redact_text return the values it found?

Because handing them back would undo the redaction. If the tool returned "123-45-6789" in its detections alongside the redacted string, the model would end up with exactly the data you just removed. You get types and positions by default; pass include_matched_text=true when a caller genuinely needs the raw values.

Will redact_file modify my original?

No. It writes a copy, refuses an output_path that resolves to the source file (including via symlink), and will not replace an existing file unless you pass overwrite=true.

What happens if the Strac API returns something unexpected?

The tool errors. It never reports a clean scan it could not verify — a malformed or unparseable response raises rather than returning "no sensitive data found", because a silent false negative is the one failure a DLP tool cannot have.

How is this different from the Strac platform?

This repo is on-demand tooling your agent chooses to call. The platform sits across your SaaS, cloud and database connectors and enforces policy whether or not the agent asks — redacting inline before the agent receives the data, with remediation and an audit trail. See strac.io/mcp-integrations.


Links

Security

Never commit an API key. sk_live_ keys are server-side credentials; keep them in your MCP client's env block or your secret manager, not in source control. To report a vulnerability, email [email protected].

License

MIT — see LICENSE.

來源:README.md,提交 75b97ca

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.1.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分