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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langprotect-mcp-gateway
3
- Version: 1.2.0
3
+ Version: 1.2.1
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
@@ -14,7 +14,7 @@ Or via command line:
14
14
  langprotect-gateway
15
15
  """
16
16
 
17
- __version__ = '1.2.0'
17
+ __version__ = '1.2.1'
18
18
  __author__ = 'LangProtect Security Team'
19
19
  __license__ = 'MIT'
20
20
 
@@ -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-style)"""
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
- mcp_servers = config.get('mcpServers', {})
180
- for gateway_name in ['langprotect-gateway', 'langprotect', 'mcp-gateway']:
181
- gateway_config = mcp_servers.get(gateway_name, {})
182
- env_section = gateway_config.get('env', {})
183
- if env_section:
184
- if not self.langprotect_url or self.langprotect_url == 'http://localhost:8000':
185
- self.langprotect_url = env_section.get('LANGPROTECT_URL', self.langprotect_url)
186
- if not self.email:
187
- self.email = env_section.get('LANGPROTECT_EMAIL')
188
- if not self.password:
189
- self.password = env_section.get('LANGPROTECT_PASSWORD')
190
- logger.info(f"Loaded credentials from config env section")
191
- break
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. Lasso-style: mcpServers.langprotect-gateway.servers (nested)
241
- # 2. VS Code style: servers (direct)
242
- # 3. Claude Desktop style: mcpServers (direct)
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 Lasso-style nested config
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
- # Fallback to direct config
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langprotect-mcp-gateway
3
- Version: 1.2.0
3
+ Version: 1.2.1
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
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "langprotect-mcp-gateway"
7
- version = "1.2.0"
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"