mcp-proxy-adapter 6.2.26__py3-none-any.whl → 6.2.27__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.
@@ -9,7 +9,11 @@ import json
9
9
  import os
10
10
  import argparse
11
11
  from typing import Dict, Any
12
- def generate_http_simple_config(port: int = 20000, certs_dir: str = "certs", keys_dir: str = "keys") -> Dict[str, Any]:
12
+
13
+
14
+ def generate_http_simple_config(
15
+ port: int = 20000, certs_dir: str = "certs", keys_dir: str = "keys"
16
+ ) -> Dict[str, Any]:
13
17
  """Generate HTTP configuration without authorization."""
14
18
  return {
15
19
  "server": {"host": "127.0.0.1", "port": port},
@@ -23,13 +27,27 @@ def generate_http_simple_config(port: int = 20000, certs_dir: str = "certs", key
23
27
  "proxy_info": {
24
28
  "name": "mcp_example_server",
25
29
  "capabilities": ["jsonrpc", "rest", "proxy_registration"],
26
- "endpoints": {"jsonrpc": "/api/jsonrpc", "rest": "/cmd", "health": "/health"}
30
+ "endpoints": {
31
+ "jsonrpc": "/api/jsonrpc",
32
+ "rest": "/cmd",
33
+ "health": "/health"
34
+ }
27
35
  },
28
36
  "heartbeat": {"enabled": True, "interval": 30}
29
37
  },
30
- "protocols": {"enabled": True, "allowed_protocols": ["http"]}
38
+ "protocols": {
39
+ "enabled": True,
40
+ "allowed_protocols": ["http"]
41
+ }
31
42
  }
32
- def generate_http_token_config(port: int = 20001, certs_dir: str = "certs", keys_dir: str = "keys", roles_file: str = "configs/roles.json") -> Dict[str, Any]:
43
+
44
+
45
+ def generate_http_token_config(
46
+ port: int = 20001,
47
+ certs_dir: str = "certs",
48
+ keys_dir: str = "keys",
49
+ roles_file: str = "configs/roles.json"
50
+ ) -> Dict[str, Any]:
33
51
  """Generate HTTP configuration with token authorization."""
34
52
  return {
35
53
  "server": {"host": "127.0.0.1", "port": port},
@@ -59,9 +77,16 @@ def generate_http_token_config(port: int = 20001, certs_dir: str = "certs", keys
59
77
  "retry_delay": 5,
60
78
  "heartbeat": {"enabled": True, "interval": 30}
61
79
  },
62
- "protocols": {"enabled": True, "allowed_protocols": ["http"]}
80
+ "protocols": {
81
+ "enabled": True,
82
+ "allowed_protocols": ["http"]
83
+ }
63
84
  }
64
- def generate_https_simple_config(port: int = 20002, certs_dir: str = "certs", keys_dir: str = "keys") -> Dict[str, Any]:
85
+
86
+
87
+ def generate_https_simple_config(
88
+ port: int = 20002, certs_dir: str = "certs", keys_dir: str = "keys"
89
+ ) -> Dict[str, Any]:
65
90
  """Generate HTTPS configuration without client certificate verification and authorization."""
66
91
  return {
67
92
  "server": {"host": "127.0.0.1", "port": port},
@@ -80,9 +105,16 @@ def generate_https_simple_config(port: int = 20002, certs_dir: str = "certs", ke
80
105
  "retry_delay": 5,
81
106
  "heartbeat": {"enabled": True, "interval": 30}
82
107
  },
83
- "protocols": {"enabled": True, "allowed_protocols": ["http", "https"]}
108
+ "protocols": {
109
+ "enabled": True,
110
+ "allowed_protocols": ["http", "https"]
111
+ }
84
112
  }
85
- def generate_https_token_config(port: int = 20003, certs_dir: str = "certs", keys_dir: str = "keys") -> Dict[str, Any]:
113
+
114
+
115
+ def generate_https_token_config(
116
+ port: int = 20003, certs_dir: str = "certs", keys_dir: str = "keys"
117
+ ) -> Dict[str, Any]:
86
118
  """Generate HTTPS configuration without client certificate verification with token authorization."""
