mcp-proxy-adapter 6.6.5__py3-none-any.whl → 6.6.8__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/app.py +4 -0
- mcp_proxy_adapter/examples/config_builder.py +76 -2
- mcp_proxy_adapter/examples/generate_config.py +14 -3
- mcp_proxy_adapter/version.py +1 -1
- {mcp_proxy_adapter-6.6.5.dist-info → mcp_proxy_adapter-6.6.8.dist-info}/METADATA +1 -1
- {mcp_proxy_adapter-6.6.5.dist-info → mcp_proxy_adapter-6.6.8.dist-info}/RECORD +9 -9
- {mcp_proxy_adapter-6.6.5.dist-info → mcp_proxy_adapter-6.6.8.dist-info}/WHEEL +0 -0
- {mcp_proxy_adapter-6.6.5.dist-info → mcp_proxy_adapter-6.6.8.dist-info}/entry_points.txt +0 -0
- {mcp_proxy_adapter-6.6.5.dist-info → mcp_proxy_adapter-6.6.8.dist-info}/top_level.txt +0 -0
mcp_proxy_adapter/api/app.py
CHANGED
@@ -95,11 +95,13 @@ def create_lifespan(config_path: Optional[str] = None):
|
|
95
95
|
# Use protocol from registration configuration
|
96
96
|
# Convert mtls to https for URL construction (mTLS is still HTTPS)
|
97
97
|
protocol = "https" if registration_protocol == "mtls" else registration_protocol
|
98
|
+
logger.info(f"🔍 Using registration.protocol: {registration_protocol} -> {protocol}")
|
98
99
|
else:
|
99
100
|
# Fallback to server protocol
|
100
101
|
verify_client = config.get("transport.verify_client", False)
|
101
102
|
ssl_enabled = server_protocol in ["https", "mtls"] or verify_client
|
102
103
|
protocol = "https" if ssl_enabled else "http"
|
104
|
+
logger.info(f"⚠️ Fallback to server.protocol: {server_protocol} -> {protocol} (verify_client={verify_client})")
|
103
105
|
|
104
106
|
import os
|
105
107
|
docker_host_addr = os.getenv("DOCKER_HOST_ADDR", "172.17.0.1")
|
@@ -154,11 +156,13 @@ def create_lifespan(config_path: Optional[str] = None):
|
|
154
156
|
# Use protocol from registration configuration
|
155
157
|
# Convert mtls to https for URL construction (mTLS is still HTTPS)
|
156
158
|
protocol = "https" if registration_protocol == "mtls" else registration_protocol
|
159
|
+
logger.info(f"🔍 Using registration.protocol: {registration_protocol} -> {protocol}")
|
157
160
|
else:
|
158
161
|
# Fallback to server protocol
|
159
162
|
verify_client_cfg = final_config.get("transport", {}).get("verify_client", False)
|
160
163
|
ssl_enabled_final = server_protocol in ["https", "mtls"] or verify_client_cfg
|
161
164
|
protocol = "https" if ssl_enabled_final else "http"
|
165
|
+
logger.info(f"⚠️ Fallback to server.protocol: {server_protocol} -> {protocol} (verify_client={verify_client_cfg})")
|
162
166
|
|
163
167
|
import os
|
164
168
|
docker_host_addr = os.getenv("DOCKER_HOST_ADDR", "172.17.0.1")
|
@@ -76,9 +76,27 @@ class ConfigBuilder:
|
|
76
76
|
},
|
77
77
|
"transport": {
|
78
78
|
"type": "http",
|
79
|
-
|
79
|
+
"port": None,
|
80
80
|
"verify_client": False,
|
81
81
|
"chk_hostname": False
|
82
|
+
},
|
83
|
+
"registration": {
|
84
|
+
"enabled": False,
|
85
|
+
"proxy_url": "http://localhost:3004",
|
86
|
+
"public_host": None,
|
87
|
+
"public_port": None,
|
88
|
+
"protocol": None, # Will be set based on server protocol
|
89
|
+
"server_id": "mcp_proxy_adapter",
|
90
|
+
"server_name": "MCP Proxy Adapter",
|
91
|
+
"description": "JSON-RPC API for interacting with MCP Proxy",
|
92
|
+
"version": "6.6.7",
|
93
|
+
"heartbeat": {
|
94
|
+
"enabled": True,
|
95
|
+
"interval": 30,
|
96
|
+
"timeout": 10,
|
97
|
+
"retry_attempts": 3,
|
98
|
+
"retry_delay": 5
|
99
|
+
}
|
82
100
|
}
|
83
101
|
}
|
84
102
|
|
@@ -86,6 +104,9 @@ class ConfigBuilder:
|
|
86
104
|
"""Set protocol configuration (HTTP, HTTPS, or mTLS)."""
|
87
105
|
self.config["server"]["protocol"] = protocol.value
|
88
106
|
|
107
|
+
# Set registration protocol to match server protocol
|
108
|
+
self.config["registration"]["protocol"] = protocol.value
|
109
|
+
|
89
110
|
if protocol == Protocol.HTTP:
|
90
111
|
# HTTP - no SSL, no client verification
|
91
112
|
self.config["transport"]["verify_client"] = False
|
@@ -150,6 +171,25 @@ class ConfigBuilder:
|
|
150
171
|
self.config["security"]["roles_file"] = roles_file
|
151
172
|
return self
|
152
173
|
|
174
|
+
def set_proxy_registration(self, enabled: bool = True, proxy_url: str = "http://localhost:3004",
|
175
|
+
public_host: Optional[str] = None, public_port: Optional[int] = None,
|
176
|
+
server_id: str = "mcp_proxy_adapter", server_name: str = "MCP Proxy Adapter",
|
177
|
+
description: str = "JSON-RPC API for interacting with MCP Proxy"):
|
178
|
+
"""Set proxy registration configuration."""
|
179
|
+
self.config["registration"]["enabled"] = enabled
|
180
|
+
self.config["registration"]["proxy_url"] = proxy_url
|
181
|
+
self.config["registration"]["public_host"] = public_host
|
182
|
+
self.config["registration"]["public_port"] = public_port
|
183
|
+
self.config["registration"]["server_id"] = server_id
|
184
|
+
self.config["registration"]["server_name"] = server_name
|
185
|
+
self.config["registration"]["description"] = description
|
186
|
+
|
187
|
+
# Set protocol to match server protocol if not explicitly set
|
188
|
+
if self.config["registration"]["protocol"] is None:
|
189
|
+
self.config["registration"]["protocol"] = self.config["server"]["protocol"]
|
190
|
+
|
191
|
+
return self
|
192
|
+
|
153
193
|
def build(self) -> Dict[str, Any]:
|
154
194
|
"""Build and return the configuration."""
|
155
195
|
return self.config.copy()
|
@@ -240,9 +280,37 @@ class ConfigFactory:
|
|
240
280
|
.set_auth(AuthMethod.TOKEN_ROLES)
|
241
281
|
.set_server(port=port)
|
242
282
|
.build())
|
283
|
+
|
284
|
+
@staticmethod
|
285
|
+
def create_http_with_proxy_config(port: int = 8009, proxy_url: str = "http://localhost:3004") -> Dict[str, Any]:
|
286
|
+
"""Create HTTP configuration with proxy registration."""
|
287
|
+
return (ConfigBuilder()
|
288
|
+
.set_protocol(Protocol.HTTP)
|
289
|
+
.set_server(port=port)
|
290
|
+
.set_proxy_registration(proxy_url=proxy_url)
|
291
|
+
.build())
|
292
|
+
|
293
|
+
@staticmethod
|
294
|
+
def create_https_with_proxy_config(port: int = 8010, proxy_url: str = "https://localhost:3004") -> Dict[str, Any]:
|
295
|
+
"""Create HTTPS configuration with proxy registration."""
|
296
|
+
return (ConfigBuilder()
|
297
|
+
.set_protocol(Protocol.HTTPS)
|
298
|
+
.set_server(port=port)
|
299
|
+
.set_proxy_registration(proxy_url=proxy_url)
|
300
|
+
.build())
|
301
|
+
|
302
|
+
@staticmethod
|
303
|
+
def create_mtls_with_proxy_config(port: int = 8011, proxy_url: str = "https://localhost:3004") -> Dict[str, Any]:
|
304
|
+
"""Create mTLS configuration with proxy registration."""
|
305
|
+
return (ConfigBuilder()
|
306
|
+
.set_protocol(Protocol.MTLS)
|
307
|
+
.set_server(port=port)
|
308
|
+
.set_proxy_registration(proxy_url=proxy_url)
|
309
|
+
.build())
|
243
310
|
|
244
311
|
|
245
|
-
def create_config_from_flags(protocol: str, token: bool = False, roles: bool = False, port: int = 8000
|
312
|
+
def create_config_from_flags(protocol: str, token: bool = False, roles: bool = False, port: int = 8000,
|
313
|
+
proxy_registration: bool = False, proxy_url: str = "http://localhost:3004") -> Dict[str, Any]:
|
246
314
|
"""
|
247
315
|
Create configuration from command line flags.
|
248
316
|
|
@@ -251,6 +319,8 @@ def create_config_from_flags(protocol: str, token: bool = False, roles: bool = F
|
|
251
319
|
token: Enable token authentication
|
252
320
|
roles: Enable role-based access control
|
253
321
|
port: Server port
|
322
|
+
proxy_registration: Enable proxy registration
|
323
|
+
proxy_url: Proxy URL for registration
|
254
324
|
|
255
325
|
Returns:
|
256
326
|
Configuration dictionary
|
@@ -273,6 +343,10 @@ def create_config_from_flags(protocol: str, token: bool = False, roles: bool = F
|
|
273
343
|
else:
|
274
344
|
builder.set_auth(AuthMethod.NONE)
|
275
345
|
|
346
|
+
# Enable proxy registration if requested
|
347
|
+
if proxy_registration:
|
348
|
+
builder.set_proxy_registration(proxy_url=proxy_url)
|
349
|
+
|
276
350
|
return builder.build()
|
277
351
|
|
278
352
|
|
@@ -26,7 +26,9 @@ def create_config_from_flags(
|
|
26
26
|
port: int = 8000,
|
27
27
|
cert_dir: str = "./certs",
|
28
28
|
key_dir: str = "./keys",
|
29
|
-
output_dir: str = "./configs"
|
29
|
+
output_dir: str = "./configs",
|
30
|
+
proxy_registration: bool = False,
|
31
|
+
proxy_url: str = "http://localhost:3004"
|
30
32
|
) -> Dict[str, Any]:
|
31
33
|
"""
|
32
34
|
Create configuration based on command line flags.
|
@@ -47,7 +49,7 @@ def create_config_from_flags(
|
|
47
49
|
# Use the simplified config builder
|
48
50
|
from config_builder import create_config_from_flags as simple_create_config
|
49
51
|
|
50
|
-
return simple_create_config(protocol, token, roles, port)
|
52
|
+
return simple_create_config(protocol, token, roles, port, proxy_registration, proxy_url)
|
51
53
|
|
52
54
|
|
53
55
|
def save_config(config: Dict[str, Any], filename: str, output_dir: str) -> Path:
|
@@ -238,6 +240,9 @@ Examples:
|
|
238
240
|
|
239
241
|
# Generate mTLS configuration with roles
|
240
242
|
python generate_config.py --protocol mtls --roles
|
243
|
+
|
244
|
+
# Generate mTLS configuration with proxy registration
|
245
|
+
python generate_config.py --protocol mtls --proxy-registration --proxy-url https://mcp-proxy:3004
|
241
246
|
"""
|
242
247
|
)
|
243
248
|
|
@@ -248,6 +253,10 @@ Examples:
|
|
248
253
|
help="Enable token authentication")
|
249
254
|
parser.add_argument("--roles", action="store_true",
|
250
255
|
help="Enable role-based access control")
|
256
|
+
parser.add_argument("--proxy-registration", action="store_true",
|
257
|
+
help="Enable proxy registration")
|
258
|
+
parser.add_argument("--proxy-url", default="http://localhost:3004",
|
259
|
+
help="Proxy URL for registration (default: http://localhost:3004)")
|
251
260
|
parser.add_argument("--all", action="store_true",
|
252
261
|
help="Generate all standard configurations")
|
253
262
|
parser.add_argument("--full-config", action="store_true",
|
@@ -307,7 +316,9 @@ Examples:
|
|
307
316
|
port=args.port,
|
308
317
|
cert_dir=args.cert_dir,
|
309
318
|
key_dir=args.key_dir,
|
310
|
-
output_dir=args.output_dir
|
319
|
+
output_dir=args.output_dir,
|
320
|
+
proxy_registration=args.proxy_registration,
|
321
|
+
proxy_url=args.proxy_url
|
311
322
|
)
|
312
323
|
|
313
324
|
if args.stdout:
|
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.6.
|
3
|
+
Version: 6.6.8
|
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
|
@@ -4,9 +4,9 @@ mcp_proxy_adapter/config.py,sha256=QpoPaUKcWJ-eu6HYphhIZmkc2M-p1JgpLFAgolf_l5s,2
|
|
4
4
|
mcp_proxy_adapter/custom_openapi.py,sha256=XRviX-C-ZkSKdBhORhDTdeN_1FWyEfXZADiASft3t9I,28149
|
5
5
|
mcp_proxy_adapter/main.py,sha256=eXIRMLgDgCox9p2WDcOS9D6tiZjcFit8ePbFCfGbs3Q,5849
|
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=dmxyAMwHAxprMqE7L2dkx0Qby72E0Winw62K3RTnsnQ,74
|
8
8
|
mcp_proxy_adapter/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
|
-
mcp_proxy_adapter/api/app.py,sha256=
|
9
|
+
mcp_proxy_adapter/api/app.py,sha256=jtK6WljhRXJe6MAp7hhQ89opdZta1SMEqV2KMG6prlU,36776
|
10
10
|
mcp_proxy_adapter/api/handlers.py,sha256=X-hcMNVeTAu4yVkKJEChEsj2bFptUS6sLNN-Wysjkow,10011
|
11
11
|
mcp_proxy_adapter/api/schemas.py,sha256=mevUvQnYgWQfkJAs3-vq3HalBzh6-Saa-Au1VVf0peE,12377
|
12
12
|
mcp_proxy_adapter/api/tool_integration.py,sha256=AeUyvJVN-c3FrX5fHdagHL51saRH5d1ZKqc2YEx0rTE,10147
|
@@ -86,14 +86,14 @@ mcp_proxy_adapter/examples/__init__.py,sha256=k1F-EotAFbJ3JvK_rNgiH4bUztmxIWtYn0
|
|
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
88
|
mcp_proxy_adapter/examples/check_config.py,sha256=oDP3cymq76TqEpPztPihH-_sBktiEb2cG0MdVrY1Sj8,14104
|
89
|
-
mcp_proxy_adapter/examples/config_builder.py,sha256=
|
89
|
+
mcp_proxy_adapter/examples/config_builder.py,sha256=Vczefn_kqvdDzgmj0RMop3gfw_db4Gn8IqrWNZ-xhcE,13240
|
90
90
|
mcp_proxy_adapter/examples/config_cli.py,sha256=ZhVG6XEpTFe5-MzELByVsUh0AD4bHPBZeoXnGWbqifs,11059
|
91
91
|
mcp_proxy_adapter/examples/create_test_configs.py,sha256=9TrvLa4-bWLPu0SB1JXwWuCsjj-4Vz3yAdowcHtCSSA,8228
|
92
92
|
mcp_proxy_adapter/examples/debug_request_state.py,sha256=Z3Gy2-fWtu7KIV9OkzGDLVz7TpL_h9V_99ica40uQBU,4489
|
93
93
|
mcp_proxy_adapter/examples/debug_role_chain.py,sha256=GLVXC2fJUwP8UJnXHchd1t-H53cjWLJI3RqTPrKmaak,8750
|
94
94
|
mcp_proxy_adapter/examples/demo_client.py,sha256=en2Rtb70B1sQmhL-vdQ4PDpKNNl_mfll2YCFT_jFCAg,10191
|
95
95
|
mcp_proxy_adapter/examples/generate_certificates.py,sha256=cIfTHBziGiOTy9vldAmaULD6bXBpl2a5KfB8MLIRSww,16391
|
96
|
-
mcp_proxy_adapter/examples/generate_config.py,sha256=
|
96
|
+
mcp_proxy_adapter/examples/generate_config.py,sha256=Q0jxMnOh4U6f7MAxn0yTfqjRP5CNokXqeyTKcQhDlO8,12128
|
97
97
|
mcp_proxy_adapter/examples/proxy_registration_example.py,sha256=vemRhftnjbiOBCJkmtDGqlWQ8syTG0a8755GCOnaQsg,12503
|
98
98
|
mcp_proxy_adapter/examples/required_certificates.py,sha256=YW9-V78oFiZ-FmHlGP-8FQFS569VdDVyq9hfvCv31pk,7133
|
99
99
|
mcp_proxy_adapter/examples/run_example.py,sha256=yp-a6HIrSk3ddQmbn0KkuKwErId0aNfj028TE6U-zmY,2626
|
@@ -130,8 +130,8 @@ mcp_proxy_adapter/schemas/base_schema.json,sha256=v9G9cGMd4dRhCZsOQ_FMqOi5VFyVbI
|
|
130
130
|
mcp_proxy_adapter/schemas/openapi_schema.json,sha256=C3yLkwmDsvnLW9B5gnKKdBGl4zxkeU-rEmjTrNVsQU0,8405
|
131
131
|
mcp_proxy_adapter/schemas/roles.json,sha256=pgf_ZyqKyXbfGUxvobpiLiSJz9zzxrMuoVWEkEpz3N8,764
|
132
132
|
mcp_proxy_adapter/schemas/roles_schema.json,sha256=deHgI7L6GwfBXacOlNtDgDJelDThppClC3Ti4Eh8rJY,5659
|
133
|
-
mcp_proxy_adapter-6.6.
|
134
|
-
mcp_proxy_adapter-6.6.
|
135
|
-
mcp_proxy_adapter-6.6.
|
136
|
-
mcp_proxy_adapter-6.6.
|
137
|
-
mcp_proxy_adapter-6.6.
|
133
|
+
mcp_proxy_adapter-6.6.8.dist-info/METADATA,sha256=rQjmIuYsr9cXuBFT7JuXOPPjJ7XjgMvXeUaYi6hzJ0M,8510
|
134
|
+
mcp_proxy_adapter-6.6.8.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
135
|
+
mcp_proxy_adapter-6.6.8.dist-info/entry_points.txt,sha256=Bf-O5Aq80n22Ayu9fI9BgidzWqwzIVaqextAddTuHZw,563
|
136
|
+
mcp_proxy_adapter-6.6.8.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
|
137
|
+
mcp_proxy_adapter-6.6.8.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|