langprotect-mcp-gateway 1.2.0__py3-none-any.whl → 1.2.2__py3-none-any.whl

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.
@@ -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,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langprotect-mcp-gateway
3
- Version: 1.2.0
3
+ Version: 1.2.2
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
7
- Project-URL: Homepage, https://langprotect.com
8
- Project-URL: Documentation, https://docs.langprotect.com
7
+ Project-URL: Homepage, https://www.langprotect.com/
8
+ Project-URL: Documentation, https://www.langprotect.com/docs
9
9
  Project-URL: Repository, https://github.com/langprotect/mcp-gateway
10
10
  Project-URL: Issues, https://github.com/langprotect/mcp-gateway/issues
11
11
  Keywords: mcp,security,ai-security,langprotect,model-context-protocol
@@ -89,12 +89,13 @@ langprotect-gateway --help # Should show usage info
89
89
 
90
90
  ### VS Code Setup (Recommended - No Wrapper Script!)
91
91
 
92
- Just add this to your `.vscode/mcp.json`:
92
+ **Step 1:** Add this to your `.vscode/mcp.json`:
93
93
 
94
94
  ```json
95
95
  {
96
- "mcpServers": {
96
+ "servers": {
97
97
  "langprotect-gateway": {
98
+ "type": "stdio",
98
99
  "command": "langprotect-gateway",
99
100
  "args": ["--mcp-json-path", "${workspaceFolder}/.vscode/mcp.json"],
100
101
  "env": {
@@ -113,8 +114,18 @@ Just add this to your `.vscode/mcp.json`:
113
114
  }
114
115
  ```
115
116
 
117
+ **Step 2 (Optional):** Enable auto-start in `.vscode/settings.json`:
118
+
119
+ ```json
120
+ {
121
+ "chat.mcp.autostart": "newAndOutdated"
122
+ }
123
+ ```
124
+
125
+ This makes VS Code automatically start the gateway when you open the workspace!
126
+
116
127
  That's it! VS Code will:
117
- 1. Start the gateway with your credentials
128
+ 1. Start the gateway with your credentials (automatically if autostart is enabled)
118
129
  2. Gateway reads the `servers` section and proxies those MCP servers
119
130
  3. All tool calls get logged to LangProtect
120
131
 
@@ -318,7 +329,7 @@ pipx install langprotect-mcp-gateway==1.1.0 --force
318
329
 
319
330
  ## Support
320
331
 
321
- - **Documentation:** https://docs.langprotect.com
332
+ - **Documentation:** https://www.langprotect.com/docs
322
333
  - **Issues:** https://github.com/langprotect/mcp-gateway/issues
323
334
  - **Security:** security@langprotect.com
324
335
 
@@ -328,6 +339,6 @@ MIT License - see LICENSE file for details
328
339
 
329
340
  ## Links
330
341
 
331
- - **Homepage:** https://langprotect.com
342
+ - **Homepage:** https://www.langprotect.com/
332
343
  - **GitHub:** https://github.com/langprotect/mcp-gateway
333
- - **Documentation:** https://docs.langprotect.com
344
+ - **Documentation:** https://www.langprotect.com/docs
@@ -0,0 +1,8 @@
1
+ langprotect_mcp_gateway/__init__.py,sha256=PedabfF6wZ_6KxuN60A4qz8T1gD9MszuXwhmrHlGH7I,510
2
+ langprotect_mcp_gateway/gateway.py,sha256=yViBgOivHJQx99JiTB1O-Q3zHTkDkn7ldzTw7x-BpMQ,18508
3
+ langprotect_mcp_gateway-1.2.2.dist-info/licenses/LICENSE,sha256=aoVP65gKtirVmFPToow5L9IKN4FNjfM6Sejq_5b4cbM,1082
4
+ langprotect_mcp_gateway-1.2.2.dist-info/METADATA,sha256=14NRx8ISFI_RTrak2mUsywtj0LYn87TtgQxPtJSCTZI,9750
5
+ langprotect_mcp_gateway-1.2.2.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
6
+ langprotect_mcp_gateway-1.2.2.dist-info/entry_points.txt,sha256=iM5-7ReYo6_nFF-2DHK1cSi1Nj6wGsG4QqJgcNZ7_GE,69
7
+ langprotect_mcp_gateway-1.2.2.dist-info/top_level.txt,sha256=UjNlX13ma4nwJXuEyi9eMX251c5rooeEao4zajX6ZHk,24
8
+ langprotect_mcp_gateway-1.2.2.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- langprotect_mcp_gateway/__init__.py,sha256=zci-MauGyCKv6bMWizCKd-CkrVaAft57ia8kzdTflEY,510
2
- langprotect_mcp_gateway/gateway.py,sha256=fFliQVSxV8ZCOO4vg0Y466BYlRnKKI1XQlT6P_VHmQ4,17660
3
- langprotect_mcp_gateway-1.2.0.dist-info/licenses/LICENSE,sha256=aoVP65gKtirVmFPToow5L9IKN4FNjfM6Sejq_5b4cbM,1082
4
- langprotect_mcp_gateway-1.2.0.dist-info/METADATA,sha256=Nno8XPMpwwvJn7HoQKd27EDxXzXQyaj6by4gxpd_Y7M,9452
5
- langprotect_mcp_gateway-1.2.0.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
6
- langprotect_mcp_gateway-1.2.0.dist-info/entry_points.txt,sha256=iM5-7ReYo6_nFF-2DHK1cSi1Nj6wGsG4QqJgcNZ7_GE,69
7
- langprotect_mcp_gateway-1.2.0.dist-info/top_level.txt,sha256=UjNlX13ma4nwJXuEyi9eMX251c5rooeEao4zajX6ZHk,24
8
- langprotect_mcp_gateway-1.2.0.dist-info/RECORD,,