87
119
  return {
88
120
  "server": {"host": "127.0.0.1", "port": port},
@@ -115,9 +147,16 @@ def generate_https_token_config(port: int = 20003, certs_dir: str = "certs", key
115
147
  "retry_delay": 5,
116
148
  "heartbeat": {"enabled": True, "interval": 30}
117
149
  },
118
- "protocols": {"enabled": True, "allowed_protocols": ["http", "https"]}
150
+ "protocols": {
151
+ "enabled": True,
152
+ "allowed_protocols": ["http", "https"]
153
+ }
119
154
  }
120
- def generate_mtls_no_roles_config(port: int = 20004, certs_dir: str = "certs", keys_dir: str = "keys") -> Dict[str, Any]:
155
+
156
+
157
+ def generate_mtls_no_roles_config(
158
+ port: int = 20004, certs_dir: str = "certs", keys_dir: str = "keys"
159
+ ) -> Dict[str, Any]:
121
160
  """Generate mTLS configuration without roles."""
122
161
  return {
123
162
  "server": {"host": "127.0.0.1", "port": port},
@@ -126,16 +165,30 @@ def generate_mtls_no_roles_config(port: int = 20004, certs_dir: str = "certs", k
126
165
  "cert_file": f"{certs_dir}/localhost_server.crt",
127
166
  "key_file": f"{keys_dir}/localhost_server.key",
128
167
  "ca_cert": f"{certs_dir}/mcp_proxy_adapter_ca_ca.crt",
129
- "verify_client": True
168
+ "verify_client": True,
169
+ "client_cert_required": True
130
170
  },
131
171
  "security": {
132
172
  "enabled": True,
133
173
  "auth": {"enabled": True, "methods": ["certificate"]},
134
174
  "permissions": {"enabled": False}
135
175
  },
136
- "protocols": {"enabled": True, "allowed_protocols": ["https", "mtls"]}
176
+ "registration": {
177
+ "enabled": False
178
+ },
179
+ "protocols": {
180
+ "enabled": True,
181
+ "allowed_protocols": ["https", "mtls"]
182
+ }
137
183
  }
138
- def generate_mtls_with_roles_config(port: int = 20005, certs_dir: str = "certs", keys_dir: str = "keys", roles_file: str = "configs/roles.json") -> Dict[str, Any]:
184
+
185
+
186
+ def generate_mtls_with_roles_config(
187
+ port: int = 20005,
188
+ certs_dir: str = "certs",
189
+ keys_dir: str = "keys",
190
+ roles_file: str = "configs/roles.json"
191
+ ) -> Dict[str, Any]:
139
192
  """Generate mTLS configuration with roles."""
140
193
  return {
141
194
  "server": {"host": "127.0.0.1", "port": port},
@@ -154,7 +207,11 @@ def generate_mtls_with_roles_config(port: int = 20005, certs_dir: str = "certs",
154
207
  "proxy_info": {
155
208
  "name": "mcp_example_server",
156
209
  "capabilities": ["jsonrpc", "rest", "security", "proxy_registration"],
157
- "endpoints": {"jsonrpc": "/api/jsonrpc", "rest": "/cmd", "health": "/health"}
210
+ "endpoints": {
211
+ "jsonrpc": "/api/jsonrpc",
212
+ "rest": "/cmd",
213
+ "health": "/health"
214
+ }
158
215
  },
159
216
  "heartbeat": {"enabled": True, "interval": 30}
160
217
  },
@@ -163,8 +220,13 @@ def generate_mtls_with_roles_config(port: int = 20005, certs_dir: str = "certs",
163
220
  "auth": {"enabled": True, "methods": ["certificate"]},
164
221
  "permissions": {"enabled": True, "roles_file": roles_file}
165
222
  },
166
- "protocols": {"enabled": True, "allowed_protocols": ["https", "mtls"]}
223
+ "protocols": {
224
+ "enabled": True,
225
+ "allowed_protocols": ["https", "mtls"]
226
+ }
167
227
  }
228
+
229
+
168
230
  def generate_roles_config() -> Dict[str, Any]:
169
231
  """Generate roles configuration for testing."""
170
232
  return {
@@ -222,7 +284,14 @@ def generate_roles_config() -> Dict[str, Any]:
222
284
  "tokens": ["proxy-token-123"]
223
285
  }
224
286
  }
