mcp-proxy-adapter 6.9.18__py3-none-any.whl → 6.9.20__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/generate_config.py +75 -39
- mcp_proxy_adapter/main.py +3 -0
- mcp_proxy_adapter/version.py +1 -1
- {mcp_proxy_adapter-6.9.18.dist-info → mcp_proxy_adapter-6.9.20.dist-info}/METADATA +1 -1
- {mcp_proxy_adapter-6.9.18.dist-info → mcp_proxy_adapter-6.9.20.dist-info}/RECORD +8 -8
- {mcp_proxy_adapter-6.9.18.dist-info → mcp_proxy_adapter-6.9.20.dist-info}/WHEEL +0 -0
- {mcp_proxy_adapter-6.9.18.dist-info → mcp_proxy_adapter-6.9.20.dist-info}/entry_points.txt +0 -0
- {mcp_proxy_adapter-6.9.18.dist-info → mcp_proxy_adapter-6.9.20.dist-info}/top_level.txt +0 -0
@@ -20,7 +20,7 @@ from config_builder import generate_complete_config
|
|
20
20
|
|
21
21
|
# Import validation modules
|
22
22
|
try:
|
23
|
-
from mcp_proxy_adapter.core.config_validator import ConfigValidator
|
23
|
+
from mcp_proxy_adapter.core.config_validator import ConfigValidator
|
24
24
|
VALIDATION_AVAILABLE = True
|
25
25
|
except ImportError:
|
26
26
|
VALIDATION_AVAILABLE = False
|
@@ -57,8 +57,49 @@ def create_config_from_flags(
|
|
57
57
|
Returns:
|
58
58
|
Configuration dictionary
|
59
59
|
"""
|
60
|
-
#
|
61
|
-
|
60
|
+
# Start with basic configuration
|
61
|
+
config = generate_complete_config(host, port)
|
62
|
+
|
63
|
+
# Set protocol
|
64
|
+
config["server"]["protocol"] = protocol
|
65
|
+
|
66
|
+
# Configure SSL based on protocol
|
67
|
+
if protocol == "https":
|
68
|
+
config["ssl"]["enabled"] = True
|
69
|
+
config["ssl"]["cert_file"] = f"{cert_dir}/server.crt"
|
70
|
+
config["ssl"]["key_file"] = f"{key_dir}/server.key"
|
71
|
+
elif protocol == "mtls":
|
72
|
+
config["ssl"]["enabled"] = True
|
73
|
+
config["ssl"]["cert_file"] = f"{cert_dir}/server.crt"
|
74
|
+
config["ssl"]["key_file"] = f"{key_dir}/server.key"
|
75
|
+
config["ssl"]["ca_cert"] = f"{cert_dir}/ca.crt"
|
76
|
+
|
77
|
+
# Configure security if token authentication is enabled
|
78
|
+
if token:
|
79
|
+
config["security"]["enabled"] = True
|
80
|
+
config["security"]["tokens"] = {
|
81
|
+
"admin": "admin-secret-key",
|
82
|
+
"user": "user-secret-key",
|
83
|
+
"readonly": "readonly-secret-key"
|
84
|
+
}
|
85
|
+
|
86
|
+
if roles:
|
87
|
+
config["security"]["roles"] = {
|
88
|
+
"admin": ["read", "write", "delete", "admin"],
|
89
|
+
"user": ["read", "write"],
|
90
|
+
"readonly": ["read"]
|
91
|
+
}
|
92
|
+
config["security"]["roles_file"] = f"{output_dir}/roles.json"
|
93
|
+
config["roles"]["enabled"] = True
|
94
|
+
config["roles"]["config_file"] = f"{output_dir}/roles.json"
|
95
|
+
|
96
|
+
# Configure proxy registration if enabled
|
97
|
+
if proxy_registration or auto_registration:
|
98
|
+
config["proxy_registration"]["enabled"] = True
|
99
|
+
config["proxy_registration"]["proxy_url"] = proxy_url
|
100
|
+
config["proxy_registration"]["server_id"] = server_id
|
101
|
+
|
102
|
+
return config
|
62
103
|
|
63
104
|
|
64
105
|
def save_config(config: Dict[str, Any], filename: str, output_dir: str, validate: bool = True) -> Path:
|
@@ -80,13 +121,9 @@ def save_config(config: Dict[str, Any], filename: str, output_dir: str, validate
|
|
80
121
|
if results:
|
81
122
|
print("⚠️ Validation issues found:")
|
82
123
|
for result in results:
|
83
|
-
level_symbol =
|
84
|
-
ValidationLevel.ERROR: "❌",
|
85
|
-
ValidationLevel.WARNING: "⚠️",
|
86
|
-
ValidationLevel.INFO: "ℹ️"
|
87
|
-
}[result.level]
|
124
|
+
level_symbol = "❌" if result.level == "error" else "⚠️" if result.level == "warning" else "ℹ️"
|
88
125
|
print(f" {level_symbol} {result.message}")
|
89
|
-
if result.suggestion:
|
126
|
+
if hasattr(result, 'suggestion') and result.suggestion:
|
90
127
|
print(f" Suggestion: {result.suggestion}")
|
91
128
|
else:
|
92
129
|
print("✅ Configuration validation passed!")
|
@@ -106,15 +143,17 @@ def create_full_config_with_all_options(host: str = "127.0.0.1", port: int = 200
|
|
106
143
|
Returns:
|
107
144
|
Full configuration dictionary with all options
|
108
145
|
"""
|
109
|
-
|
146
|
+
# Start with basic configuration
|
147
|
+
config = generate_complete_config(host, port)
|
110
148
|
|
111
|
-
#
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
149
|
+
# Add protocol variants for easy switching
|
150
|
+
config["protocol_variants"] = {
|
151
|
+
"http": {"server": {"protocol": "http"}},
|
152
|
+
"https": {"server": {"protocol": "https"}},
|
153
|
+
"mtls": {"server": {"protocol": "mtls"}}
|
154
|
+
}
|
116
155
|
|
117
|
-
#
|
156
|
+
# Add authentication configurations for easy switching
|
118
157
|
api_keys = {
|
119
158
|
"admin": "admin-secret-key",
|
120
159
|
"user": "user-secret-key",
|
@@ -126,21 +165,6 @@ def create_full_config_with_all_options(host: str = "127.0.0.1", port: int = 200
|
|
126
165
|
"readonly": ["read"]
|
127
166
|
}
|
128
167
|
|
129
|
-
# Set up all authentication methods but keep security disabled
|
130
|
-
builder.set_auth(AuthMethod.TOKEN_ROLES, api_keys=api_keys, roles=roles)
|
131
|
-
|
132
|
-
# Disable security by default (will be enabled in tests)
|
133
|
-
config = builder.build()
|
134
|
-
config["security"]["enabled"] = False
|
135
|
-
|
136
|
-
# Add protocol variants for easy switching
|
137
|
-
config["protocol_variants"] = {
|
138
|
-
"http": {"server": {"protocol": "http"}},
|
139
|
-
"https": {"server": {"protocol": "https"}},
|
140
|
-
"mtls": {"server": {"protocol": "mtls"}}
|
141
|
-
}
|
142
|
-
|
143
|
-
# Add authentication configurations for easy switching
|
144
168
|
config["auth_variants"] = {
|
145
169
|
"none": {"security": {"enabled": False}},
|
146
170
|
"token": {
|
@@ -164,7 +188,7 @@ def create_full_config_with_all_options(host: str = "127.0.0.1", port: int = 200
|
|
164
188
|
return config
|
165
189
|
|
166
190
|
|
167
|
-
def generate_all_configs(output_dir: str = "./configs", host: str = "127.0.0.1") -> None:
|
191
|
+
def generate_all_configs(output_dir: str = "./configs", host: str = "127.0.0.1", validate: bool = True) -> None:
|
168
192
|
"""Generate all standard configurations."""
|
169
193
|
configs = [
|
170
194
|
# HTTP configurations
|
@@ -209,7 +233,7 @@ def generate_all_configs(output_dir: str = "./configs", host: str = "127.0.0.1")
|
|
209
233
|
)
|
210
234
|
|
211
235
|
# Save configuration with validation
|
212
|
-
config_file = save_config(config, config_name, output_dir, validate=
|
236
|
+
config_file = save_config(config, config_name, output_dir, validate=validate)
|
213
237
|
generated_files.append(config_file)
|
214
238
|
|
215
239
|
print(f"✅ Created {config_name}.json (port {port})")
|
@@ -338,18 +362,30 @@ Examples:
|
|
338
362
|
return 1
|
339
363
|
|
340
364
|
print(f"🔍 Validating configuration file: {config_file}")
|
341
|
-
validator = ConfigValidator(
|
342
|
-
validator.load_config()
|
343
|
-
validator.validate_config()
|
344
|
-
validator.print_validation_report()
|
365
|
+
validator = ConfigValidator()
|
366
|
+
validator.load_config(config_file)
|
367
|
+
results = validator.validate_config()
|
345
368
|
|
346
|
-
|
369
|
+
if results:
|
370
|
+
print("⚠️ Validation issues found:")
|
371
|
+
for result in results:
|
372
|
+
level_symbol = "❌" if result.level == "error" else "⚠️" if result.level == "warning" else "ℹ️"
|
373
|
+
print(f" {level_symbol} {result.message}")
|
374
|
+
if hasattr(result, 'suggestion') and result.suggestion:
|
375
|
+
print(f" Suggestion: {result.suggestion}")
|
376
|
+
else:
|
377
|
+
print("✅ Configuration validation passed!")
|
378
|
+
|
379
|
+
# Check if there are any errors
|
380
|
+
errors = [r for r in results if r.level == "error"] if results else []
|
381
|
+
return 0 if not errors else 1
|
347
382
|
|
348
383
|
elif args.all:
|
349
384
|
# Generate all configurations
|
350
385
|
generate_all_configs(
|
351
386
|
output_dir=args.output_dir,
|
352
|
-
host=args.host
|
387
|
+
host=args.host,
|
388
|
+
validate=not args.no_validate
|
353
389
|
)
|
354
390
|
elif args.full_config:
|
355
391
|
# Generate full config with all options
|
mcp_proxy_adapter/main.py
CHANGED
mcp_proxy_adapter/version.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: mcp-proxy-adapter
|
3
|
-
Version: 6.9.
|
3
|
+
Version: 6.9.20
|
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
|
@@ -2,9 +2,9 @@ mcp_proxy_adapter/__init__.py,sha256=iH0EBBsRj_cfZJpAIsgN_8tTdfefhnl6uUKHjLHhWDQ
|
|
2
2
|
mcp_proxy_adapter/__main__.py,sha256=sq3tANRuTd18euamt0Bmn1sJeAyzXENZ5VvsMwbrDFA,579
|
3
3
|
mcp_proxy_adapter/config.py,sha256=CSt0wiKz0GnN5sFKE2Sh8qspBb05bLl3ONMn79x_IF0,25410
|
4
4
|
mcp_proxy_adapter/custom_openapi.py,sha256=AgUQM0OwP5DZkOr7eDjro-Kpjn1y1kPF60Jzmp4Ovuc,28238
|
5
|
-
mcp_proxy_adapter/main.py,sha256=
|
5
|
+
mcp_proxy_adapter/main.py,sha256=FV1p-w_TTgdyfaVII5_VA8EAWnKCMmoR4nezcg2iSZg,10460
|
6
6
|
mcp_proxy_adapter/openapi.py,sha256=2UZOI09ZDRJuBYBjKbMyb2U4uASszoCMD5o_4ktRpvg,13480
|
7
|
-
mcp_proxy_adapter/version.py,sha256=
|
7
|
+
mcp_proxy_adapter/version.py,sha256=cU-yX-PaA0egHOSIRsMZ-BeRuLtW9wgyP4HPVao8arE,75
|
8
8
|
mcp_proxy_adapter/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
9
|
mcp_proxy_adapter/api/app.py,sha256=oyEK7GE-t8Dzt3_ZQDgxNAz48D3RscNLrY8syd2SjcA,39242
|
10
10
|
mcp_proxy_adapter/api/handlers.py,sha256=NTZk34hP1US3bvAl0Z0DDrOEQBNk5T7jkt9AatI-5rc,10074
|
@@ -95,7 +95,7 @@ mcp_proxy_adapter/examples/create_test_configs.py,sha256=9TrvLa4-bWLPu0SB1JXwWuC
|
|
95
95
|
mcp_proxy_adapter/examples/debug_request_state.py,sha256=Z3Gy2-fWtu7KIV9OkzGDLVz7TpL_h9V_99ica40uQBU,4489
|
96
96
|
mcp_proxy_adapter/examples/debug_role_chain.py,sha256=GLVXC2fJUwP8UJnXHchd1t-H53cjWLJI3RqTPrKmaak,8750
|
97
97
|
mcp_proxy_adapter/examples/demo_client.py,sha256=en2Rtb70B1sQmhL-vdQ4PDpKNNl_mfll2YCFT_jFCAg,10191
|
98
|
-
mcp_proxy_adapter/examples/generate_config.py,sha256=
|
98
|
+
mcp_proxy_adapter/examples/generate_config.py,sha256=XCJamcGQByoYBeqpR54uo4Z0wbXECH37dxLWqofpV5c,16656
|
99
99
|
mcp_proxy_adapter/examples/proxy_registration_example.py,sha256=Dz7ZQTmdgCgGxMqhKaJj-EJWmHb4BLav9nDTZHPSKmY,12995
|
100
100
|
mcp_proxy_adapter/examples/required_certificates.py,sha256=YW9-V78oFiZ-FmHlGP-8FQFS569VdDVyq9hfvCv31pk,7133
|
101
101
|
mcp_proxy_adapter/examples/run_example.py,sha256=yp-a6HIrSk3ddQmbn0KkuKwErId0aNfj028TE6U-zmY,2626
|
@@ -142,8 +142,8 @@ mcp_proxy_adapter/schemas/base_schema.json,sha256=v9G9cGMd4dRhCZsOQ_FMqOi5VFyVbI
|
|
142
142
|
mcp_proxy_adapter/schemas/openapi_schema.json,sha256=C3yLkwmDsvnLW9B5gnKKdBGl4zxkeU-rEmjTrNVsQU0,8405
|
143
143
|
mcp_proxy_adapter/schemas/roles.json,sha256=pgf_ZyqKyXbfGUxvobpiLiSJz9zzxrMuoVWEkEpz3N8,764
|
144
144
|
mcp_proxy_adapter/schemas/roles_schema.json,sha256=deHgI7L6GwfBXacOlNtDgDJelDThppClC3Ti4Eh8rJY,5659
|
145
|
-
mcp_proxy_adapter-6.9.
|
146
|
-
mcp_proxy_adapter-6.9.
|
147
|
-
mcp_proxy_adapter-6.9.
|
148
|
-
mcp_proxy_adapter-6.9.
|
149
|
-
mcp_proxy_adapter-6.9.
|
145
|
+
mcp_proxy_adapter-6.9.20.dist-info/METADATA,sha256=h_tPYHvipNnt2KjAkZmiloCRaeGPhzBBqu3sPLlt8eY,8511
|
146
|
+
mcp_proxy_adapter-6.9.20.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
147
|
+
mcp_proxy_adapter-6.9.20.dist-info/entry_points.txt,sha256=Bf-O5Aq80n22Ayu9fI9BgidzWqwzIVaqextAddTuHZw,563
|
148
|
+
mcp_proxy_adapter-6.9.20.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
|
149
|
+
mcp_proxy_adapter-6.9.20.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|