mcp-proxy-adapter 6.2.12__py3-none-any.whl → 6.2.13__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.
- mcp_proxy_adapter/examples/run_security_tests.py +79 -4
- {mcp_proxy_adapter-6.2.12.dist-info → mcp_proxy_adapter-6.2.13.dist-info}/METADATA +1 -1
- {mcp_proxy_adapter-6.2.12.dist-info → mcp_proxy_adapter-6.2.13.dist-info}/RECORD +6 -6
- {mcp_proxy_adapter-6.2.12.dist-info → mcp_proxy_adapter-6.2.13.dist-info}/WHEEL +0 -0
- {mcp_proxy_adapter-6.2.12.dist-info → mcp_proxy_adapter-6.2.13.dist-info}/licenses/LICENSE +0 -0
- {mcp_proxy_adapter-6.2.12.dist-info → mcp_proxy_adapter-6.2.13.dist-info}/top_level.txt +0 -0
@@ -26,6 +26,7 @@ class SecurityTestRunner:
|
|
26
26
|
def __init__(self):
|
27
27
|
"""Initialize test runner."""
|
28
28
|
self.servers = {}
|
29
|
+
self.proxy_server = None
|
29
30
|
self.test_results = {}
|
30
31
|
self.configs = {
|
31
32
|
"basic_http": {
|
@@ -121,6 +122,62 @@ class SecurityTestRunner:
|
|
121
122
|
process.wait()
|
122
123
|
except Exception as e:
|
123
124
|
print(f"❌ Error stopping {name} server: {e}")
|
125
|
+
|
126
|
+
def start_proxy_server(self) -> bool:
|
127
|
+
"""Start the proxy server for server registration."""
|
128
|
+
try:
|
129
|
+
print("🚀 Starting proxy server...")
|
130
|
+
# Find the proxy server script
|
131
|
+
proxy_script = Path(__file__).parent / "run_proxy_server.py"
|
132
|
+
if not proxy_script.exists():
|
133
|
+
print("❌ Proxy server script not found")
|
134
|
+
return False
|
135
|
+
|
136
|
+
# Start proxy server
|
137
|
+
cmd = [sys.executable, str(proxy_script), "--host", "127.0.0.1", "--port", "3004"]
|
138
|
+
process = subprocess.Popen(
|
139
|
+
cmd,
|
140
|
+
stdout=subprocess.PIPE,
|
141
|
+
stderr=subprocess.PIPE,
|
142
|
+
cwd=Path.cwd()
|
143
|
+
)
|
144
|
+
|
145
|
+
# Wait a bit for server to start
|
146
|
+
time.sleep(2)
|
147
|
+
|
148
|
+
# Check if process is still running
|
149
|
+
if process.poll() is None:
|
150
|
+
self.proxy_server = process
|
151
|
+
print("✅ Proxy server started successfully (PID: {})".format(process.pid))
|
152
|
+
return True
|
153
|
+
else:
|
154
|
+
stdout, stderr = process.communicate()
|
155
|
+
print("❌ Failed to start proxy server:")
|
156
|
+
print("STDOUT:", stdout.decode())
|
157
|
+
print("STDERR:", stderr.decode())
|
158
|
+
return False
|
159
|
+
|
160
|
+
except Exception as e:
|
161
|
+
print(f"❌ Error starting proxy server: {e}")
|
162
|
+
return False
|
163
|
+
|
164
|
+
def stop_proxy_server(self):
|
165
|
+
"""Stop the proxy server."""
|
166
|
+
if self.proxy_server:
|
167
|
+
try:
|
168
|
+
print("🛑 Stopping proxy server (PID: {})...".format(self.proxy_server.pid))
|
169
|
+
self.proxy_server.terminate()
|
170
|
+
try:
|
171
|
+
self.proxy_server.wait(timeout=5)
|
172
|
+
print("✅ Proxy server stopped")
|
173
|
+
except subprocess.TimeoutExpired:
|
174
|
+
print("⚠️ Force killing proxy server")
|
175
|
+
self.proxy_server.kill()
|
176
|
+
self.proxy_server.wait()
|
177
|
+
except Exception as e:
|
178
|
+
print(f"❌ Error stopping proxy server: {e}")
|
179
|
+
finally:
|
180
|
+
self.proxy_server = None
|
124
181
|
async def test_server(self, name: str, config: Dict[str, Any]) -> List[TestResult]:
|
125
182
|
"""Test a specific server configuration."""
|
126
183
|
print(f"\n🧪 Testing {name} server...")
|
@@ -219,11 +276,13 @@ class SecurityTestRunner:
|
|
219
276
|
elif total_passed > 0:
|
220
277
|
print("⚠️ SOME TESTS FAILED")
|
221
278
|
print("\n🔧 TROUBLESHOOTING:")
|
222
|
-
print("1. Check if
|
279
|
+
print("1. Check if proxy server is running:")
|
280
|
+
print(" python /path/to/run_proxy_server.py --host 127.0.0.1 --port 3004")
|
281
|
+
print("\n2. Check if certificates are generated:")
|
223
282
|
print(" python -m mcp_proxy_adapter.examples.generate_certificates")
|
224
|
-
print("\
|
283
|
+
print("\n3. Verify configuration files exist:")
|
225
284
|
print(" python -m mcp_proxy_adapter.examples.generate_test_configs --output-dir configs")
|
226
|
-
print("\
|
285
|
+
print("\n4. Check if ports are available (3004, 8000-8005)")
|
227
286
|
print("=" * 60)
|
228
287
|
else:
|
229
288
|
print("❌ ALL TESTS FAILED")
|
@@ -234,13 +293,18 @@ class SecurityTestRunner:
|
|
234
293
|
print(" python -m mcp_proxy_adapter.examples.generate_certificates")
|
235
294
|
print("\n3. Generate configurations:")
|
236
295
|
print(" python -m mcp_proxy_adapter.examples.generate_test_configs --output-dir configs")
|
296
|
+
print("\n4. Start proxy server manually if needed:")
|
297
|
+
print(" python /path/to/run_proxy_server.py --host 127.0.0.1 --port 3004")
|
237
298
|
print("=" * 60)
|
238
299
|
def cleanup(self):
|
239
|
-
"""Cleanup all running servers."""
|
300
|
+
"""Cleanup all running servers and proxy."""
|
240
301
|
print("\n🧹 Cleaning up...")
|
302
|
+
# Stop test servers
|
241
303
|
for name, process in self.servers.items():
|
242
304
|
self.stop_server(name, process)
|
243
305
|
self.servers.clear()
|
306
|
+
# Stop proxy server
|
307
|
+
self.stop_proxy_server()
|
244
308
|
def signal_handler(self, signum, frame):
|
245
309
|
"""Handle interrupt signals."""
|
246
310
|
print(f"\n⚠️ Received signal {signum}, cleaning up...")
|
@@ -255,6 +319,17 @@ class SecurityTestRunner:
|
|
255
319
|
# Check prerequisites
|
256
320
|
if not self.check_prerequisites():
|
257
321
|
return False
|
322
|
+
|
323
|
+
# Start proxy server first
|
324
|
+
print("\n🚀 Starting proxy server for server registration...")
|
325
|
+
if not self.start_proxy_server():
|
326
|
+
print("❌ Cannot proceed without proxy server")
|
327
|
+
return False
|
328
|
+
|
329
|
+
# Wait for proxy server to be fully ready
|
330
|
+
print("⏳ Waiting for proxy server to be ready...")
|
331
|
+
time.sleep(3)
|
332
|
+
|
258
333
|
# Run all tests
|
259
334
|
all_results = await self.run_all_tests()
|
260
335
|
# Print summary
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mcp-proxy-adapter
|
3
|
-
Version: 6.2.
|
3
|
+
Version: 6.2.13
|
4
4
|
Summary: Powerful JSON-RPC microservices framework with built-in security, authentication, and proxy registration
|
5
5
|
Home-page: https://github.com/maverikod/mcp-proxy-adapter
|
6
6
|
Author: Vasiliy Zdanovskiy
|
@@ -92,7 +92,7 @@ mcp_proxy_adapter/examples/generate_test_configs.py,sha256=JFPays1tluGFpvo8FLjpo
|
|
92
92
|
mcp_proxy_adapter/examples/proxy_registration_example.py,sha256=g59_QG2D1CCqhIXEvgy2XmgXI3toLmLyH7hL3uHZwC8,12647
|
93
93
|
mcp_proxy_adapter/examples/run_example.py,sha256=o8rcy9Xo0UuZG4MpKdex3pFWYdtAi6uW8dEBQE6Yzbw,2539
|
94
94
|
mcp_proxy_adapter/examples/run_proxy_server.py,sha256=MF5lWqARgeaQN0Eb27rdFquBdbTeSXJDz0kaJTQm62w,4959
|
95
|
-
mcp_proxy_adapter/examples/run_security_tests.py,sha256=
|
95
|
+
mcp_proxy_adapter/examples/run_security_tests.py,sha256=QL8sIfWBoPY3_HXmhiIupT9wmj9MvbT4Dhyhfk2_eIo,16070
|
96
96
|
mcp_proxy_adapter/examples/run_security_tests_fixed.py,sha256=fNQsbALf9548xJ0OGPKYx5Crzg1GbcL8CSh1x_oKu_A,10540
|
97
97
|
mcp_proxy_adapter/examples/security_test_client.py,sha256=eBy6pZ5Dhdo-qi_7Fk-IWGHq7zAJA-om8RBuOep4XSs,28022
|
98
98
|
mcp_proxy_adapter/examples/setup_test_environment.py,sha256=Y6oNaR95Rmn2csupYoGV-_mMF6AtqJ31vwLhY0TQtMk,11319
|
@@ -114,8 +114,8 @@ mcp_proxy_adapter/examples/full_application/commands/dynamic_calculator_command.
|
|
114
114
|
mcp_proxy_adapter/examples/full_application/hooks/__init__.py,sha256=ORG4cL8cSXEMmZ0CEPz75OVuwg54pdDm2GIBpP4dtcs,200
|
115
115
|
mcp_proxy_adapter/examples/full_application/hooks/application_hooks.py,sha256=TYXuHI-KW_mH5r8mSKgNMJCr3moeEKrqC4Eex0U298k,3457
|
116
116
|
mcp_proxy_adapter/examples/full_application/hooks/builtin_command_hooks.py,sha256=IaskSrckZS6bE3aGxSBL8aTj-iJTSI2ysfsFjhjncyM,2975
|
117
|
-
mcp_proxy_adapter-6.2.
|
118
|
-
mcp_proxy_adapter-6.2.
|
119
|
-
mcp_proxy_adapter-6.2.
|
120
|
-
mcp_proxy_adapter-6.2.
|
121
|
-
mcp_proxy_adapter-6.2.
|
117
|
+
mcp_proxy_adapter-6.2.13.dist-info/licenses/LICENSE,sha256=6KdtUcTwmTRbJrAmYjVn7e6S-V42ubeDJ-AiVEzZ510,1075
|
118
|
+
mcp_proxy_adapter-6.2.13.dist-info/METADATA,sha256=VJkvmYm2SiWL3vszld8SGPI7TJt06F75Xsfew6QFg3M,22199
|
119
|
+
mcp_proxy_adapter-6.2.13.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
120
|
+
mcp_proxy_adapter-6.2.13.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
|
121
|
+
mcp_proxy_adapter-6.2.13.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|