225
- def generate_all_configs(output_dir: str, certs_dir: str = "certs", keys_dir: str = "keys", roles_file: str = "configs/roles.json") -> None:
287
+
288
+
289
+ def generate_all_configs(
290
+ output_dir: str,
291
+ certs_dir: str = "certs",
292
+ keys_dir: str = "keys",
293
+ roles_file: str = "configs/roles.json"
294
+ ) -> None:
226
295
  """Generate all 6 configuration types and save them to files."""
227
296
  # Ensure output directory exists first
228
297
  os.makedirs(output_dir, exist_ok=True)
@@ -235,17 +304,17 @@ def generate_all_configs(output_dir: str, certs_dir: str = "certs", keys_dir: st
235
304
  "mtls_no_roles": generate_mtls_no_roles_config(20004, certs_dir, keys_dir),
236
305
  "mtls_with_roles": generate_mtls_with_roles_config(20005, certs_dir, keys_dir, roles_file)
237
306
  }
238
- # Ensure output directory exists
239
- os.makedirs(output_dir, exist_ok=True)
307
+
240
308
  # Generate each configuration
241
309
  for name, config in configs.items():
242
310
  filename = os.path.join(output_dir, f"{name}.json")
243
311
  with open(filename, 'w', encoding='utf-8') as f:
244
312
  json.dump(config, f, indent=2, ensure_ascii=False)
245
313
  print(f"Generated: {filename}")
314
+
246
315
  # Generate roles configuration
247
316
  roles_config = generate_roles_config()
248
-
317
+
249
318
  # Create roles.json in the root directory (test environment root) for compatibility
250
319
  # When running as module, we need to create roles.json in the current working directory
251
320
  # This is the directory where the user is running the command from
