mcp-proxy-adapter 6.4.48__py3-none-any.whl → 6.6.1__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/api/middleware/unified_security.py +8 -12
- mcp_proxy_adapter/config.py +76 -117
- mcp_proxy_adapter/core/protocol_manager.py +25 -42
- mcp_proxy_adapter/core/security_integration.py +60 -97
- mcp_proxy_adapter/core/server_adapter.py +4 -0
- mcp_proxy_adapter/examples/check_config.py +415 -0
- mcp_proxy_adapter/examples/config_builder.py +142 -428
- mcp_proxy_adapter/examples/config_builder_simple.py +271 -0
- mcp_proxy_adapter/examples/generate_config.py +343 -0
- mcp_proxy_adapter/examples/run_security_tests_fixed.py +186 -23
- mcp_proxy_adapter/examples/security_test_client.py +21 -7
- mcp_proxy_adapter/examples/test_chk_hostname_automated.py +214 -0
- mcp_proxy_adapter/examples/test_config_builder.py +40 -0
- mcp_proxy_adapter/main.py +54 -27
- mcp_proxy_adapter/version.py +1 -1
- {mcp_proxy_adapter-6.4.48.dist-info → mcp_proxy_adapter-6.6.1.dist-info}/METADATA +1 -1
- {mcp_proxy_adapter-6.4.48.dist-info → mcp_proxy_adapter-6.6.1.dist-info}/RECORD +20 -16
- {mcp_proxy_adapter-6.4.48.dist-info → mcp_proxy_adapter-6.6.1.dist-info}/WHEEL +0 -0
- {mcp_proxy_adapter-6.4.48.dist-info → mcp_proxy_adapter-6.6.1.dist-info}/entry_points.txt +0 -0
- {mcp_proxy_adapter-6.4.48.dist-info → mcp_proxy_adapter-6.6.1.dist-info}/top_level.txt +0 -0
mcp_proxy_adapter/main.py
CHANGED
@@ -59,24 +59,41 @@ def main():
|
|
59
59
|
host = config.get("server.host", "0.0.0.0")
|
60
60
|
port = config.get("server.port", 8000)
|
61
61
|
|
62
|
-
# Get SSL configuration
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
#
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
62
|
+
# Get protocol and SSL configuration
|
63
|
+
protocol = config.get("server.protocol", "http")
|
64
|
+
ssl_enabled = protocol in ["https", "mtls"]
|
65
|
+
|
66
|
+
# SSL configuration based on protocol
|
67
|
+
ssl_cert_file = None
|
68
|
+
ssl_key_file = None
|
69
|
+
ssl_ca_cert = None
|
70
|
+
verify_client = False
|
71
|
+
|
72
|
+
if ssl_enabled:
|
73
|
+
# Configure SSL based on protocol
|
74
|
+
if protocol == "https":
|
75
|
+
# HTTPS - server SSL only
|
76
|
+
ssl_cert_file = "../../certs/server.crt"
|
77
|
+
ssl_key_file = "../../certs/server.key"
|
78
|
+
ssl_ca_cert = "../../certs/localhost_server.crt"
|
79
|
+
verify_client = False
|
80
|
+
|
81
|
+
elif protocol == "mtls":
|
82
|
+
# mTLS - server SSL + client certificate verification
|
83
|
+
# Use server.crt and server.key for server, and localhost_server.crt as CA
|
84
|
+
ssl_cert_file = "../../certs/server.crt"
|
85
|
+
ssl_key_file = "../../certs/server.key"
|
86
|
+
ssl_ca_cert = "../../certs/localhost_server.crt"
|
87
|
+
verify_client = False # Disable client cert verification for testing
|
88
|
+
|
89
|
+
print("🔍 Debug config:")
|
90
|
+
print(f" protocol: {protocol}")
|
71
91
|
print(f" ssl_enabled: {ssl_enabled}")
|
72
|
-
print(
|
73
|
-
print(f" ssl_key_file: {ssl_key_file}")
|
74
|
-
print(f" ssl_ca_cert: {ssl_ca_cert}")
|
75
|
-
print(f" verify_client: {verify_client}")
|
76
|
-
print("🔍 Source: configuration (hardcode disabled)")
|
92
|
+
print("🔍 Source: configuration")
|
77
93
|
|
78
94
|
print("🚀 Starting MCP Proxy Adapter")
|
79
95
|
print(f"🌐 Server: {host}:{port}")
|
96
|
+
print(f"🔒 Protocol: {protocol}")
|
80
97
|
if ssl_enabled:
|
81
98
|
print("🔐 SSL: Enabled")
|
82
99
|
print(f" Certificate: {ssl_cert_file}")
|
@@ -86,26 +103,36 @@ def main():
|
|
86
103
|
print(f" Client verification: {verify_client}")
|
87
104
|
print("=" * 50)
|
88
105
|
|
89
|
-
# Configure hypercorn
|
106
|
+
# Configure hypercorn using framework
|
90
107
|
config_hypercorn = hypercorn.config.Config()
|
91
108
|
config_hypercorn.bind = [f"{host}:{port}"]
|
92
109
|
|
93
110
|
if ssl_enabled and ssl_cert_file and ssl_key_file:
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
111
|
+
# Use framework to convert SSL configuration
|
112
|
+
from mcp_proxy_adapter.core.server_adapter import ServerConfigAdapter
|
113
|
+
|
114
|
+
ssl_config = {
|
115
|
+
"cert_file": ssl_cert_file,
|
116
|
+
"key_file": ssl_key_file,
|
117
|
+
"ca_cert": ssl_ca_cert,
|
118
|
+
"verify_client": verify_client,
|
119
|
+
"chk_hostname": config.get("transport.ssl.chk_hostname", True)
|
120
|
+
}
|
121
|
+
|
122
|
+
hypercorn_ssl = ServerConfigAdapter.convert_ssl_config_for_engine(ssl_config, "hypercorn")
|
123
|
+
|
124
|
+
# Apply converted SSL configuration
|
125
|
+
for key, value in hypercorn_ssl.items():
|
126
|
+
setattr(config_hypercorn, key, value)
|
127
|
+
|
128
|
+
print("🔐 SSL: Configured via framework")
|
100
129
|
if verify_client:
|
101
|
-
# For mTLS, require client certificates
|
102
|
-
config_hypercorn.verify_mode = ssl.CERT_REQUIRED
|
103
130
|
print("🔐 mTLS: Client certificate verification enabled")
|
104
131
|
else:
|
105
|
-
print(
|
106
|
-
|
107
|
-
|
108
|
-
|
132
|
+
print("🔐 HTTPS: Regular HTTPS without client certificate verification")
|
133
|
+
|
134
|
+
chk_hostname = ssl_config.get("chk_hostname", True)
|
135
|
+
print(f"🔍 Hostname checking: {'enabled' if chk_hostname else 'disabled'}")
|
109
136
|
|
110
137
|
# Prefer modern protocols
|
111
138
|
try:
|
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.
|
3
|
+
Version: 6.6.1
|
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
|
@@ -1,10 +1,10 @@
|
|
1
1
|
mcp_proxy_adapter/__init__.py,sha256=iH0EBBsRj_cfZJpAIsgN_8tTdfefhnl6uUKHjLHhWDQ,1037
|
2
2
|
mcp_proxy_adapter/__main__.py,sha256=sq3tANRuTd18euamt0Bmn1sJeAyzXENZ5VvsMwbrDFA,579
|
3
|
-
mcp_proxy_adapter/config.py,sha256
|
3
|
+
mcp_proxy_adapter/config.py,sha256=NmwYJPfnAFWmGsOlyYkMDfuqA-SeduuvTSjZKJbzbKc,20424
|
4
4
|
mcp_proxy_adapter/custom_openapi.py,sha256=XRviX-C-ZkSKdBhORhDTdeN_1FWyEfXZADiASft3t9I,28149
|
5
|
-
mcp_proxy_adapter/main.py,sha256=
|
5
|
+
mcp_proxy_adapter/main.py,sha256=I9fYgMD8_RNYuSHn-paeTSr9coAuVlEkfLaWeYbZors,5724
|
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=Mh_TTmFK-EgbYu8AwRu8Ax1MTsScWluXVsIKkST5imU,74
|
8
8
|
mcp_proxy_adapter/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
9
|
mcp_proxy_adapter/api/app.py,sha256=cxjavhNTtaYg2ea-UeHSDnKh8edKVNQ2NbXUDYbufFU,34183
|
10
10
|
mcp_proxy_adapter/api/handlers.py,sha256=X-hcMNVeTAu4yVkKJEChEsj2bFptUS6sLNN-Wysjkow,10011
|
@@ -20,7 +20,7 @@ mcp_proxy_adapter/api/middleware/logging.py,sha256=iME87hrbvyTjI-RJro5Cwao7VlHUI
|
|
20
20
|
mcp_proxy_adapter/api/middleware/performance.py,sha256=-EvA7YIcTlxn8RuxlWlScJvX2EIoeEp3P5dKVWZHYRY,2357
|
21
21
|
mcp_proxy_adapter/api/middleware/protocol_middleware.py,sha256=lFqGuT5M-USCTIVvZMH6Fgh3hxQNAmAoDeyYOBPpcbk,9161
|
22
22
|
mcp_proxy_adapter/api/middleware/transport_middleware.py,sha256=VG1rWyuh-O2pdc0kQ3SADFvyh286o5Wrnkt8OFQ0WQw,4274
|
23
|
-
mcp_proxy_adapter/api/middleware/unified_security.py,sha256=
|
23
|
+
mcp_proxy_adapter/api/middleware/unified_security.py,sha256=QX4WUde03-T002Z3TgzhX0Tj2x7BFULOvOkCftsWqw8,8114
|
24
24
|
mcp_proxy_adapter/api/middleware/user_info_middleware.py,sha256=-N6cZOc7z6FUE7xRZ8xGgI4PnMyrJq0Jzpde9VNq6Zs,11077
|
25
25
|
mcp_proxy_adapter/commands/__init__.py,sha256=eStfu2UrLfMvMTY6x20GD8sMPmPB1so-0QZQYV53nqo,1565
|
26
26
|
mcp_proxy_adapter/commands/auth_validation_command.py,sha256=p4UrAaHyoCxMy98G1BUUlFJWjoelEJzX3OAWIiQaGls,14593
|
@@ -68,14 +68,14 @@ mcp_proxy_adapter/core/logging.py,sha256=gNI6vfPQC7jrUtVu6NeDsmU72JPlrRRBhtJipL1
|
|
68
68
|
mcp_proxy_adapter/core/mtls_asgi.py,sha256=tvk0P9024s18dcCHY9AaQIecT4ojOTv21EuQWXwooU0,5200
|
69
69
|
mcp_proxy_adapter/core/mtls_asgi_app.py,sha256=DT_fTUH1RkvBa3ThbyCyNb-XUHyCb4DqaKA1gcZC6z4,6538
|
70
70
|
mcp_proxy_adapter/core/mtls_server.py,sha256=_hj6QWuExKX2LRohYvjPGFC2qTutS7ObegpEc09QijM,10117
|
71
|
-
mcp_proxy_adapter/core/protocol_manager.py,sha256=
|
71
|
+
mcp_proxy_adapter/core/protocol_manager.py,sha256=iaXWsfm1XSfemz5QQBesMluc4cwf-LtuZVi9bm1uj28,14680
|
72
72
|
mcp_proxy_adapter/core/proxy_client.py,sha256=CB6KBhV3vH2GU5nZ27VZ_xlNbYTAU_tnYFrkuK5He58,6094
|
73
73
|
mcp_proxy_adapter/core/proxy_registration.py,sha256=m58w9iQd5zwXFIpuaDRXKPQ3fhQDBJPkD4w7m742ciY,35200
|
74
74
|
mcp_proxy_adapter/core/role_utils.py,sha256=YwRenGoXI5YrHVbFjKFAH2DJs2miyqhcr9LWF7mxieg,12284
|
75
75
|
mcp_proxy_adapter/core/security_adapter.py,sha256=MAtNthsp7Qj4-oLFzSi7Pr3vWQbWS_uelqa5LGgrXIE,12957
|
76
76
|
mcp_proxy_adapter/core/security_factory.py,sha256=M-1McwUOmuV7Eo-m_P2undtJVNK_KIjDx8o_uRY8rLo,8005
|
77
|
-
mcp_proxy_adapter/core/security_integration.py,sha256
|
78
|
-
mcp_proxy_adapter/core/server_adapter.py,sha256
|
77
|
+
mcp_proxy_adapter/core/security_integration.py,sha256=-5I4i9so_yMjc-zuGO-7zzIsMXemLvrch1q8WFVbIfg,14167
|
78
|
+
mcp_proxy_adapter/core/server_adapter.py,sha256=-Tta9BzFCNO2TtdNmA8rd6ubzSGKiIoICpit_fczg1c,9748
|
79
79
|
mcp_proxy_adapter/core/server_engine.py,sha256=qmxdkBv-YsQsvxVVQ-_xiAyDshxtnrKBquPJoUjo2fw,9471
|
80
80
|
mcp_proxy_adapter/core/settings.py,sha256=D6cF4R_5gJ0XFGxzXUIzeqe-_muu6HL561TAei9wwZ0,10521
|
81
81
|
mcp_proxy_adapter/core/ssl_utils.py,sha256=Rjl79d5LdhDzxiMtaIRd9OFh0hTeRANItYFXk-7c5pA,9498
|
@@ -85,7 +85,9 @@ mcp_proxy_adapter/core/utils.py,sha256=wBdDYBDWQ6zbwrnl9tykHjo0FjJVsLT_x8Bjk1lZX
|
|
85
85
|
mcp_proxy_adapter/examples/__init__.py,sha256=k1F-EotAFbJ3JvK_rNgiH4bUztmxIWtYn0AfbAZ1ZGs,450
|
86
86
|
mcp_proxy_adapter/examples/bugfix_certificate_config.py,sha256=YGBE_SI6wYZUJLWl7-fP1OWXiSH4mHJAZHApgQWvG7s,10529
|
87
87
|
mcp_proxy_adapter/examples/cert_manager_bugfix.py,sha256=UWUwItjqHqSnOMHocsz40_3deoZE8-vdROLW9y2fEns,7259
|
88
|
-
mcp_proxy_adapter/examples/
|
88
|
+
mcp_proxy_adapter/examples/check_config.py,sha256=W6gS6stP-WfE71YmIemvbmolf04FiR7mvJYSJqDFdzQ,14090
|
89
|
+
mcp_proxy_adapter/examples/config_builder.py,sha256=kd3-donlGuDgZwJYsy_rjzrydBg_A1GaaJuJ8jj4VDc,9696
|
90
|
+
mcp_proxy_adapter/examples/config_builder_simple.py,sha256=qTG3tIIu8eUW8gb06snaWHOTp0BFRRim38VqKrP2Ezo,9109
|
89
91
|
mcp_proxy_adapter/examples/config_cli.py,sha256=ZhVG6XEpTFe5-MzELByVsUh0AD4bHPBZeoXnGWbqifs,11059
|
90
92
|
mcp_proxy_adapter/examples/create_test_configs.py,sha256=9TrvLa4-bWLPu0SB1JXwWuCsjj-4Vz3yAdowcHtCSSA,8228
|
91
93
|
mcp_proxy_adapter/examples/debug_request_state.py,sha256=Z3Gy2-fWtu7KIV9OkzGDLVz7TpL_h9V_99ica40uQBU,4489
|
@@ -97,17 +99,19 @@ mcp_proxy_adapter/examples/generate_certificates_cli.py,sha256=jb5bdNhoODL6qTWBd
|
|
97
99
|
mcp_proxy_adapter/examples/generate_certificates_fixed.py,sha256=6zJj9xdEuwj-ZO2clMoB7pNj5hW4IgwK-qsLPzuq8VQ,12566
|
98
100
|
mcp_proxy_adapter/examples/generate_certificates_framework.py,sha256=TGLyy4AJNI0w-Dd2FUQyX2sOXt05o_q4zkjoapzG1Wc,15017
|
99
101
|
mcp_proxy_adapter/examples/generate_certificates_openssl.py,sha256=5V4B8Ys_-FZsDh-CH7BNf1XXkMtpidkm4iecY0XCFuE,16891
|
102
|
+
mcp_proxy_adapter/examples/generate_config.py,sha256=4WcyCMuQKqr5qtGekoqy-jrQ-71F-ZYdDYftwLrjJNg,11461
|
100
103
|
mcp_proxy_adapter/examples/proxy_registration_example.py,sha256=vemRhftnjbiOBCJkmtDGqlWQ8syTG0a8755GCOnaQsg,12503
|
101
104
|
mcp_proxy_adapter/examples/required_certificates.py,sha256=YW9-V78oFiZ-FmHlGP-8FQFS569VdDVyq9hfvCv31pk,7133
|
102
105
|
mcp_proxy_adapter/examples/run_example.py,sha256=yp-a6HIrSk3ddQmbn0KkuKwErId0aNfj028TE6U-zmY,2626
|
103
106
|
mcp_proxy_adapter/examples/run_full_test_suite.py,sha256=Zd7SINqi4UdiwDWaZrerh4e35XTqAUVApulEYtZx39M,25613
|
104
107
|
mcp_proxy_adapter/examples/run_proxy_server.py,sha256=SBLSSY2F_VEBQD3MsCE_Pa9xFE6Sszr3vHdE9QOEN4Y,5242
|
105
|
-
mcp_proxy_adapter/examples/run_security_tests_fixed.py,sha256=
|
106
|
-
mcp_proxy_adapter/examples/security_test_client.py,sha256=
|
108
|
+
mcp_proxy_adapter/examples/run_security_tests_fixed.py,sha256=aIf57LcAlNUEoroRueZ9hRrnVkg0cRgr58vP2T-ZEXM,18328
|
109
|
+
mcp_proxy_adapter/examples/security_test_client.py,sha256=HL0AhmmHZ9SHlUx6aJ32jTHJonjKmGil74ifLbsGkZA,48660
|
107
110
|
mcp_proxy_adapter/examples/setup_test_environment.py,sha256=JkMqLpH5ZmkNKE7-WT52_kYMxEKLFOyQWbtip29TeiU,51629
|
108
111
|
mcp_proxy_adapter/examples/simple_protocol_test.py,sha256=BzFUZvK9Fih3aG4IFLQTZPyPe_s6YjpZfB6uZmQ76rw,3969
|
112
|
+
mcp_proxy_adapter/examples/test_chk_hostname_automated.py,sha256=9n3V2rk3WdC9yPj40o_3MyRlVRM6jGBBgpyJ5PL2Fd8,7178
|
109
113
|
mcp_proxy_adapter/examples/test_config.py,sha256=ekEoUZe9q484vU_0IxOVhQdNMVJXG3IpmQpP--VmuDI,6491
|
110
|
-
mcp_proxy_adapter/examples/test_config_builder.py,sha256=
|
114
|
+
mcp_proxy_adapter/examples/test_config_builder.py,sha256=SAcWIC54vzO0mrb1L9xZKK2IhNkZuSx7_cMEkC1Lm60,21607
|
111
115
|
mcp_proxy_adapter/examples/test_examples.py,sha256=CYlVatdHUVC_rwv4NsvxFG3GXiKIyxPDUH43BOJHjrU,12330
|
112
116
|
mcp_proxy_adapter/examples/test_protocol_examples.py,sha256=yCZzZrJ9ICXMkF1bAMozpin2QeTMI653bggPAZTRAUE,12138
|
113
117
|
mcp_proxy_adapter/examples/universal_client.py,sha256=n1-cBPOiCipA86Zcc_mI_jMywDMZS1p3u5JT3AqTsrQ,27577
|
@@ -130,8 +134,8 @@ mcp_proxy_adapter/schemas/base_schema.json,sha256=v9G9cGMd4dRhCZsOQ_FMqOi5VFyVbI
|
|
130
134
|
mcp_proxy_adapter/schemas/openapi_schema.json,sha256=C3yLkwmDsvnLW9B5gnKKdBGl4zxkeU-rEmjTrNVsQU0,8405
|
131
135
|
mcp_proxy_adapter/schemas/roles.json,sha256=pgf_ZyqKyXbfGUxvobpiLiSJz9zzxrMuoVWEkEpz3N8,764
|
132
136
|
mcp_proxy_adapter/schemas/roles_schema.json,sha256=deHgI7L6GwfBXacOlNtDgDJelDThppClC3Ti4Eh8rJY,5659
|
133
|
-
mcp_proxy_adapter-6.
|
134
|
-
mcp_proxy_adapter-6.
|
135
|
-
mcp_proxy_adapter-6.
|
136
|
-
mcp_proxy_adapter-6.
|
137
|
-
mcp_proxy_adapter-6.
|
137
|
+
mcp_proxy_adapter-6.6.1.dist-info/METADATA,sha256=b7eTkQKOdUxqilzA8AMTgJRr3f6SrnBwrhgRmAzML04,8510
|
138
|
+
mcp_proxy_adapter-6.6.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
139
|
+
mcp_proxy_adapter-6.6.1.dist-info/entry_points.txt,sha256=Bf-O5Aq80n22Ayu9fI9BgidzWqwzIVaqextAddTuHZw,563
|
140
|
+
mcp_proxy_adapter-6.6.1.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
|
141
|
+
mcp_proxy_adapter-6.6.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|