langprotect-mcp-gateway 1.2.1__py3-none-any.whl → 1.2.3__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.
@@ -0,0 +1,137 @@
1
+ #!/usr/bin/env python3
2
+ """
3
+ LangProtect MCP Gateway Setup Helper
4
+ Automatically configures VS Code for global MCP gateway usage
5
+ """
6
+
7
+ import os
8
+ import json
9
+ import sys
10
+ from pathlib import Path
11
+
12
+
13
+ def get_vscode_settings_path():
14
+ """Get the VS Code user settings path based on OS"""
15
+ home = Path.home()
16
+
17
+ if sys.platform == "darwin": # macOS
18
+ return home / "Library/Application Support/Code/User/settings.json"
19
+ elif sys.platform == "win32": # Windows
20
+ return home / "AppData/Roaming/Code/User/settings.json"
21
+ else: # Linux
22
+ return home / ".config/Code/User/settings.json"
23
+
24
+
25
+ def create_wrapper_script():
26
+ """Create the global wrapper script"""
27
+ wrapper_dir = Path.home() / ".local/bin"
28
+ wrapper_dir.mkdir(parents=True, exist_ok=True)
29
+
30
+ wrapper_path = wrapper_dir / "langprotect-mcp-wrapper.sh"
31
+
32
+ wrapper_content = """#!/bin/bash
33
+ # LangProtect MCP Gateway Wrapper
34
+ # This wrapper allows global configuration for all VS Code workspaces
35
+
36
+ # Configure these environment variables with your LangProtect credentials
37
+ export LANGPROTECT_URL="${LANGPROTECT_URL:-http://localhost:8000}"
38
+ export LANGPROTECT_EMAIL="${LANGPROTECT_EMAIL:-your.email@company.com}"
39
+ export LANGPROTECT_PASSWORD="${LANGPROTECT_PASSWORD:-your-password}"
40
+ export MCP_SERVER_COMMAND="${MCP_SERVER_COMMAND:-npx}"
41
+ export MCP_SERVER_ARGS="${MCP_SERVER_ARGS:--y,@modelcontextprotocol/server-filesystem,.}"
42
+
43
+ exec langprotect-gateway "$@"
44
+ """
45
+
46
+ wrapper_path.write_text(wrapper_content)
47
+ wrapper_path.chmod(0o755)
48
+
49
+ return wrapper_path
50
+
51
+
52
+ def update_vscode_settings(wrapper_path):
53
+ """Update VS Code settings to use the wrapper"""
54
+ settings_path = get_vscode_settings_path()
55
+
56
+ # Create directory if it doesn't exist
57
+ settings_path.parent.mkdir(parents=True, exist_ok=True)
58
+
59
+ # Read existing settings or create new
60
+ if settings_path.exists():
61
+ with open(settings_path, 'r') as f:
62
+ try:
63
+ settings = json.load(f)
64
+ except json.JSONDecodeError:
65
+ settings = {}
66
+ else:
67
+ settings = {}
68
+
69
+ # Add MCP configuration
70
+ if "chat.mcp.servers" not in settings:
71
+ settings["chat.mcp.servers"] = {}
72
+
73
+ settings["chat.mcp.servers"]["langprotect-gateway"] = {
74
+ "type": "stdio",
75
+ "command": str(wrapper_path),
76
+ "args": []
77
+ }
78
+
79
+ # Enable auto-start
80
+ settings["chat.mcp.autostart"] = "newAndOutdated"
81
+
82
+ # Write back
83
+ with open(settings_path, 'w') as f:
84
+ json.dump(settings, f, indent=2)
85
+
86
+ return settings_path
87
+
88
+
89
+ def setup():
90
+ """Main setup function"""
91
+ print("🚀 Setting up LangProtect MCP Gateway...")
92
+ print()
93
+
94
+ # Create wrapper script
95
+ print("📝 Creating global wrapper script...")
96
+ wrapper_path = create_wrapper_script()
97
+ print(f" ✅ Created: {wrapper_path}")
98
+ print()
99
+
100
+ # Update VS Code settings
101
+ print("⚙️ Configuring VS Code...")
102
+ try:
103
+ settings_path = update_vscode_settings(wrapper_path)
104
+ print(f" ✅ Updated: {settings_path}")
105
+ print()
106
+ except Exception as e:
107
+ print(f" ⚠️ Could not update VS Code settings: {e}")
108
+ print(f" You can manually add the configuration later.")
109
+ print()
110
+
111
+ # Print next steps
112
+ print("✅ Setup complete!")
113
+ print()
114
+ print("📋 Next steps:")
115
+ print()
116
+ print("1. Configure your credentials:")
117
+ print(f" Edit: {wrapper_path}")
118
+ print(" Set LANGPROTECT_URL, LANGPROTECT_EMAIL, and LANGPROTECT_PASSWORD")
119
+ print()
120
+ print("2. Reload VS Code:")
121
+ print(" Press Ctrl+Shift+P → 'Developer: Reload Window'")
122
+ print()
123
+ print("3. Verify it's working:")
124
+ print(" Press Ctrl+Shift+P → 'MCP: List Servers'")
125
+ print(" You should see 'langprotect-gateway' listed")
126
+ print()
127
+ print("🎉 LangProtect will now protect ALL your VS Code workspaces!")
128
+ print()
129
+ print("💡 Tip: You can also set credentials via environment variables:")
130
+ print(" export LANGPROTECT_URL=http://localhost:8000")
131
+ print(" export LANGPROTECT_EMAIL=your.email@company.com")
132
+ print(" export LANGPROTECT_PASSWORD=your-password")
133
+ print()
134
+
135
+
136
+ if __name__ == "__main__":
137
+ setup()
@@ -1,11 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langprotect-mcp-gateway
3
- Version: 1.2.1
3
+ Version: 1.2.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
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
@@ -87,14 +87,42 @@ which langprotect-gateway # Should show: ~/.local/bin/langprotect-gateway
87
87
  langprotect-gateway --help # Should show usage info
