PromptShield MCP

PromptShield MCP

A Model Context Protocol server that lets AI agents and runtime firewalls call PromptShield-style safety checks for text, chat messages, prompts, tool inputs, and generated outputs.

Category
Visit Server

README

PromptShield MCP

PromptShield MCP is a Model Context Protocol server that lets AI agents and runtime firewalls call PromptShield-style safety checks for text, chat messages, prompts, tool inputs, and generated outputs.

The server is a thin adapter over zero-harm-ai-detectors. It should not duplicate detector logic from the detector package or from the PromptShield GitHub Action.

Goals

  • Expose PII, secret, and harmful-content detection through MCP tools.
  • Return structured findings that agents and firewalls can enforce.
  • Support local/self-hosted operation for sensitive data.
  • Keep logs privacy-safe by default.
  • Provide stable tool contracts that can be used by coding agents, chat agents, and firewall.

Non-Goals

  • Reimplementing zero-harm-ai-detectors.
  • Acting as a hosted service by default.
  • Making policy enforcement decisions that belong to a firewall or calling agent.
  • Replacing the PromptShield GitHub Action.

Relationship To Other Projects

zero-harm-ai-detectors
  Shared detector engine for PII, secrets, and harmful content.

promptshield
  GitHub Action and CI-oriented scanner for pull requests.

promptshield-mcp
  MCP server adapter that exposes detector functionality to AI agents.

promptshield-firewall (future)
  Runtime enforcement layer. It can call promptshield-mcp or use
  zero-harm-ai-detectors directly.

Proposed MCP Tools

promptshield.scan_text

Scan one text string for PII, secrets, and harmful content.

Use this for prompt inputs, generated outputs, tool arguments, logs, and arbitrary text.

promptshield.scan_messages

Scan chat-style messages while preserving message roles and indexes.

Use this when an agent wants to inspect a conversation before sending it to a model or tool.

promptshield.redact_text

Return a redacted version of text plus findings.

Use this when the caller wants to continue safely after removing sensitive spans.

promptshield.evaluate_policy

Map detector findings to an action recommendation.

Use this when a caller wants a normalized decision such as allow, warn, redact, or block.

Expected Finding Shape

{
  "type": "email",
  "category": "pii",
  "severity": "medium",
  "confidence": 0.98,
  "span": {
    "start": 18,
    "end": 35
  },
  "redacted": "[EMAIL]",
  "message_index": 0,
  "message_role": "user"
}

Expected Response Shape

{
  "schema_version": "1.0.0",
  "risk_level": "high",
  "recommended_action": "redact",
  "categories": ["pii", "secret"],
  "summary": {
    "total_findings": 2,
    "pii": 1,
    "secret": 1,
    "harmful": 0
  },
  "findings": [],
  "redacted_text": "Contact [EMAIL] with token [SECRET]."
}

Privacy Requirements

  • Do not log raw input text by default.
  • Do not log detected secret values by default.
  • Include a config option for audit logs that stores only counts, categories, severities, and request metadata.
  • Avoid sending data to external services unless explicitly configured.
  • Keep the default transport local-first.

Suggested Implementation Stack

  • Python 3.11+
  • mcp Python SDK
  • zero-harm-ai-detectors
  • pydantic for tool input and output schemas
  • pytest for tests
  • ruff for linting and formatting

Development Setup

python -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest

First Milestone

Build a local MCP server with:

  • promptshield.scan_text
  • promptshield.scan_messages
  • unit tests with mocked detector results
  • README quickstart
  • example MCP client config

Do not add network transport, hosted deployment, auth, or database persistence in the first milestone.

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured