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
Metadata
Release files for promptguard-mcp-server 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| promptguard_mcp_server-1.0.0.tar.gz | 9.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| promptguard_mcp_server-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.4 kB
Release files / promptguard_mcp_server-1.0.0.tar.gz
| Download URL | promptguard_mcp_server-1.0.0.tar.gz |
|---|---|
| Size | 9.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
40f130e6b7fe4cdec0d114106ceef2d421655000576b50a85ade9b04adbc890f
|
|
BLAKE2b-256 checksum How to use checksums |
f82bc97b64c5a90968252a7e7ce3f3b08330967dcceb1a8562c06e08751e1dc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|
Release files / promptguard_mcp_server-1.0.0-py3-none-any.whl
| Download URL | promptguard_mcp_server-1.0.0-py3-none-any.whl |
|---|---|
| Size | 9.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6add76a1de3d8b9aaba9daa12bb8725da33eb14df6a7b0337110036529bdd4bd
|
|
BLAKE2b-256 checksum How to use checksums |
21f8d0e2a29d56e4c443d4362fd5f8d92c9a0e148bb1b9f337e4d8ab763c21e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.13.12
|