PromptGuard MCP server — scan prompts, redact PII, and audit LLM SDK usage from any MCP client
Project description
PromptGuard MCP Server
Standalone Model Context Protocol server for PromptGuard — scan prompts for injection attacks, redact PII, and audit LLM SDK usage from any MCP-compatible client.
Installing the MCP Server
pip (recommended)
pip install promptguard-mcp-server
uvx (zero-install)
uvx promptguard-mcp-server
npx
npx @promptguard/mcp-server
Docker
docker pull abhijoysarkar/promptguard-mcp-server
docker run -e PROMPTGUARD_API_KEY=pg_xxx abhijoysarkar/promptguard-mcp-server
Homebrew (CLI)
brew tap promptguard/tap
brew install promptguard
Quick Start
1. Install
pip install promptguard-mcp-server
2. Configure your API key
export PROMPTGUARD_API_KEY="pg_sk_prod_YOUR_KEY"
Or skip this — the agent will call promptguard_auth automatically when needed.
3. Add to your MCP client
Cursor — add to .cursor/mcp.json:
{
"mcpServers": {
"promptguard": {
"command": "promptguard-mcp-server",
"args": []
}
}
}
Claude Desktop — add to claude_desktop_config.json:
{
"mcpServers": {
"promptguard": {
"command": "promptguard-mcp-server",
"args": []
}
}
}
Claude Code:
claude mcp add promptguard -- promptguard-mcp-server
Gemini CLI:
gemini mcp add -t stdio promptguard -- promptguard-mcp-server
VS Code Copilot — add to settings.json:
{
"github.copilot.chat.mcp.servers": {
"promptguard": {
"command": "promptguard-mcp-server",
"args": []
}
}
}
Transports
The server supports two transports:
| Transport | Command | Default |
|---|---|---|
| stdio | promptguard-mcp-server |
Yes |
| Streamable HTTP | promptguard-mcp-server --transport http |
Port 8000 |
stdio (default)
Used by Cursor, Claude Desktop, VS Code, and most MCP clients. The server communicates via stdin/stdout using JSON-RPC 2.0.
promptguard-mcp-server
Streamable HTTP
Used for remote/shared deployments. The MCP endpoint is served at http://HOST:PORT/mcp.
promptguard-mcp-server --transport http --host 0.0.0.0 --port 9000
Docker
stdio mode
docker run -i --rm \
-e PROMPTGUARD_API_KEY=pg_xxx \
abhijoysarkar/promptguard-mcp-server
Streamable HTTP mode
docker run --rm -p 8000:8000 \
-e PROMPTGUARD_API_KEY=pg_xxx \
abhijoysarkar/promptguard-mcp-server \
--transport http
Available Tools
| Tool | Description | Auth Required |
|---|---|---|
promptguard_auth |
Authenticate with PromptGuard (opens dashboard or saves key) | No |
promptguard_logout |
Clear locally stored credentials | No |
promptguard_scan_text |
Scan text for prompt injection, jailbreaks, PII, toxic content | Yes |
promptguard_scan_project |
Scan a directory for unprotected LLM SDK usage | No |
promptguard_redact |
Redact PII from text (emails, phones, SSNs, credit cards) | Yes |
promptguard_status |
Check connection status, plan, and API version | No |
Environment Variables
| Variable | Default | Description |
|---|---|---|
PROMPTGUARD_API_KEY |
— | API key (starts with pg_sk_test_ or pg_sk_prod_) |
PROMPTGUARD_API_URL |
https://api.promptguard.co |
API base URL (for self-hosted deployments) |
TRANSPORT |
stdio |
Transport type when running via Docker |
HOST |
0.0.0.0 |
HTTP bind address |
PORT |
8000 |
HTTP port |
When no environment variable is set, the server reads from ~/.promptguard/config.json (created by promptguard_auth).
Development
git clone https://github.com/acebot712/promptguard.git
cd promptguard/mcp-server
pip install -e .
promptguard-mcp-server
Building the Docker image
docker build -t abhijoysarkar/promptguard-mcp-server .
Running tests
echo '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' | promptguard-mcp-server
Links
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file promptguard_mcp_server-1.0.0.tar.gz.
File metadata
- Download URL: promptguard_mcp_server-1.0.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
40f130e6b7fe4cdec0d114106ceef2d421655000576b50a85ade9b04adbc890f
|
|
| MD5 |
658a799b1b87f8650ec8e08804c75943
|
|
| BLAKE2b-256 |
f82bc97b64c5a90968252a7e7ce3f3b08330967dcceb1a8562c06e08751e1dc2
|
File details
Details for the file promptguard_mcp_server-1.0.0-py3-none-any.whl.
File metadata
- Download URL: promptguard_mcp_server-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6add76a1de3d8b9aaba9daa12bb8725da33eb14df6a7b0337110036529bdd4bd
|
|
| MD5 |
44cf843d398647f8d6fc4f8e5328dbaa
|
|
| BLAKE2b-256 |
21f8d0e2a29d56e4c443d4362fd5f8d92c9a0e148bb1b9f337e4d8ab763c21e0
|