Phi Guard MCP logo

Phi Guard MCP

Local stdio MCP server that detects PHI patterns in text and flags sensitive identifiers near risky code sinks.

Install Phi Guard MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "phi-guard-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "phi-guard-mcp"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 2 tools correctly (3d ago).

Overview

The phi-guard-mcp MCP server scans text for PHI-shaped values and checks source files for sensitive identifiers used near LLM, logging, analytics, or error-reporting sinks. It runs locally over stdio and makes no network calls, while returning masked findings to the MCP client. Use it to review prompts, logs, analytics calls, and supported source files before sensitive data reaches those destinations. It is a narrow lexical linter, not a HIPAA certification, compliance attestation, or dataflow analyzer.

Use cases

  • Redact PHI-shaped values from prompts and log snippets
  • Scan JavaScript and TypeScript code for risky patient-data usage
  • Review Python and Go files for sensitive identifiers near sinks
  • Find patient-related values passed to LLM, logging, or analytics calls

Key features

  • Detects SSNs, MRNs, dates of birth, names, phones, and emails
  • Masks matched values in results by default
  • Scans TypeScript, JavaScript, Python, and Go files
  • Flags sensitive identifiers near LLM, logger, analytics, and error-reporting sinks
  • Runs locally as an MCP stdio process
  • Returns file, line, severity, and snippet details

Tools2

What Phi Guard MCP lets your agent do. Expand a tool for its parameters.

Verified live~261 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

11/11 checks healthy over the last 62d

What it can do

From the 2 tools this server returned when we ran it.

Read-only tools · 2
Network at startup3 connections
Files written at startupNone
Install scriptsprepare
npm provenanceNot published
Package age68 days
Maintainers1

Observed 2026-11-05 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · phi-guard-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads230Package downloads in the last 30 days.
Last commit1mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed2Callable tools this server registers over MCP.

How Phi Guard MCP works

What phi-guard-mcp MCP server does

The phi-guard-mcp MCP server helps identify likely protected health information in text and source code. It is intended for codebases where patient-related values might be inserted into LLM prompts, written to logs, sent to analytics, or passed to error-reporting functions.

The server exposes two MCP tools:

  • scan_code walks a directory and reports source lines where a sensitive-looking identifier appears alongside a configured risky sink.

The implementation is local-first. It does not make network calls or upload source code. Results still pass to the MCP client that launched the process, so a hosted assistant may place those results in a model context.

How it works

redact_suggest uses a fixed set of narrow patterns for SSNs, medical record numbers, dates of birth, names following “Patient,” phone numbers, and email addresses. Each match includes a type, confidence score, and character offsets into the original text. By default, matched values and the original unredacted text are omitted. An includeMatchedValues option can expose them for local command-line use or testing.

scan_code performs lexical, line-based matching rather than parsing code or resolving types. It recognizes the sensitive identifiers patient, diagnosis, dob, ssn, mrn, birthdate, and medicalrecord, without regard to case when bounded by non-letters. It checks those identifiers against LLM provider names, console methods, logger patterns, analytics calls, and error-reporting calls.

The scanner reads TypeScript, JavaScript, Python, and Go files based on their extensions. It skips common generated or dependency directories, including node_modules, dist, build, coverage, out, .next, and .turbo, along with dotfiles and dot-directories. Full-line // and # comments are ignored.

Setup and configuration

Node.js 22 or newer is required. The package can be started without cloning the repository:

Terminal
npx -y phi-guard-mcp

For a source checkout, clone the repository and run npm ci; the prepare step builds the dist output. MCP clients start the server as a local stdio process. A typical configuration uses npx as the command with -y and phi-guard-mcp as arguments. A local checkout can instead use node with an absolute path to dist/index.js.

After changing the build or configuration, restart the client or reconnect the MCP server so the running stdio process is replaced.

Tools and capabilities

redact_suggest returns a redacted string using labels such as [SSN], [MRN], [DOB], [NAME], [PHONE], and [EMAIL], along with detected match metadata. Its pattern confidence values range from 0.70 for email to 0.95 for SSN.

scan_code returns each finding’s file path, line number, severity, issue description, and source snippet. Severity is always high. Literal PHI in snippets is masked, while identifier names such as patient.diagnosis remain visible because they indicate the source-level issue.

Limitations and notes

The phi-guard-mcp MCP server uses intentionally limited patterns, so it can miss PHI that does not fit them. The code scanner only detects identifiers and sinks on the same line; it has no parser, type information, or general dataflow analysis. File-extension support means files are read according to their extensions, not that each language is semantically understood.

This tool is a linter for one category of mistake. It does not establish HIPAA compliance, provide a compliance attestation, or prove that data cannot reach an external system. Enabling matched values can put raw PHI into tool results, so that option should be reserved for contexts where exposing those values is acceptable.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Phi Guard MCP

phi-guard-mcp is an MCP server that connects an MCP client to local text and source-code scanning tools for PHI detection. Its main tools are `redact_suggest`, which masks PHI-shaped values in snippets, and `scan_code`, which flags sensitive identifiers near risky LLM, logging, analytics, and error-reporting sinks.

Install it by running `npx -y phi-guard-mcp` from an MCP client configuration. Node.js 22 or newer is required. Alternatively, clone the repository, run `npm ci`, and configure the client to launch the generated `dist/index.js` with Node.

Yes, phi-guard-mcp works with Cursor through a project `.cursor/mcp.json` or a global `~/.cursor/mcp.json` configuration. Configure Cursor to start `npx -y phi-guard-mcp`, then reconnect the server after changing the configuration.

No, the server itself makes no network calls and does not upload source code. Its findings are returned to the MCP client, however, so a hosted assistant may place those results into its model context.

It scans files ending in `.ts`, `.tsx`, `.js`, `.jsx`, `.py`, and `.go`. Detection is lexical and line-based, with no parser or type information. It skips several dependency and build directories, dotfiles, dot-directories, and full-line `//` or `#` comments.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewPhi Guard MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/phi-guard-mcp?style=directory)](https://allmcps.com/mcp/phi-guard-mcp)
HTML Embed
<a href="https://allmcps.com/mcp/phi-guard-mcp"><img src="https://allmcps.com/api/badge/phi-guard-mcp?style=directory" alt="Phi Guard MCP on AllMCPs" /></a>