langprotect-mcp-gateway 1.2.0__tar.gz → 1.2.1__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.
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/PKG-INFO +1 -1
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/langprotect_mcp_gateway/__init__.py +1 -1
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/langprotect_mcp_gateway/gateway.py +31 -19
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/langprotect_mcp_gateway.egg-info/PKG-INFO +1 -1
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/pyproject.toml +1 -1
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/LICENSE +0 -0
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/README.md +0 -0
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/langprotect_mcp_gateway.egg-info/SOURCES.txt +0 -0
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/langprotect_mcp_gateway.egg-info/dependency_links.txt +0 -0
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/langprotect_mcp_gateway.egg-info/entry_points.txt +0 -0
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/langprotect_mcp_gateway.egg-info/requires.txt +0 -0
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/langprotect_mcp_gateway.egg-info/top_level.txt +0 -0
- {langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/setup.cfg +0 -0
{langprotect_mcp_gateway-1.2.0 → langprotect_mcp_gateway-1.2.1}/langprotect_mcp_gateway/gateway.py
RENAMED
|
@@ -169,26 +169,28 @@ class LangProtectGateway:
|
|
|
169
169
|
logger.debug(f"LANGPROTECT_EMAIL: {self.email}")
|
|
170
170
|
|
|
171
171
|
def _load_env_from_config(self, path: str):
|
|
172
|
-
"""Load credentials from mcp.json env section (Lasso
|
|
172
|
+
"""Load credentials from mcp.json env section (Lasso/VS Code style)"""
|
|
173
173
|
try:
|
|
174
174
|
expanded_path = os.path.expanduser(path)
|
|
175
175
|
with open(expanded_path, 'r') as f:
|
|
176
176
|
config = json.load(f)
|
|
177
177
|
|
|
178
178
|
# Look for env vars in the gateway's config section
|
|
179
|
-
|
|
180
|
-
for
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
179
|
+
# Check both mcpServers (Cursor/Claude) and servers (VS Code)
|
|
180
|
+
for top_key in ['mcpServers', 'servers']:
|
|
181
|
+
top_config = config.get(top_key, {})
|
|
182
|
+
for gateway_name in ['langprotect-gateway', 'langprotect', 'mcp-gateway']:
|
|
183
|
+
gateway_config = top_config.get(gateway_name, {})
|
|
184
|
+
env_section = gateway_config.get('env', {})
|
|
185
|
+
if env_section:
|
|
186
|
+
if not self.langprotect_url or self.langprotect_url == 'http://localhost:8000':
|
|
187
|
+
self.langprotect_url = env_section.get('LANGPROTECT_URL', self.langprotect_url)
|
|
188
|
+
if not self.email:
|
|
189
|
+
self.email = env_section.get('LANGPROTECT_EMAIL')
|
|
190
|
+
if not self.password:
|
|
191
|
+
self.password = env_section.get('LANGPROTECT_PASSWORD')
|
|
192
|
+
logger.info(f"Loaded credentials from config env section ({top_key}.{gateway_name})")
|
|
193
|
+
return
|
|
192
194
|
except Exception as e:
|
|
193
195
|
logger.debug(f"Could not load env from config: {e}")
|
|
194
196
|
|
|
@@ -237,13 +239,13 @@ class LangProtectGateway:
|
|
|
237
239
|
config = json.load(f)
|
|
238
240
|
|
|
239
241
|
# Try multiple config structures:
|
|
240
|
-
# 1.
|
|
241
|
-
# 2. VS Code
|
|
242
|
-
# 3.
|
|
242
|
+
# 1. Cursor/Claude: mcpServers.langprotect-gateway.servers (nested)
|
|
243
|
+
# 2. VS Code: servers.langprotect-gateway.servers (nested)
|
|
244
|
+
# 3. Direct: servers or mcpServers (flat)
|
|
243
245
|
|
|
244
246
|
servers = {}
|
|
245
247
|
|
|
246
|
-
# Check for
|
|
248
|
+
# Check for Cursor/Claude-style nested config (mcpServers.X.servers)
|
|
247
249
|
mcp_servers = config.get('mcpServers', {})
|
|
248
250
|
for gateway_name in ['langprotect-gateway', 'langprotect', 'mcp-gateway']:
|
|
249
251
|
gateway_config = mcp_servers.get(gateway_name, {})
|
|
@@ -252,7 +254,17 @@ class LangProtectGateway:
|
|
|
252
254
|
logger.info(f"Found nested servers config under mcpServers.{gateway_name}.servers")
|
|
253
255
|
break
|
|
254
256
|
|
|
255
|
-
#
|
|
257
|
+
# Check for VS Code-style nested config (servers.X.servers)
|
|
258
|
+
if not servers:
|
|
259
|
+
vscode_servers = config.get('servers', {})
|
|
260
|
+
for gateway_name in ['langprotect-gateway', 'langprotect', 'mcp-gateway']:
|
|
261
|
+
gateway_config = vscode_servers.get(gateway_name, {})
|
|
262
|
+
if 'servers' in gateway_config:
|
|
263
|
+
servers = gateway_config['servers']
|
|
264
|
+
logger.info(f"Found nested servers config under servers.{gateway_name}.servers")
|
|
265
|
+
break
|
|
266
|
+
|
|
267
|
+
# Fallback to direct/flat config
|
|
256
268
|
if not servers:
|
|
257
269
|
servers = config.get('servers', config.get('mcpServers', {}))
|
|
258
270
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "langprotect-mcp-gateway"
|
|
7
|
-
version = "1.2.
|
|
7
|
+
version = "1.2.1"
|
|
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"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|