langprotect-mcp-gateway 1.2.4__py3-none-any.whl → 1.2.6__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.
@@ -129,8 +129,16 @@ class LangProtectAuth:
129
129
  def scan(self, tool_name: str, arguments: Dict, server_name: str) -> Dict:
130
130
  self.ensure_token()
131
131
  try:
132
- payload = {'prompt': json.dumps({'tool': tool_name, 'arguments': arguments, 'server': server_name}), 'client_ip': '127.0.0.1', 'user_agent': f'LangProtect-MCP-Gateway/1.0 (server={server_name})', 'source': 'mcp-gateway'}
133
- response = requests.post(f"{self.url}/v1/group-logs/scan", json=payload, headers={'Authorization': f'Bearer {self.jwt_token}', 'Content-Type': 'application/json'}, timeout=5)
132
+ # Use MCP-specific endpoint with proper payload structure
133
+ payload = {
134
+ 'method': 'tools/call',
135
+ 'params': {'name': tool_name, 'arguments': arguments},
136
+ 'server_url': server_name,
137
+ 'agent_id': 'langprotect-gateway',
138
+ 'client_ip': '127.0.0.1',
139
+ 'user_agent': f'LangProtect-MCP-Gateway/1.0 (server={server_name})'
140
+ }
141
+ response = requests.post(f"{self.url}/v1/group-logs/mcp/scan", json=payload, headers={'Authorization': f'Bearer {self.jwt_token}', 'Content-Type': 'application/json'}, timeout=5)
134
142
  if response.status_code != 200:
135
143
  logger.warning(f"Backend returned {response.status_code}, allowing request (fail-open)")
136
144
  return {'status': 'allowed', 'error': f'Backend error: {response.status_code}'}
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: langprotect-mcp-gateway
3
- Version: 1.2.4
3
+ Version: 1.2.6
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
@@ -43,122 +43,49 @@ Dynamic: license-file
43
43
 
44
44
  ## Quick Start
45
45
 
46
- ### Installation
46
+ ### 1. Installation
47
47
 
48
- The gateway runs as a global CLI tool. Choose your platform:
49
-
50
- #### Linux (Debian/Ubuntu) - Recommended: pipx
48
+ The gateway runs as a global CLI tool. We recommend using `pipx` to manage the installation.
51
49
 
52
50
  ```bash
53
- # Install pipx (one time)
54
- sudo apt install pipx -y
55
- pipx ensurepath
56
-
57
- # Install the gateway
51
+ # Recommended: Install via pipx
58
52
  pipx install langprotect-mcp-gateway
59
53
  ```
60
54
 
61
- #### macOS - Recommended: pipx
62
-
63
- ```bash
64
- # Install pipx via Homebrew
65
- brew install pipx
66
- pipx ensurepath
67
-
68
- # Install the gateway
69
- pipx install langprotect-mcp-gateway
70
- ```
71
-
72
- #### Windows
73
-
74
- ```bash
75
- # Option 1: pipx (recommended)
76
- pip install pipx
77
- pipx install langprotect-mcp-gateway
78
-
79
- # Option 2: User install
80
- pip install --user langprotect-mcp-gateway
81
- ```
55
+ ### 2. Automatic Setup (Recommended) 🚀
82
56
 
83
- #### Verify Installation
84
-
85
- ```bash
86
- which langprotect-gateway # Should show: ~/.local/bin/langprotect-gateway
87
- langprotect-gateway --help # Should show usage info
88
- ```
89
-
90
- #### Automatic Setup (Recommended)
91
-
92
- Run the setup command to automatically configure VS Code:
57
+ Run our automated setup command to configure VS Code, Cursor, or Claude Desktop for all workspaces:
93
58
 
94
59
  ```bash
95
60
  langprotect-gateway-setup
96
61
  ```
97
62
 
98
63
  This will:
99
- - ✅ Create a global wrapper script
100
- - ✅ Configure VS Code to use LangProtect in ALL workspaces
101
- - ✅ Enable auto-start
64
+ - ✅ Create a global wrapper script at `~/.local/bin/langprotect-mcp-wrapper.sh`
65
+ - ✅ Configure VS Code for global visibility in ALL workspaces
66
+ - ✅ Enable auto-start for seamless protection
67
+
68
+ ### 3. Configure Your Credentials
102
69
 
103
- Then edit the wrapper script to add your credentials:
70
+ Edit the generated wrapper script to add your LangProtect email and password:
104
71
 
