langprotect-mcp-gateway 1.2.5__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.
- langprotect_mcp_gateway/gateway.py +10 -2
- {langprotect_mcp_gateway-1.2.5.dist-info → langprotect_mcp_gateway-1.2.6.dist-info}/METADATA +16 -90
- langprotect_mcp_gateway-1.2.6.dist-info/RECORD +9 -0
- langprotect_mcp_gateway-1.2.5.dist-info/RECORD +0 -9
- {langprotect_mcp_gateway-1.2.5.dist-info → langprotect_mcp_gateway-1.2.6.dist-info}/WHEEL +0 -0
- {langprotect_mcp_gateway-1.2.5.dist-info → langprotect_mcp_gateway-1.2.6.dist-info}/entry_points.txt +0 -0
- {langprotect_mcp_gateway-1.2.5.dist-info → langprotect_mcp_gateway-1.2.6.dist-info}/licenses/LICENSE +0 -0
- {langprotect_mcp_gateway-1.2.5.dist-info → langprotect_mcp_gateway-1.2.6.dist-info}/top_level.txt +0 -0
|
@@ -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
|
-
|
|
133
|
-
|
|
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}'}
|
{langprotect_mcp_gateway-1.2.5.dist-info → langprotect_mcp_gateway-1.2.6.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: langprotect-mcp-gateway
|
|
3
|
-
Version: 1.2.
|
|
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,123 +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.
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
64
|
+
- ✅ Create a global wrapper script at `~/.local/bin/langprotect-mcp-wrapper.sh`
|
|
100
65
|
- ✅ Configure VS Code for global visibility in ALL workspaces
|
|
101
|
-
- ✅
|
|
102
|
-
|
|
66
|
+
- ✅ Enable auto-start for seamless protection
|
|
67
|
+
|
|
68
|
+
### 3. Configure Your Credentials
|
|
103
69
|
|
|
104
|
-
|
|
70
|
+
Edit the generated wrapper script to add your LangProtect email and password:
|
|
105
71
|
|
|
106
72
|
```bash
|
|
107
73
|
# Linux/macOS
|
|
108
74
|
nano ~/.local/bin/langprotect-mcp-wrapper.sh
|
|
109
75
|
|
|
110
76
|
# Update these lines:
|
|
111
|
-
export LANGPROTECT_URL="http://localhost:8000
|
|
77
|
+
export LANGPROTECT_URL="https://your-backend.com" # e.g. http://localhost:8000
|
|
112
78
|
export LANGPROTECT_EMAIL="your.email@company.com"
|
|
113
79
|
export LANGPROTECT_PASSWORD="your-password"
|
|
114
80
|
```
|
|
115
81
|
|
|
116
|
-
Reload VS Code and you're done! LangProtect will protect all your workspaces.
|
|
117
|
-
|
|
118
|
-
### VS Code Setup (Recommended - No Wrapper Script!)
|
|
119
|
-
|
|
120
|
-
**Step 1:** Add this to your `.vscode/mcp.json`:
|
|
121
|
-
|
|
122
|
-
```json
|
|
123
|
-
{
|
|
124
|
-
"servers": {
|
|
125
|
-
"langprotect-gateway": {
|
|
126
|
-
"type": "stdio",
|
|
127
|
-
"command": "langprotect-gateway",
|
|
128
|
-
"args": ["--mcp-json-path", "${workspaceFolder}/.vscode/mcp.json"],
|
|
129
|
-
"env": {
|
|
130
|
-
"LANGPROTECT_URL": "http://localhost:8000",
|
|
131
|
-
"LANGPROTECT_EMAIL": "your.email@company.com",
|
|
132
|
-
"LANGPROTECT_PASSWORD": "your-password"
|
|
133
|
-
},
|
|
134
|
-
"servers": {
|
|
135
|
-
"filesystem": {
|
|
136
|
-
"command": "npx",
|
|
137
|
-
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
**Step 2 (Optional):** Enable auto-start in `.vscode/settings.json`:
|
|
146
|
-
|
|
147
|
-
```json
|
|
148
|
-
{
|
|
149
|
-
"chat.mcp.autostart": "newAndOutdated"
|
|
150
|
-
}
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
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.
|
|
154
83
|
|
|
155
|
-
|
|
156
|
-
1. Start the gateway with your credentials (automatically if autostart is enabled)
|
|
157
|
-
2. Gateway reads the `servers` section and proxies those MCP servers
|
|
158
|
-
3. All tool calls get logged to LangProtect
|
|
84
|
+
---
|
|
159
85
|
|
|
160
|
-
|
|
86
|
+
## 🏗️ Manual Setup (Per-Workspace)
|
|
161
87
|
|
|
162
|
-
If you prefer
|
|
88
|
+
If you prefer to enable LangProtect only for a specific project, you can use a local `.vscode/mcp.json` file.
|
|
163
89
|
|
|
164
90
|
1. Create a wrapper script (e.g., `langprotect-wrapper.sh`):
|
|
165
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.5.dist-info/licenses/LICENSE,sha256=aoVP65gKtirVmFPToow5L9IKN4FNjfM6Sejq_5b4cbM,1082
|
|
5
|
-
langprotect_mcp_gateway-1.2.5.dist-info/METADATA,sha256=Zkq7OkBvzjL2MdJz7M-Ev5lJHa8GcGJmcEGJdRnCyjk,10452
|
|
6
|
-
langprotect_mcp_gateway-1.2.5.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
|
|
7
|
-
langprotect_mcp_gateway-1.2.5.dist-info/entry_points.txt,sha256=HpnUUuYLQva8b6gazUX0UJO9dFHq86e9gifQfLKpyWc,140
|
|
8
|
-
langprotect_mcp_gateway-1.2.5.dist-info/top_level.txt,sha256=UjNlX13ma4nwJXuEyi9eMX251c5rooeEao4zajX6ZHk,24
|
|
9
|
-
langprotect_mcp_gateway-1.2.5.dist-info/RECORD,,
|
|
File without changes
|
{langprotect_mcp_gateway-1.2.5.dist-info → langprotect_mcp_gateway-1.2.6.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{langprotect_mcp_gateway-1.2.5.dist-info → langprotect_mcp_gateway-1.2.6.dist-info}/licenses/LICENSE
RENAMED
|
File without changes
|
{langprotect_mcp_gateway-1.2.5.dist-info → langprotect_mcp_gateway-1.2.6.dist-info}/top_level.txt
RENAMED
|
File without changes
|