Doc Sanitizer MCP Server
A 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.
README
Doc Sanitizer MCP Server
A local, containerized MCP (Model Context Protocol) server that uses a local LLM (via Ollama) to sanitize documents by removing or transforming PII before content is sent to public LLM services.
Features
- Document Support: Word (.docx), PDF, Excel (.xlsx/.xls), CSV, Plain text, Email (.eml)
- PII Detection: Names, emails, phone numbers, companies, addresses, financial data, IDs
- Flexible Actions: Delete, invent synthetic data, or keep partial information
- Profile Management: Create and manage multiple sanitization profiles via CLI
- MCP Integration: Works with Claude Desktop, Claude.ai, and Claude Code
- Privacy First: All processing happens locally - nothing sent to external services
Quick Start
Prerequisites
- Docker and Docker Compose
- Ollama (installed automatically via Docker)
Installation
git clone https://github.com/yourusername/doc-sanitizer-mcp.git
cd doc-sanitizer-mcp
./setup.sh
Configuration
Edit .env to customize settings:
# Change LLM model (no rebuild required)
OLLAMA_MODEL=phi4:14b
# Alternative models:
# OLLAMA_MODEL=qwen2.5:7b # Faster, less RAM
# OLLAMA_MODEL=llama3.2:3b # Fastest, minimal RAM
To switch models:
# Pull new model
docker exec doc-sanitizer-ollama ollama pull qwen2.5:7b
# Update .env
sed -i '' 's/OLLAMA_MODEL=.*/OLLAMA_MODEL=qwen2.5:7b/' .env
# Restart
docker compose restart doc-sanitizer
Claude Desktop Integration
Add to ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"doc-sanitizer": {
"url": "http://localhost:8000/sse"
}
}
}
Usage
Via Claude (MCP Tools)
Once configured, you can ask Claude:
- "List available sanitization profiles"
- "Show me the default profile settings"
- "Sanitize this document using the high_privacy profile"
Via CLI
# List profiles
doc-sanitizer profiles list
# Create a new profile
doc-sanitizer profiles create high_privacy
# Edit profile settings
doc-sanitizer profiles edit high_privacy --set person_name=delete --set company=delete
# Sanitize a document
doc-sanitizer sanitize document.docx --profile high_privacy
Profile Management
Profiles define how each PII type is handled:
| PII Type | Available Actions |
|---|---|
person_name |
delete, invent, keep_part |
email |
delete, keep_part |
phone |
delete, invent, keep_part |
company |
keep_part, invent |
address |
delete, invent |
financial |
delete, invent |
id_numbers |
delete, invent |
date_of_birth |
delete, invent |
Profiles persist across container restarts (stored in ~/.doc-sanitizer/).
Documentation
License
MIT License - see LICENSE for details.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.