langprotect-mcp-gateway 1.3.1__tar.gz → 1.3.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (16) hide show
  1. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/PKG-INFO +40 -13
  2. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/README.md +39 -12
  3. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/langprotect_mcp_gateway/gateway.py +13 -1
  4. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/langprotect_mcp_gateway/setup_helper.py +1 -1
  5. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/langprotect_mcp_gateway.egg-info/PKG-INFO +40 -13
  6. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/pyproject.toml +1 -1
  7. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/LICENSE +0 -0
  8. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/langprotect_mcp_gateway/__init__.py +0 -0
  9. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/langprotect_mcp_gateway/response_masker.py +0 -0
  10. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/langprotect_mcp_gateway.egg-info/SOURCES.txt +0 -0
  11. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/langprotect_mcp_gateway.egg-info/dependency_links.txt +0 -0
  12. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/langprotect_mcp_gateway.egg-info/entry_points.txt +0 -0
  13. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/langprotect_mcp_gateway.egg-info/requires.txt +0 -0
  14. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/langprotect_mcp_gateway.egg-info/top_level.txt +0 -0
  15. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/setup.cfg +0 -0
  16. {langprotect_mcp_gateway-1.3.1 → langprotect_mcp_gateway-1.3.3}/tests/test_response_masker.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langprotect-mcp-gateway
3
- Version: 1.3.1
3
+ Version: 1.3.3
4
4
  Summary: Security gateway for Model Context Protocol (MCP) to protect AI tool interactions
5
5
  Author-email: LangProtect Security Team <security@langprotect.com>
6
6
  License: MIT
@@ -96,26 +96,53 @@ Run our automated setup command to configure VS Code, Cursor, or Claude Desktop
96
96
  langprotect-gateway-setup
97
97
  ```
98
98
 
99
- This will:
100
- - Create a global wrapper script at `~/.local/bin/langprotect-mcp-wrapper.sh`
101
- - ✅ Configure VS Code for global visibility in ALL workspaces
102
- - Enable auto-start for seamless protection
99
+ **What happens:**
100
+ - 🔐 **Prompts for credentials** interactively (password hidden)
101
+ - ✅ **Validates credentials** in real-time against your backend
102
+ - 🔄 **Retries on failure** with helpful error messages
103
+ - 📝 **Creates wrapper script** at `~/.local/bin/langprotect-mcp-wrapper.sh`
104
+ - ⚙️ **Configures VS Code** for global visibility in ALL workspaces
105
+ - 🚀 **Auto-start enabled** for seamless protection
103
106
 
104
- ### 3. Configure Your Credentials
107
+ **Example:**
108
+ ```bash
109
+ $ langprotect-gateway-setup
105
110
 
106
- Edit the generated wrapper script to add your LangProtect email and password:
111
+ 🚀 Setting up LangProtect MCP Gateway...
107
112
 
108
- ```bash
109
- # Linux/macOS
110
- nano ~/.local/bin/langprotect-mcp-wrapper.sh
113
+ ═══════════════════════════════════════════════════════════════
114
+ 🔐 Enter Your LangProtect Credentials
115
+ ═══════════════════════════════════════════════════════════════
116
+
117
+ Backend URL [http://localhost:8000]: http://localhost:8000
118
+ Email: your.email@company.com
119
+ Password: ●●●●●●●●●●
120
+
121
+ Validating credentials...
122
+ ✓ Credentials validated successfully!
111
123
 
112
- # Update these lines:
113
- export LANGPROTECT_URL="https://your-backend.com" # e.g. http://localhost:8000
124
+ 📝 Creating global wrapper script...
125
+ Created: ~/.local/bin/langprotect-mcp-wrapper.sh
126
+
127
+ ⚙️ Configuring VS Code...
128
+ ✅ Updated: ~/.config/Code/User/settings.json
129
+
130
+ ✅ Setup complete!
131
+ ```
132
+
133
+ **Alternative: Pre-set credentials via environment variables**
134
+ ```bash
135
+ export LANGPROTECT_URL="http://localhost:8000"
114
136
  export LANGPROTECT_EMAIL="your.email@company.com"
115
137
  export LANGPROTECT_PASSWORD="your-password"
138
+ langprotect-gateway-setup
116
139
  ```
117
140
 
