Skip to main content

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:

  1. Scans for threats - Detects malicious commands, data exfiltration attempts
  2. Enforces policies - Blocks access to sensitive files and dangerous operations
  3. Logs everything - Complete audit trail for compliance
  4. 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:

  1. Intercepted by the gateway
  2. Scanned for security threats
  3. Logged to LangProtect backend
  4. Forwarded to actual MCP server (if safe)
  5. 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_PASSWORD are 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:

  1. Share credentials with each team member:

    Email: user@company.com
    Password: secure-password
    Server: http://langprotect.company.com:8000
    
  2. Team members install:

    pip install langprotect-mcp-gateway
    # Configure mcp.json with credentials
    # Restart IDE
    
  3. Monitor dashboard: See all team activity in real-time

Updates

pip install --upgrade langprotect-mcp-gateway

Support

License

MIT License - see LICENSE file for details

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langprotect_mcp_gateway-1.1.0.tar.gz (9.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

langprotect_mcp_gateway-1.1.0-py3-none-any.whl (9.3 kB view details)

Uploaded Python 3

File details

Details for the file langprotect_mcp_gateway-1.1.0.tar.gz.

File metadata

  • Download URL: langprotect_mcp_gateway-1.1.0.tar.gz
  • Upload date:
  • Size: 9.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for langprotect_mcp_gateway-1.1.0.tar.gz
Algorithm Hash digest
SHA256 4d836c2be4f7b2df8ea1a87064fb35a92dae93beb81e64bcf2d4f2dc912b8219
MD5 905487d00d7cfe739a188a03a7844a8d
BLAKE2b-256 1f86baf81b24941aaad5ccd3053031b58bf563e9ffee1479c00fff94c7cff515

See more details on using hashes here.

File details

Details for the file langprotect_mcp_gateway-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for langprotect_mcp_gateway-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e8f2a42aca0d7c537400f196f3b83115d8423830f7d27f9c3abe7cc4bc3c9aa5
MD5 386e9ef8cbb3d4f6ba4279326a7615e0
BLAKE2b-256 6ab31a881aec7edf562fda42fdc088318c24fe3fc649bda9ca7d1bed0d73c929

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page