105
72
  ```bash
106
73
  # Linux/macOS
107
74
  nano ~/.local/bin/langprotect-mcp-wrapper.sh
108
75
 
109
76
  # Update these lines:
110
- export LANGPROTECT_URL="http://localhost:8000"
77
+ export LANGPROTECT_URL="https://your-backend.com" # e.g. http://localhost:8000
111
78
  export LANGPROTECT_EMAIL="your.email@company.com"
112
79
  export LANGPROTECT_PASSWORD="your-password"
113
80
  ```
114
81
 
115
- Reload VS Code and you're done! LangProtect will protect all your workspaces.
116
-
117
- ### VS Code Setup (Recommended - No Wrapper Script!)
118
-
119
- **Step 1:** Add this to your `.vscode/mcp.json`:
120
-
121
- ```json
122
- {
123
- "servers": {
124
- "langprotect-gateway": {
125
- "type": "stdio",
126
- "command": "langprotect-gateway",
127
- "args": ["--mcp-json-path", "${workspaceFolder}/.vscode/mcp.json"],
128
- "env": {
129
- "LANGPROTECT_URL": "http://localhost:8000",
130
- "LANGPROTECT_EMAIL": "your.email@company.com",
131
- "LANGPROTECT_PASSWORD": "your-password"
132
- },
133
- "servers": {
134
- "filesystem": {
135
- "command": "npx",
136
- "args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
137
- }
138
- }
139
- }
140
- }
141
- }
142
- ```
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!
82
+ Reload VS Code and you're done! LangProtect will now protect all your workspaces.
153
83
 
154
- That's it! VS Code will:
155
- 1. Start the gateway with your credentials (automatically if autostart is enabled)
156
- 2. Gateway reads the `servers` section and proxies those MCP servers
157
- 3. All tool calls get logged to LangProtect
84
+ ---
158
85
 
159
- ### Alternative: Wrapper Script Setup
86
+ ## 🏗️ Manual Setup (Per-Workspace)
160
87
 
161
- If you prefer using a wrapper script (useful for shared configs):
88
+ If you prefer to enable LangProtect only for a specific project, you can use a local `.vscode/mcp.json` file.
162
89
 
163
90
  1. Create a wrapper script (e.g., `langprotect-wrapper.sh`):
164
91
 
@@ -0,0 +1,9 @@
1
+ langprotect_mcp_gateway/__init__.py,sha256=PedabfF6wZ_6KxuN60A4qz8T1gD9MszuXwhmrHlGH7I,510
2
+ langprotect_mcp_gateway/gateway.py,sha256=5J56nE5-o9jjnci3vLJqhem2nrxlVD89TjRg4aNHUqE,18718
3
+ langprotect_mcp_gateway/setup_helper.py,sha256=ghErneMTua9wPATMq8eatnviVAYJMi2bf2UUt8fnXE8,5639
4
+ langprotect_mcp_gateway-1.2.6.dist-info/licenses/LICENSE,sha256=aoVP65gKtirVmFPToow5L9IKN4FNjfM6Sejq_5b4cbM,1082
5
+ langprotect_mcp_gateway-1.2.6.dist-info/METADATA,sha256=XFOp4rxnB1WSgZ1n5Ga4dfk0nJJ2t2ySngg7b9iWm5o,8985
6
+ langprotect_mcp_gateway-1.2.6.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
7
+ langprotect_mcp_gateway-1.2.6.dist-info/entry_points.txt,sha256=HpnUUuYLQva8b6gazUX0UJO9dFHq86e9gifQfLKpyWc,140
8
+ langprotect_mcp_gateway-1.2.6.dist-info/top_level.txt,sha256=UjNlX13ma4nwJXuEyi9eMX251c5rooeEao4zajX6ZHk,24
9
+ langprotect_mcp_gateway-1.2.6.dist-info/RECORD,,
@@ -1,9 +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/setup_helper.py,sha256=ghErneMTua9wPATMq8eatnviVAYJMi2bf2UUt8fnXE8,5639
4
- langprotect_mcp_gateway-1.2.4.dist-info/licenses/LICENSE,sha256=aoVP65gKtirVmFPToow5L9IKN4FNjfM6Sejq_5b4cbM,1082
5
- langprotect_mcp_gateway-1.2.4.dist-info/METADATA,sha256=CTrmPgGbJC42Wmtzx2iMv4_Nm7nBDsXdHqz2n2y37Fs,10388
6
- langprotect_mcp_gateway-1.2.4.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
7
- langprotect_mcp_gateway-1.2.4.dist-info/entry_points.txt,sha256=HpnUUuYLQva8b6gazUX0UJO9dFHq86e9gifQfLKpyWc,140
8
- langprotect_mcp_gateway-1.2.4.dist-info/top_level.txt,sha256=UjNlX13ma4nwJXuEyi9eMX251c5rooeEao4zajX6ZHk,24
9
- langprotect_mcp_gateway-1.2.4.dist-info/RECORD,,