@@ -253,30 +322,30 @@ def generate_all_configs(output_dir: str, certs_dir: str = "certs", keys_dir: st
253
322
  # Get the current working directory where the user is running the command
254
323
  current_dir = os.getcwd()
255
324
  root_roles_filename = os.path.join(current_dir, "roles.json")
256
-
325
+
257
326
  # Create roles.json in the current working directory
258
327
  with open(root_roles_filename, 'w', encoding='utf-8') as f:
259
328
  json.dump(roles_config, f, indent=2, ensure_ascii=False)
260
329
  print(f"Generated: {root_roles_filename}")
261
-
330
+
262
331
  # Also create a copy in the output directory for reference
263
332
  backup_roles_filename = os.path.join(output_dir, "roles_backup.json")
264
333
  with open(backup_roles_filename, 'w', encoding='utf-8') as f:
265
334
  json.dump(roles_config, f, indent=2, ensure_ascii=False)
266
335
  print(f"Generated backup: {backup_roles_filename}")
267
-
336
+
268
337
  except Exception as e:
269
338
  print(f"Warning: Could not create roles.json in current directory: {e}")
270
339
  print(f"Current working directory: {os.getcwd()}")
271
340
  print(f"Script directory: {os.path.dirname(os.path.abspath(__file__))}")
272
-
341
+
273
342
  # Also create roles.json in configs directory for reference
274
343
  roles_filename = os.path.join(output_dir, "roles.json")
275
344
  with open(roles_filename, 'w', encoding='utf-8') as f:
276
345
  json.dump(roles_config, f, indent=2, ensure_ascii=False)
277
346
  print(f"Generated: {roles_filename}")
278
347
  print(f"\nGenerated {len(configs)} configuration files and roles.json in {output_dir}")
279
-
348
+
280
349
  print("\n" + "=" * 60)
281
350
  print("✅ CONFIGURATION GENERATION COMPLETED SUCCESSFULLY")
282
351
  print("=" * 60)
@@ -288,7 +357,9 @@ def generate_all_configs(output_dir: str, certs_dir: str = "certs", keys_dir: st
288
357
  print("\n3. Start full application example:")
289
358
  print(" python -m mcp_proxy_adapter.examples.full_application.main --config configs/mtls_with_roles.json")
290
359
  print("=" * 60)
291
- def main():
360
+
361
+
362
+ def main() -> int:
292
363
  """Main function for command line execution."""
293
364
  parser = argparse.ArgumentParser(
294
365
  description="Generate test configurations for MCP Proxy Adapter"
@@ -314,6 +385,7 @@ def main():
314
385
  help="Roles file path (default: configs/roles.json)"
315
386
  )
316
387
  args = parser.parse_args()
388
+
317
389
  try:
318
390
  generate_all_configs(args.output_dir, args.certs_dir, args.keys_dir, args.roles_file)
319
391
  print("Configuration generation completed successfully!")
@@ -327,5 +399,7 @@ def main():
327
399
  print("=" * 60)
328
400
  return 1
329
401
  return 0
402
+
403
+
330
404
  if __name__ == "__main__":
331
405
  exit(main())
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-proxy-adapter
3
- Version: 6.2.26
3
+ Version: 6.2.27
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
@@ -88,7 +88,7 @@ mcp_proxy_adapter/examples/demo_client.py,sha256=inic-FP5qG8oQXUaCrtEhmhac_PDZ1p
88
88
  mcp_proxy_adapter/examples/generate_all_certificates.py,sha256=rgcwqIkQ1eDfEIRFRXGIOz-jOSS1w0GPBRhYvMl6Vjc,16948
89
89
  mcp_proxy_adapter/examples/generate_certificates.py,sha256=A34OHUEiFvINOHrm3_JiDSbp-WG-eQXIvKCsE8JAeXQ,6616
90
90
  mcp_proxy_adapter/examples/generate_certificates_and_tokens.py,sha256=J0qHm_BMY8RYqfuwf7V7xKsHcsRJx8E7x-8JxmW5sPw,15988
91
- mcp_proxy_adapter/examples/generate_test_configs.py,sha256=NLhPrA9AfPlQ0WCbOJ1B_V9OC445tanKTmq7aAWKULU,13672
91
+ mcp_proxy_adapter/examples/generate_test_configs.py,sha256=OQjLJ0x1YrvYAFR1agu_Tl314KI_Mhjmo4o64H00wVw,14132
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_full_test_suite.py,sha256=7Z6qDOvbndGPue1P9v-GcYZxy_XPqoC9voJ7tR8eKQ8,12428
@@ -132,9 +132,9 @@ mcp_proxy_adapter/examples/scripts/config_generator.py,sha256=4qruYxQ2kGLVOukLX2
132
132
  mcp_proxy_adapter/examples/scripts/create_certificates_simple.py,sha256=xkIvUYl6hbKlWImQmenG0k_CvIsOsc9ZHICiKY3rtI8,26380
133
133
  mcp_proxy_adapter/examples/scripts/generate_certificates_and_tokens.py,sha256=J0qHm_BMY8RYqfuwf7V7xKsHcsRJx8E7x-8JxmW5sPw,15988
134
134
  mcp_proxy_adapter/utils/config_generator.py,sha256=2dxwBh9k_nUw9kgytZso5TNOQpBqd3c-RpKSTLoHlLE,46465
135
- mcp_proxy_adapter-6.2.26.dist-info/licenses/LICENSE,sha256=6KdtUcTwmTRbJrAmYjVn7e6S-V42ubeDJ-AiVEzZ510,1075
136
- mcp_proxy_adapter-6.2.26.dist-info/METADATA,sha256=mDyAz2q3ZwP_HqgYHcE5RyhkIYP7i78KwcH_6jniqpg,22348
137
- mcp_proxy_adapter-6.2.26.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
138
- mcp_proxy_adapter-6.2.26.dist-info/entry_points.txt,sha256=J3eV6ID0lt_VSp4lIdIgBFTqLCThgObNNxRCbyfiMHw,70
139
- mcp_proxy_adapter-6.2.26.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
140
- mcp_proxy_adapter-6.2.26.dist-info/RECORD,,
135
+ mcp_proxy_adapter-6.2.27.dist-info/licenses/LICENSE,sha256=6KdtUcTwmTRbJrAmYjVn7e6S-V42ubeDJ-AiVEzZ510,1075
136
+ mcp_proxy_adapter-6.2.27.dist-info/METADATA,sha256=IrXoUBV-RR8hYdbUxWaeLPgacoo_c_8xoi0z_XJMzog,22348
137
+ mcp_proxy_adapter-6.2.27.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
138
+ mcp_proxy_adapter-6.2.27.dist-info/entry_points.txt,sha256=J3eV6ID0lt_VSp4lIdIgBFTqLCThgObNNxRCbyfiMHw,70
139
+ mcp_proxy_adapter-6.2.27.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
140
+ mcp_proxy_adapter-6.2.27.dist-info/RECORD,,