Skip to main content
Glama
Reusable Privacy MCP Server

Reusable Privacy MCP Server

by LesserWords

Reusable Privacy MCP Server

License: MIT English | Português (Brasil)

A zero-data-leakage, privacy-first Model Context Protocol (MCP) server designed for any local document workspace.

Features

  • 🔒 Zero External Data Exposure: Inverted keyword indexing and full-text searching run 100% offline.

  • 🛡️ Automated PII & Secret Redaction: Automatically strips CPFs, CNPJs, Emails, Phone numbers, Passwords, and Secrets before sending snippets to LLMs.

  • 🚫 Path Access Control: Blacklists sensitive subfolders (e.g. Financeiro, Recursos Humanos, .git).

  • ⚡ Just-In-Time (JIT) Snippets: Line-bounded snippet retrieval prevents context stuffing.

  • ⚙️ Config-Driven: Customize security rules per workspace using a local .mcp-privacy.yml file.

Related MCP server: Synorive

Getting Started

  1. Install dependencies:

    npm install
  2. Build the Node.js project:

    npm run build
  3. (Optional) Build as a standalone .exe (No Node.js required on target machine):

    npm run build:exe
    # or: bun run build:exe

    This compiles privacy-mcp.exe. When launched without MCP_PROJECT_ROOT, it automatically targets the folder it is placed in or executed from (process.cwd()).

How to Register in Client Hosts (Claude Desktop / Cursor / Antigravity)

Option A: Using Node.js

Add this entry to your claude_desktop_config.json or MCP configuration:

{
  "mcpServers": {
    "workspace-docs": {
      "command": "node",
      "args": ["/path/to/privacy-mcp-server/dist/index.js"],
      "env": {
        "MCP_PROJECT_ROOT": "/path/to/your/documents"
      }
    }
  }
}

Option B: Using Standalone Executable (privacy-mcp.exe)

{
  "mcpServers": {
    "workspace-docs": {
      "command": "/path/to/privacy-mcp-server/privacy-mcp.exe",
      "env": {
        "MCP_PROJECT_ROOT": "/path/to/your/documents"
      }
    }
  }
}

Tip: If MCP_PROJECT_ROOT is omitted in Option B, privacy-mcp.exe automatically protects and indexes whichever directory it is launched from.

Multi-MCP & Multi-Workspace Architecture

To scale this tool across multiple folders or combine it with other MCP tools:

  1. MCP Gateway / Meta-MCP Router: Run a proxy server that aggregates privacy-mcp with other MCP servers (Git, SQLite, Web Search) into a single client entry point with tool namespacing (privacy_search, git_diff).

  2. Multi-Workspace Support: Configured via mcp-workspaces.yml to index multiple project roots under a single server instance using list_workspaces and search_all_workspaces.

  3. Modular Plugin Architecture: Embed multiple tools (privacy engine, git inspector, tabular data parser) directly into the single .exe binary, enabled per workspace.

  4. Auto-Discovery Launcher: A lightweight system tray utility (mcp-tray.exe) that watches folders for .mcp-privacy.yml and auto-registers them into Claude/Cursor configs.

For detailed design blueprints on these patterns, see docs/MULTI_MCP_ARCHITECTURE.md.

Workspace Configuration (.mcp-privacy.yml)

Place a .mcp-privacy.yml file in any workspace root directory:

name: "My Project Knowledge Base"
security:
  restricted_directories:
    - "Financeiro"
    - "Recursos Humanos"
    - "Certificado Digital"
    - ".git"
    - "node_modules"
  allowed_extensions:
    - ".md"
    - ".json"
    - ".txt"
    - ".csv"
  max_snippet_lines: 50

redaction:
  enable_default_pii: true

Available Tools

3 tools
list_structureC

Safely lists allowed subdirectories and document files in the workspace.

Inputs: subpath.

read_snippetB

Retrieves a line-bounded, sanitized snippet from an allowed file.

Inputs: relativePath (required), lineCount, startLine.

search_docsB

Searches documents locally using full-text keywords. Returns sanitized matching lines.

Inputs: query (required), maxResults.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool targets a distinct operation: listing structure, searching content, and reading a bounded snippet. There is no overlap in purpose, making selection unambiguous.

    Naming Consistency5/5

    All tools follow a consistent snake_case verb_noun pattern (list_structure, search_docs, read_snippet). The naming is predictable and easy to parse.

    Tool Count5/5

    Three tools is within the typical well-scoped range (3–15) and each earns its place for a focused read-only document access server. No tool feels redundant or missing.

    Completeness4/5

    The surface covers listing, searching, and reading snippets, which is a complete read-only lifecycle for a privacy-focused document server. Minor gaps exist (e.g., no metadata or pagination tool), but agents can work around them.

    Maintenance

    ActivitySlowing
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      A
      maintenance
      Privacy-first local document search using semantic search. Runs entirely on your machine with no cloud services, supporting PDF, DOCX, TXT, and Markdown files.
      9
      5,381 npm
      430
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables private, offline semantic search across local files (documents, images, videos) using OCR and vector search, and optionally performs web research with cited sources.
      AGPL 3.0
    • A
      license
      A
      quality
      B
      maintenance
      Enables local AI agents to perform hybrid search (BM25 + vector) over privately indexed local files, including notes, PDFs, DOCX, source code, and OCR'd images. All indexing and retrieval stay on the machine with read-only, whitelist-scoped access.
      3
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables AI coding agents to perform private, local code search that returns only the most relevant code chunks, reducing token use and setup while keeping repositories on the user's machine.
      517 npm
      MIT