118
- Reload VS Code and you're done! LangProtect will now protect all your workspaces.
141
+ ### 3. Reload VS Code
142
+
143
+ Press `Ctrl+Shift+P` → `Developer: Reload Window`
144
+
145
+ **That's it!** ✅ LangProtect will now protect all your workspaces.
119
146
 
120
147
  ---
121
148
 
@@ -68,26 +68,53 @@ Run our automated setup command to configure VS Code, Cursor, or Claude Desktop
68
68
  langprotect-gateway-setup
69
69
  ```
70
70
 
71
- This will:
72
- - Create a global wrapper script at `~/.local/bin/langprotect-mcp-wrapper.sh`
73
- - ✅ Configure VS Code for global visibility in ALL workspaces
74
- - Enable auto-start for seamless protection
71
+ **What happens:**
72
+ - 🔐 **Prompts for credentials** interactively (password hidden)
73
+ - ✅ **Validates credentials** in real-time against your backend
74
+ - 🔄 **Retries on failure** with helpful error messages
75
+ - 📝 **Creates wrapper script** at `~/.local/bin/langprotect-mcp-wrapper.sh`
76
+ - ⚙️ **Configures VS Code** for global visibility in ALL workspaces
77
+ - 🚀 **Auto-start enabled** for seamless protection
78
+
79
+ **Example:**
80
+ ```bash
81
+ $ langprotect-gateway-setup
75
82
 
76
- ### 3. Configure Your Credentials
83
+ 🚀 Setting up LangProtect MCP Gateway...
77
84
 
78
- Edit the generated wrapper script to add your LangProtect email and password:
85
+ ═══════════════════════════════════════════════════════════════
86
+ 🔐 Enter Your LangProtect Credentials
87
+ ═══════════════════════════════════════════════════════════════
79
88
 
80
- ```bash
81
- # Linux/macOS
82
- nano ~/.local/bin/langprotect-mcp-wrapper.sh
89
+ Backend URL [http://localhost:8000]: http://localhost:8000
90
+ Email: your.email@company.com
91
+ Password: ●●●●●●●●●●
92
+
93
+ Validating credentials...
94
+ ✓ Credentials validated successfully!
95
+
96
+ 📝 Creating global wrapper script...
97
+ ✅ Created: ~/.local/bin/langprotect-mcp-wrapper.sh
98
+
99
+ ⚙️ Configuring VS Code...
100
+ ✅ Updated: ~/.config/Code/User/settings.json
101
+
102
+ ✅ Setup complete!
103
+ ```
83
104
 
84
- # Update these lines:
85
- export LANGPROTECT_URL="https://your-backend.com" # e.g. http://localhost:8000
105
+ **Alternative: Pre-set credentials via environment variables**
106
+ ```bash
107
+ export LANGPROTECT_URL="http://localhost:8000"
86
108
  export LANGPROTECT_EMAIL="your.email@company.com"
87
109
  export LANGPROTECT_PASSWORD="your-password"
110
+ langprotect-gateway-setup
88
111
  ```
89
112
 
90
- Reload VS Code and you're done! LangProtect will now protect all your workspaces.
113
+ ### 3. Reload VS Code
114
+
115
+ Press `Ctrl+Shift+P` → `Developer: Reload Window`
116
+
117
+ **That's it!** ✅ LangProtect will now protect all your workspaces.
91
118
 
92
119
  ---
93
120
 
@@ -546,7 +546,7 @@ class LangProtectGateway:
546
546
  output_text = self._extract_text_from_result(result_content)
547
547
 
548
548
  if output_text:
549
- logger.debug(f" Scanning output: {len(output_text)} chars")
549
+ logger.debug(f"🔍 Scanning output: {len(output_text)} chars")
550
550
  output_scan = self.auth.scan_output(
551
551
  tool_name=tool_name,
552
552
  output_content=output_text,
@@ -554,6 +554,18 @@ class LangProtectGateway:
554
554
  metadata={'server_name': server_name}
555
555
  )
556
556
 
557
+ # 🚨 CRITICAL: Check if backend blocked the request
558
+ if output_scan.get('status') == 'blocked' or output_scan.get('action') == 'blocked':
559
+ risk_score = output_scan.get('risk_score', 0)
560
+ severity = output_scan.get('severity', 'high')
561
+ logger.error(f"🚫 OUTPUT BLOCKED: {tool_name} (risk={risk_score}, severity={severity})")
562
+ raise ValueError(
563
+ f"Request blocked by security policy: {tool_name}\n"
564
+ f"Risk Score: {risk_score}\n"
565
+ f"Severity: {severity}\n"
566
+ f"This request was blocked because it would return sensitive data."
567
+ )
568
+
557
569
  if output_scan.get('masked'):