88
88
  ```
89
89
 
90
+ #### Automatic Setup (Recommended)
91
+
92
+ Run the setup command to automatically configure VS Code:
93
+
94
+ ```bash
95
+ langprotect-gateway-setup
96
+ ```
97
+
98
+ This will:
99
+ - ✅ Create a global wrapper script
100
+ - ✅ Configure VS Code to use LangProtect in ALL workspaces
101
+ - ✅ Enable auto-start
102
+
103
+ Then edit the wrapper script to add your credentials:
104
+
105
+ ```bash
106
+ # Linux/macOS
107
+ nano ~/.local/bin/langprotect-mcp-wrapper.sh
108
+
109
+ # Update these lines:
110
+ export LANGPROTECT_URL="http://localhost:8000"
111
+ export LANGPROTECT_EMAIL="your.email@company.com"
112
+ export LANGPROTECT_PASSWORD="your-password"
113
+ ```
114
+
115
+ Reload VS Code and you're done! LangProtect will protect all your workspaces.
116
+
90
117
  ### VS Code Setup (Recommended - No Wrapper Script!)
91
118
 
92
- Just add this to your `.vscode/mcp.json`:
119
+ **Step 1:** Add this to your `.vscode/mcp.json`:
93
120
 
94
121
  ```json
95
122
  {
96
- "mcpServers": {
123
+ "servers": {
97
124
  "langprotect-gateway": {
125
+ "type": "stdio",
98
126
  "command": "langprotect-gateway",
99
127
  "args": ["--mcp-json-path", "${workspaceFolder}/.vscode/mcp.json"],
100
128
  "env": {
@@ -113,8 +141,18 @@ Just add this to your `.vscode/mcp.json`:
113
141
  }
114
142
  ```
115
143
 
144
+ **Step 2 (Optional):** Enable auto-start in `.vscode/settings.json`:
145
+
146
+ ```json
147
+ {
148
+ "chat.mcp.autostart": "newAndOutdated"
149
+ }
150
+ ```
151
+
152
+ This makes VS Code automatically start the gateway when you open the workspace!
153
+
116
154
  That's it! VS Code will:
117
- 1. Start the gateway with your credentials
155
+ 1. Start the gateway with your credentials (automatically if autostart is enabled)
118
156
  2. Gateway reads the `servers` section and proxies those MCP servers
119
157
  3. All tool calls get logged to LangProtect
120
158
 
@@ -318,7 +356,7 @@ pipx install langprotect-mcp-gateway==1.1.0 --force
318
356
 
319
357
  ## Support
320
358
 
321
- - **Documentation:** https://docs.langprotect.com
359
+ - **Documentation:** https://www.langprotect.com/docs
322
360
  - **Issues:** https://github.com/langprotect/mcp-gateway/issues
323
361
  - **Security:** security@langprotect.com
324
362
 
@@ -328,6 +366,6 @@ MIT License - see LICENSE file for details
328
366
 
329
367
  ## Links
330
368
 
331
- - **Homepage:** https://langprotect.com
369
+ - **Homepage:** https://www.langprotect.com/
332
370
  - **GitHub:** https://github.com/langprotect/mcp-gateway
333
- - **Documentation:** https://docs.langprotect.com
371
+ - **Documentation:** https://www.langprotect.com/docs
@@ -0,0 +1,9 @@
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/setup_helper.py,sha256=Ao3nkQZk4LYRBqcX9d7T3eb1WtIpNbIYPZ1G897Wa00,4249
4
+ langprotect_mcp_gateway-1.2.3.dist-info/licenses/LICENSE,sha256=aoVP65gKtirVmFPToow5L9IKN4FNjfM6Sejq_5b4cbM,1082
5
+ langprotect_mcp_gateway-1.2.3.dist-info/METADATA,sha256=7TCJ5kpLfoLEmH1xac-rzg0e5grgri6BN1q-8jB0BX0,10388
6
+ langprotect_mcp_gateway-1.2.3.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
7
+ langprotect_mcp_gateway-1.2.3.dist-info/entry_points.txt,sha256=HpnUUuYLQva8b6gazUX0UJO9dFHq86e9gifQfLKpyWc,140
8
+ langprotect_mcp_gateway-1.2.3.dist-info/top_level.txt,sha256=UjNlX13ma4nwJXuEyi9eMX251c5rooeEao4zajX6ZHk,24
9
+ langprotect_mcp_gateway-1.2.3.dist-info/RECORD,,
@@ -0,0 +1,3 @@
1
+ [console_scripts]
2
+ langprotect-gateway = langprotect_mcp_gateway:main
3
+ langprotect-gateway-setup = langprotect_mcp_gateway.setup_helper:setup
@@ -1,8 +0,0 @@
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.1.dist-info/licenses/LICENSE,sha256=aoVP65gKtirVmFPToow5L9IKN4FNjfM6Sejq_5b4cbM,1082
4
- langprotect_mcp_gateway-1.2.1.dist-info/METADATA,sha256=2FuCEnwemmeGBQvgHe9CZKkYsOmCwyo60ePonIymV-o,9452
5
- langprotect_mcp_gateway-1.2.1.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
6
- langprotect_mcp_gateway-1.2.1.dist-info/entry_points.txt,sha256=iM5-7ReYo6_nFF-2DHK1cSi1Nj6wGsG4QqJgcNZ7_GE,69
7
- langprotect_mcp_gateway-1.2.1.dist-info/top_level.txt,sha256=UjNlX13ma4nwJXuEyi9eMX251c5rooeEao4zajX6ZHk,24
8
- langprotect_mcp_gateway-1.2.1.dist-info/RECORD,,
@@ -1,2 +0,0 @@
1
- [console_scripts]
2
- langprotect-gateway = langprotect_mcp_gateway:main