io.github.963239327/pasteshield-secret-sanitizer
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
PasteShield — Reversible AI Prompt & Clipboard Secret Sanitizer
Redact API keys, .env secrets, JWTs, database URIs, cloud connection strings & internal IPs before prompting ChatGPT, Claude, Cursor, or Copilot — and auto-unmask AI code replies in 1 hotkey (Cmd+Alt+V).
VS Code Marketplace → · Open VSX (Cursor / VSCodium) → · Live Playground → · CLI & MCP ↓ · PasteShield Pro ($9) ↓
Why Developers Use PasteShield Instead of ***REDACTED***
Every day, developers paste .env configs, Kubernetes manifests, crash logs, and curl traces into ChatGPT, Claude, DeepSeek, or Cursor. Manually replacing values with ***REDACTED*** breaks two things:
LLMs lose cross-variable identity (the model cannot tell if two
***strings are the same database host or two different tokens).Pasting the AI's refactored code back breaks your app until you manually hunt down and re-insert every secret.
PasteShield solves both in <1ms with zero cloud calls:
Maps each unique secret to a deterministic semantic token (
<OPENAI_KEY_1>,<DB_URI_1>,<GITHUB_TOKEN_1>,<INTERNAL_IP_1>).Identical secrets across multiple lines or files always map to the exact same placeholder so the LLM preserves variable relationships.
Restores your exact original secrets in 1 click (
Cmd+Alt+Rin VS Code / Cursor, orpasteshield restorein CLI) when you paste the AI's solution back.
Related MCP server: ctxbleach
Before & After Roundtrip Example
1. Raw Local Snippet (Stays on Your Machine)
# Production Checkout Service (.env)
OPENAI_API_KEY=sk-proj-EXAMPLE000000000000000000000001
GITHUB_DEPLOY_TOKEN=ghp_EXAMPLE00000000000000000000000001
DATABASE_URL="postgresql://svc_orders:Pr0dP4ss!@10.24.8.15:5432/orders_db"
ONCALL_EMAIL=secops@acme-fintech.example2. Sanitized Prompt Sent to ChatGPT / Claude / Cursor (Cmd+Alt+C)
# Production Checkout Service (.env)
OPENAI_API_KEY=<OPENAI_KEY_1>
GITHUB_DEPLOY_TOKEN=<GITHUB_TOKEN_1>
DATABASE_URL="<DB_URI_1>"
ONCALL_EMAIL=<EMAIL_1>3. AI Generates Refactored Code -> 1-Click Local Restore (Cmd+Alt+R)
// AI outputs placeholders -> PasteShield restores real credentials locally in <1ms:
export const checkoutEnv = {
openAiKey: "sk-proj-EXAMPLE000000000000000000000001",
databaseUrl: "postgresql://svc_orders:Pr0dP4ss!@10.24.8.15:5432/orders_db",
deployToken: "ghp_EXAMPLE00000000000000000000000001",
alertEmail: "secops@acme-fintech.example",
};4 Ways to Use PasteShield
Local MCP Server (Claude Desktop · Cursor · Windsurf · VS Code Copilot)
Run PasteShield as a zero-dependency local stdio MCP Server (sanitize_snippet, restore_snippet, audit_workspace_secrets) with zero npm signup required:
{
"mcpServers": {
"pasteshield": {
"command": "npx",
"args": ["-y", "github:963239327/pasteshield-secret-sanitizer", "--mcp"]
}
}
}Also installable in 1 click from the Official Visual Studio Marketplace and Verified Open VSX Registry (Cursor / Windsurf / VSCodium).
Option A: VS Code, Cursor, Windsurf & VSCodium Extension
Install directly from VS Code Marketplace or Open VSX Registry (
verifiedpublishercraftleaf-studio), or downloadpasteshield-ai-secret-sanitizer-1.2.0.vsixfrom GitHub Releases.In VS Code or Cursor, open the Command Palette (
Cmd+Shift+P/Ctrl+Shift+P) ->Extensions: Install from VSIX...-> select the.vsixfile (or runcode --install-extension pasteshield-ai-secret-sanitizer-1.2.0.vsix).Highlight any code/log and press:
Cmd+Alt+C(Ctrl+Alt+C) — Copy Sanitized Selection for AICmd+Alt+V(Ctrl+Alt+V) — Paste & Auto-Unmask AI Reply at CursorCmd+Alt+R(Ctrl+Alt+R) — Restore Original Values from Clipboard / SelectionCmd+Alt+S(Ctrl+Alt+S) — Sanitize Current Editor In-PlaceHover any
<CATEGORY_N>token — View safe masked preview (sk-p••••abcd) from local RAMTeam
.pasteshield.json+ Pre-Commit Gate — Runpasteshield init-policy --install-hookto enforce repo-level redaction rules across your team ($295-Seat Team Policy Pack /$9Solo Pro)
Option B: Instant Zero-Install Browser Playground
Need to scrub a crash log or .env snippet right now without installing anything?
👉 Open Live PasteShield Browser Playground (100% client-side JS, works offline after page load).
Option C: Quickstart CLI & JavaScript SDK (Node.js / Bun, 0 Dependencies)
git clone https://github.com/963239327/pasteshield-secret-sanitizer.git
cd pasteshield-secret-sanitizer
# Run interactive roundtrip demo in your terminal:
node bin/pasteshield-cli.js demo
# Sanitize clipboard on macOS before pasting into ChatGPT / Claude:
pbpaste | node bin/pasteshield-cli.js sanitize --vault .pasteshield-vault.json | pbcopy
# Restore real values into the AI's code reply on your clipboard:
pbpaste | node bin/pasteshield-cli.js restore --vault .pasteshield-vault.json | pbcopy
# Scan workspace or uncommitted `git diff` for accidental secret leaks:
node bin/pasteshield-cli.js scan --git-diffUse sanitizer-core.js directly as a zero-dependency CommonJS or browser module:
const PasteShieldCore = require('./sanitizer-core');
const vault = PasteShieldCore.createVault();
const { sanitizedText, totalRedactions } = vault.sanitize(process.env.RAW_LOG_SNIPPET || 'OPENAI_API_KEY=sk-proj-1234567890abcdefghijklm');
console.log(sanitizedText); // OPENAI_API_KEY=<OPENAI_KEY_1>
const { restoredText } = vault.restore(`export const key = "${sanitizedText.split('=')[1]}";`);10 Built-In Secret & PII Detectors (Free Forever)
Semantic Token | Detected Credentials & Formats |
| OpenAI ( |
| AWS IAM Access Key IDs ( |
| GitHub Classic PATs ( |
| 3-part signed JWTs ( |
| Azure Storage, Service Bus, Cosmos DB, IoT Hub & Azure SQL connection strings |
| PostgreSQL, MySQL, MariaDB, MongoDB, Redis, AMQP & ClickHouse URIs with embedded credentials |
| Multi-line PEM, RSA, EC, OpenSSH & PGP |
| RFC1918 ( |
| Internal & customer email addresses |
|
|
Free vs. PasteShield Pro Comparison
Feature | Free Community ( | PasteShield Pro ( | Studio All-Access ( |
10 Built-In Cloud, LLM, DB, JWT & PEM Detectors | ✅ | ✅ | ✅ |
1-Click Reversible Session Vault ( | ✅ | ✅ | ✅ |
Zero-Dependency Node/Bun CLI & Browser Playground | ✅ | ✅ | ✅ |
100% Offline Air-Gapped Execution (Zero Telemetry) | ✅ | ✅ | ✅ |
Custom Corporate Domain Redaction ( | — | ✅ | ✅ |
Custom Regex Rules (Jira/Linear IDs, Customer Keys, Proprietary Tokens) | — | ✅ | ✅ |
Multi-File Sanitized AI Markdown Context Pack Exporter | — | ✅ | ✅ |
Workspace & | — | ✅ | ✅ |
Also Unlocks 4 Sister CraftLeaf Pro Tools (CleanPrint, IDPhoto 4×6, Invoice CRM, CardSheet Duplex) | — | — | ✅ (Gumroad Master Key) |
👉 Get PasteShield Pro ($9 Lifetime Offline Key) · Get Studio All-Access Pass ($19 — Unlocks All 5 Tools)
More Privacy-First Tools by CraftLeaf Studio
All CraftLeaf tools run 100% client-side in your browser or local IDE with zero file uploads:
🖨️ CleanPrint & AI-Chat to PDF Extension — Strip clutter & dark backgrounds from ChatGPT/Claude/Docs and export eco low-ink vector PDFs.
🪪 Passport & Visa 4×6" ID Photo Sheet Maker — Biometric US/Schengen/UK/Canada/China visa photo cropper tiled onto a
$0.394×6" print sheet.🧾 No-Signup Freelancer Invoice PDF Studio — Instant multi-currency client invoices with local CRM memory & payment QR codes.
🗂️ CardSheet Duplex Flashcard & PnP Print Studio — Millimeter-accurate front/back duplex offset calibration for flashcards and tabletop cards.
🎲 Play Star Chef Showdown Free in Browser — Original 2-player rondel + blackjack-heat Print-and-Play board game with solo AI opponent.
License
MIT © CraftLeaf & Pixel Studio
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Scan prompts for injection attacks, redact PII, and audit LLM SDK usage from any MCP client
MCP server for detecting and redacting PII (Personally Identifiable Information) in PDF documents.
Security & DLP proxy for MCP: tool-poisoning scans, PII redaction on tool args/results. Beta.
MCP server for mandates, delegation, policy-gated execution, credential grants, and audit.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceLocal-first CLI and MCP server for redacting sensitive text before sharing logs, configs, and errors with AI tools.MIT
- AlicenseNot gradedqualityCmaintenanceLocal CLI and MCP server that redacts secrets from logs, files, and diffs before sending them to AI agents, with stable placeholders and token-budgeted truncation.MIT
- AlicenseAqualityCmaintenanceProvides a local-first MCP server for multi-format document redaction, enabling detection of sensitive content, physical removal from PDFs, DOCX, XLSX, PPTX, and text files, and forensic audit with zero network calls.7AGPL 3.0
- FlicenseNot gradedqualityNot gradedmaintenanceEnables agents to encrypt and sanitize sensitive data such as credentials, credit card numbers, and addresses locally before dispatching prompts to cloud LLMs, then rehydrate the masked values client-side. It runs deterministically with zero external dependencies over MCP JSON-RPC stdio, so no plaintext PII leaves the user's machine.-