558
570
  # Replace output with masked version
559
571
  masked_text = output_scan.get('output', output_text)
@@ -33,7 +33,7 @@ def validate_credentials(url, email, password):
33
33
  # Prepare the request
34
34
  data = json.dumps({"email": email, "password": password}).encode('utf-8')
35
35
  req = urllib.request.Request(
36
- f"{url}/api/auth/login/",
36
+ f"{url}/v1/group-users/signin",
37
37
  data=data,
38
38
  headers={'Content-Type': 'application/json'}
39
39
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langprotect-mcp-gateway
3
- Version: 1.3.1
3
+ Version: 1.3.3
4
4
  Summary: Security gateway for Model Context Protocol (MCP) to protect AI tool interactions
5
5
  Author-email: LangProtect Security Team <security@langprotect.com>
6
6
  License: MIT
@@ -96,26 +96,53 @@ Run our automated setup command to configure VS Code, Cursor, or Claude Desktop
96
96
  langprotect-gateway-setup
97
97
  ```
98
98
 
99
- This will:
100
- - Create a global wrapper script at `~/.local/bin/langprotect-mcp-wrapper.sh`
101
- - ✅ Configure VS Code for global visibility in ALL workspaces
102
- - Enable auto-start for seamless protection
99
+ **What happens:**
100
+ - 🔐 **Prompts for credentials** interactively (password hidden)
101
+ - ✅ **Validates credentials** in real-time against your backend
102
+ - 🔄 **Retries on failure** with helpful error messages
103
+ - 📝 **Creates wrapper script** at `~/.local/bin/langprotect-mcp-wrapper.sh`
104
+ - ⚙️ **Configures VS Code** for global visibility in ALL workspaces
105
+ - 🚀 **Auto-start enabled** for seamless protection
103
106
 
104
- ### 3. Configure Your Credentials
107
+ **Example:**
108
+ ```bash
109
+ $ langprotect-gateway-setup
105
110
 
106
- Edit the generated wrapper script to add your LangProtect email and password:
111
+ 🚀 Setting up LangProtect MCP Gateway...
107
112
 
108
- ```bash
109
- # Linux/macOS
110
- nano ~/.local/bin/langprotect-mcp-wrapper.sh
113
+ ═══════════════════════════════════════════════════════════════
114
+ 🔐 Enter Your LangProtect Credentials
115
+ ═══════════════════════════════════════════════════════════════
116
+
117
+ Backend URL [http://localhost:8000]: http://localhost:8000
118
+ Email: your.email@company.com
119
+ Password: ●●●●●●●●●●
120
+
121
+ Validating credentials...
122
+ ✓ Credentials validated successfully!
111
123
 
112
- # Update these lines:
113
- export LANGPROTECT_URL="https://your-backend.com" # e.g. http://localhost:8000
124
+ 📝 Creating global wrapper script...
125
+ Created: ~/.local/bin/langprotect-mcp-wrapper.sh
126
+
127
+ ⚙️ Configuring VS Code...
128
+ ✅ Updated: ~/.config/Code/User/settings.json
129
+
130
+ ✅ Setup complete!
131
+ ```
132
+
133
+ **Alternative: Pre-set credentials via environment variables**
134
+ ```bash
135
+ export LANGPROTECT_URL="http://localhost:8000"
114
136
  export LANGPROTECT_EMAIL="your.email@company.com"
115
137
  export LANGPROTECT_PASSWORD="your-password"
138
+ langprotect-gateway-setup
116
139
  ```
117
140
 
118
- Reload VS Code and you're done! LangProtect will now protect all your workspaces.
141
+ ### 3. Reload VS Code
142
+
143
+ Press `Ctrl+Shift+P` → `Developer: Reload Window`
144
+
145
+ **That's it!** ✅ LangProtect will now protect all your workspaces.
119
146
 
120
147
  ---
121
148
 
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "langprotect-mcp-gateway"
7
- version = "1.3.1"
7
+ version = "1.3.3"
8
8
  description = "Security gateway for Model Context Protocol (MCP) to protect AI tool interactions"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"