Security gateway for Model Context Protocol (MCP) to protect AI tool interactions
Project description
LangProtect MCP Gateway
🛡️ Security gateway for Model Context Protocol (MCP) - Protect your AI tool interactions from security threats.
Features
✅ Automatic Threat Detection - Scans all MCP requests for security risks
✅ Access Control - Whitelist/blacklist MCP servers and tools
✅ Full Audit Trail - Logs all AI interactions for compliance
✅ IDE Support - Works with VS Code, Cursor, and all MCP-compatible IDEs
✅ Easy Setup - 30-second installation
Quick Start
Installation
pip install langprotect-mcp-gateway
Configuration
Create your MCP config file:
VS Code: ~/.config/Code/User/mcp.json
Cursor: ~/.cursor/mcp.json
{
"mcpServers": {
"langprotect-gateway": {
"command": "langprotect-gateway",
"env": {
"LANGPROTECT_URL": "https://your-langprotect-server.com",
"LANGPROTECT_EMAIL": "your.email@company.com",
"LANGPROTECT_PASSWORD": "your-password"
},
"servers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
}
}
}
}
}
📝 Note: Replace LANGPROTECT_URL with your actual server URL (e.g., https://langprotect.yourcompany.com or http://localhost:8000 for local testing).
Restart Your IDE
VS Code: Ctrl+Shift+P → "Reload Window"
Cursor: Close and reopen
Done! 🎉 All your AI tool interactions are now protected.
What It Does
The LangProtect MCP Gateway intercepts all AI tool interactions and:
- Scans for threats - Detects malicious commands, data exfiltration attempts
- Enforces policies - Blocks access to sensitive files and dangerous operations
- Logs everything - Complete audit trail for compliance
- Auto-detects IDE - Tracks which IDE/tool made each request
Supported IDEs
- ✅ VS Code (with GitHub Copilot, Codeium, etc.)
- ✅ Cursor IDE
- ✅ Windsurf
- ✅ Zed Editor
- ✅ Any MCP-compatible IDE
Environment Variables
| Variable | Required | Default | Description |
|---|---|---|---|
LANGPROTECT_URL |
No | http://localhost:8000 |
Your LangProtect server URL |
LANGPROTECT_EMAIL |
Yes | - | Your email address |
LANGPROTECT_PASSWORD |
Yes | - | Your password |
DEBUG |
No | false |
Enable debug logging (true/false) |
MCP_CONFIG_PATH |
No | Auto-detected | Path to servers config (Cursor only) |
⚠️ Production Setup: For production deployments, always set LANGPROTECT_URL to your actual server:
"env": {
"LANGPROTECT_URL": "https://langprotect.yourcompany.com",
"LANGPROTECT_EMAIL": "your.email@company.com",
"LANGPROTECT_PASSWORD": "your-password"
}
The default http://localhost:8000 is only for local development/testing.
Architecture
AI Assistant (Copilot, etc.)
↓
LangProtect Gateway (this package)
↓
[Security Scan]
↓
MCP Servers (filesystem, github, etc.)
Every request is:
- Intercepted by the gateway
- Scanned for security threats
- Logged to LangProtect backend
- Forwarded to actual MCP server (if safe)
- Response returned to AI
Dashboard
Monitor all activity at your LangProtect dashboard:
- View all AI interactions
- See security threats blocked
- Track IDE usage
- Generate compliance reports
Security
The gateway protects against:
- 🚫 Sensitive file access (
.env, SSH keys, etc.) - 🚫 Dangerous commands (
rm -rf, data exfiltration) - 🚫 SQL injection patterns
- 🚫 Hardcoded credentials in suggestions
- 🚫 Prompt injection attacks
Troubleshooting
Authentication failed:
- Check
LANGPROTECT_URL,LANGPROTECT_EMAIL,LANGPROTECT_PASSWORDare correct - Ensure LangProtect backend is accessible
Gateway not starting:
- Check Python version:
python3 --version(need 3.11+) - Check package installed:
pip show langprotect-mcp-gateway
Tools not working:
- Check MCP servers are configured under
"servers"section - Restart IDE completely
For Team Leads
Quick Team Rollout:
-
Share credentials with each team member:
Email: user@company.com Password: secure-password Server: http://langprotect.company.com:8000 -
Team members install:
pip install langprotect-mcp-gateway # Configure mcp.json with credentials # Restart IDE
-
Monitor dashboard: See all team activity in real-time
Updates
pip install --upgrade langprotect-mcp-gateway
Support
- Documentation: https://docs.langprotect.com
- Issues: https://github.com/langprotect/mcp-gateway/issues
- Security: security@langprotect.com
License
MIT License - see LICENSE file for details
Links
- Homepage: https://langprotect.com
- GitHub: https://github.com/langprotect/mcp-gateway
- Documentation: https://docs.langprotect.com
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 langprotect_mcp_gateway-1.0.0.tar.gz.
File metadata
- Download URL: langprotect_mcp_gateway-1.0.0.tar.gz
- Upload date:
- Size: 11.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f47cc6b51a0536eeefff8d4b107707c428fb198ecc0102c8622aa15361fe06b
|
|
| MD5 |
2d796046c15ef0b6f49ed868852ce0c8
|
|
| BLAKE2b-256 |
8a0ba429728eaed8e29ae84f80e21f14d81767752835b35e898d019d04eaf2ef
|
File details
Details for the file langprotect_mcp_gateway-1.0.0-py3-none-any.whl.
File metadata
- Download URL: langprotect_mcp_gateway-1.0.0-py3-none-any.whl
- Upload date:
- Size: 10.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4cd03ae43e9663556ced990191206d602b2a7d98a712ff5c7db67a928f9c6109
|
|
| MD5 |
2b332b6906faa90a04fb70ea109a3093
|
|
| BLAKE2b-256 |
12cb4cfc3b23443f2639f1eba3b72e92e450613fe34b9cdbf5893ff44920ad51
|