phantomswap
Click on "Deploy 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., "@phantomswap Mask my resume with the 'jobsearch' session before sending it to AI."
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.
๐ญ PhantomSwap
"Your data, ghosted." โ Privacy-first, bidirectional data masking & unmasking service for safe AI interactions.
๐ก The Problem & The Solution
When collaborating with Large Language Models (LLMs) on resumes, portfolio websites, codebases, or sensitive documents, personal identifiers (PII) like names, emails, phone numbers, colleges, and internal company project names are exposed.
PhantomSwap solves this locally:
Define a Swap Session: Map your real personal data to realistic fake placeholders.
๐ญ Mask: Swap real values with fake placeholders before sending your text or code to AI.
๐ค Send to AI: Let AI build your portfolio website, optimize your resume, or refactor your code.
๐ Unmask: Seamlessly restore all real personal values back across the generated text or entire codebase directories!
100% Local Execution โ Your real data never leaves your computer.
Related MCP server: SecureMCP
๐ Key Features
โก Bidirectional Replacement Engine: Guaranteed collision-safe two-pass replacement avoiding chain-replacement corruption.
๐จ Modern Dark Glassmorphism UI: Beautiful web dashboard with live stats, copy buttons, search, and directory inspector.
๐ Bulk Directory Processing: Recursively mask and unmask entire projects (e.g. AI-generated portfolio website folders) with automatic
.baksafety backups.๐ค Native MCP Server: Integrated Model Context Protocol server for AI coding assistants (Claude Desktop, Cursor, Windsurf).
โจ๏ธ Rich CLI: Feature-complete terminal CLI with rich formatted tables and pipe support.
๐ Task Audit History: Complete tracking and logging of every masking operation.
๐๏ธ Architecture
flowchart TD
subgraph Interfaces
UI["๐จ Web UI Dashboard (Port 8000)"]
CLI["โจ๏ธ Terminal CLI (Typer + Rich)"]
MCP["๐ค MCP Server (Claude / Cursor / Windsurf)"]
API["๐ REST API (FastAPI)"]
end
subgraph Core
ENGINE["๐ง Two-Pass Replacement Engine"]
FILEOPS["๐ Bulk File & Directory Ops"]
end
subgraph Storage
DB[("๐พ Local SQLite DB (phantomswap.db)")]
BAK[("๐ก๏ธ Automatic .bak File Backups")]
end
UI --> API
CLI --> API
API --> ENGINE
API --> FILEOPS
MCP --> ENGINE
MCP --> FILEOPS
API --> DB
MCP --> DB
FILEOPS --> BAK๐ Quick Start
1. Setup & Installation
Using uv (Fastest):
# Create virtual environment and install dependencies
uv venv
uv pip install -r requirements.txtOr using standard Python (venv):
# Windows
py -m venv .venv
.venv\Scripts\pip install -r requirements.txt
# Linux / macOS
python3 -m venv .venv
source .venv/bin/activate
pip install -r requirements.txt2. Run the Web Dashboard & API
Local:
# With uv
uv run python -m app.main
# Or with python virtualenv
.venv\Scripts\python -m app.mainOr with Docker / Docker Compose:
# Build and run container with persistent SQLite volume
docker compose up --build -dOpen your browser at:
๐ Web Dashboard: http://127.0.0.1:8000
๐ Interactive Swagger API Docs: http://127.0.0.1:8000/docs
โจ๏ธ Command Line Interface (CLI)
# List swap sessions
uv run python -m cli.main sessions list
# Create a new session
uv run python -m cli.main sessions create my-resume \
--description "Masking resume personal details" \
-m "Shiva Patel:Alex Johnson" \
-m "shiva.patel@gmail.com:alex.johnson@example.com" \
-m "IIT Delhi:State University"
# Mask text directly from terminal
uv run python -m cli.main mask --session my-resume --text "Shiva Patel graduated from IIT Delhi."
# Output: Alex Johnson graduated from State University.
# Unmask text
uv run python -m cli.main unmask --session my-resume --text "Alex Johnson graduated from State University."
# Output: Shiva Patel graduated from IIT Delhi.
# Mask an entire directory (e.g. portfolio project)
uv run python -m cli.main dir mask D:\projects\MyPortfolio --session my-resume --ext .html,.css,.js
# Unmask the directory when AI generation is complete
uv run python -m cli.main dir unmask D:\projects\MyPortfolio --session my-resume --ext .html,.css,.js
# View task history
uv run python -m cli.main history๐ค Model Context Protocol (MCP) Integration
PhantomSwap includes a built-in MCP server that allows AI assistants to mask and unmask sensitive project context autonomously.
Claude Desktop Configuration
Add the following to your claude_desktop_config.json:
{
"mcpServers": {
"phantomswap": {
"command": "uv",
"args": [
"run",
"--directory",
"d:/DEVELOPMENT/MulipleStringChanger",
"python",
"-m",
"mcp_server.server"
]
}
}
}Available MCP Tools:
phantomswap_list_sessions: List all available masking profiles.phantomswap_get_session: Retrieve replacement mappings.phantomswap_create_session: Create new session with key-value pairs.phantomswap_mask_text: Anonymize text before sending to AI.phantomswap_unmask_text: Restore original values in AI responses.phantomswap_mask_directory: Bulk mask project directories.phantomswap_unmask_directory: Bulk unmask project directories.
๐งช Testing
Run the automated test suite with pytest:
uv run pytest tests/ -v๐ License
MIT License ยฉ 2026. Built with privacy in mind.
Available Tools
7 toolsphantomswap_create_sessionB
Create a new swap session with key-value mappings. mappings should be a list of objects like: [{"real_value": "Real", "fake_value": "Fake"}]
Inputs: name (required), mappings (required), description (required), case_sensitive. Returns: result
phantomswap_get_sessionA
Get full details and all key-value mappings of a specific swap session.
Inputs: session_name_or_id (required). Returns: result
phantomswap_list_sessionsA
List all available PhantomSwap swap sessions with their summary details.
Inputs: no named parameters. Returns: result
phantomswap_mask_directoryB
Mask all files in a directory using a swap session.
Inputs: directory_path (required), session_name_or_id (required), file_extensions. Returns: result
phantomswap_mask_textC
Mask sensitive information in text by swapping real values with fake placeholders.
Inputs: text (required), session_name_or_id (required). Returns: result
phantomswap_unmask_directoryC
Unmask all files in a directory using a swap session.
Inputs: directory_path (required), session_name_or_id (required), file_extensions. Returns: result
phantomswap_unmask_textC
Unmask text by restoring fake placeholders back to original real values.
Inputs: text (required), session_name_or_id (required). Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose: session management (list/get/create) versus masking operations (mask/unmask text or directory). There is no meaningful overlap between any two tools.
All tools follow the consistent phantomswap_<verb>_<target> pattern using snake_case. The session tools use list/get/create and the masking tools use mask/unmask, making the naming highly predictable.
Seven tools is well-scoped for a session-based masking utility on three session management tools and four mask/unmask operations. Every tool earns its place and there are no redundant additions.
The core workflow is covered: sessions can be created, listed, and retrieved, and masking/unmasking works for both text and directories. Missing session update/delete operations are minor administrative gaps that can be worked around by creating new sessions.
Maintenance
Related MCP Connectors
Detect and redact PII and secrets before text reaches an LLM, with reversible placeholders.
Find and redact leaked secrets, wallet keys and PII before an AI agent sends text.
Let AI agents use any website you're logged in to. Sessions stay encrypted on your machine.
Detect and redact PII and secrets (API keys, tokens) in text, HTML or PDF before it reaches an LLM.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables anonymization and deanonymization of sensitive data in text using Microsoft Presidio. Supports session-based storage to reversibly replace sensitive information like passwords and secrets with placeholder tokens.-
- AlicenseBqualityBmaintenanceEnables local grammar-preserving masking of sensitive content, entities, and code identifiers into synthetic tokens before sending prompts to LLMs, then restores the original text and symbols from responses using session-scoped in-memory mappings.52Apache 2.0
- AlicenseBqualityBmaintenanceEnables local, in-memory de-identification of PII, PHI, and credentials with deterministic reversible surrogate tokens before LLM transmission, then restores originals from volatile session mappings and audits for exposures without network egress or disk writes.5115 npm1Apache 2.0
- FlicenseNot gradedqualityBmaintenanceEnables reversible anonymization of sensitive PII such as SSNs, credit cards, passport numbers, emails, and phone numbers before sending prompts to external LLMs, then restores original values locally using HMAC isolation.7-