mcp-proxy-adapter 6.2.16__py3-none-any.whl → 6.2.18__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/__main__.py +1 -1
- mcp_proxy_adapter/api/middleware/unified_security.py +6 -2
- mcp_proxy_adapter/core/security_integration.py +4 -3
- mcp_proxy_adapter/examples/__init__.py +1 -1
- mcp_proxy_adapter/examples/generate_test_configs.py +3 -3
- mcp_proxy_adapter/main.py +10 -1
- mcp_proxy_adapter/version.py +1 -1
- {mcp_proxy_adapter-6.2.16.dist-info → mcp_proxy_adapter-6.2.18.dist-info}/METADATA +1 -1
- {mcp_proxy_adapter-6.2.16.dist-info → mcp_proxy_adapter-6.2.18.dist-info}/RECORD +12 -12
- {mcp_proxy_adapter-6.2.16.dist-info → mcp_proxy_adapter-6.2.18.dist-info}/WHEEL +0 -0
- {mcp_proxy_adapter-6.2.16.dist-info → mcp_proxy_adapter-6.2.18.dist-info}/licenses/LICENSE +0 -0
- {mcp_proxy_adapter-6.2.16.dist-info → mcp_proxy_adapter-6.2.18.dist-info}/top_level.txt +0 -0
mcp_proxy_adapter/__main__.py
CHANGED
@@ -60,9 +60,13 @@ class UnifiedSecurityMiddleware(BaseHTTPMiddleware):
|
|
60
60
|
|
61
61
|
# Create security integration
|
62
62
|
try:
|
63
|
-
|
63
|
+
security_config = config.get("security", {})
|
64
|
+
logger.info(f"DEBUG: Full config keys: {list(config.keys())}")
|
65
|
+
logger.info(f"DEBUG: Security config: {security_config}")
|
66
|
+
logger.info(f"DEBUG: Permissions in security: {'permissions' in security_config}")
|
67
|
+
self.security_integration = create_security_integration(security_config)
|
64
68
|
# Use framework's FastAPI middleware
|
65
|
-
self.framework_middleware = self.security_integration.create_fastapi_middleware(
|
69
|
+
self.framework_middleware = self.security_integration.security_manager.create_fastapi_middleware()
|
66
70
|
logger.info("Using mcp_security_framework FastAPI middleware")
|
67
71
|
except Exception as e:
|
68
72
|
logger.error(f"Security framework integration failed: {e}")
|
@@ -72,7 +72,8 @@ class SecurityIntegration:
|
|
72
72
|
|
73
73
|
def _create_security_config(self) -> SecurityConfig:
|
74
74
|
"""Create SecurityConfig from project configuration."""
|
75
|
-
|
75
|
+
# self.config is already the security section passed from unified_security.py
|
76
|
+
security_section = self.config
|
76
77
|
|
77
78
|
# Create SSL config
|
78
79
|
ssl_config = SSLConfig(
|
@@ -105,7 +106,7 @@ class SecurityIntegration:
|
|
105
106
|
# Create permission config - handle null values properly
|
106
107
|
permissions_section = security_section.get("permissions", {})
|
107
108
|
roles_file = permissions_section.get("roles_file")
|
108
|
-
|
109
|
+
|
109
110
|
# If roles_file is None or empty string, don't pass it to avoid framework errors
|
110
111
|
if roles_file is None or roles_file == "":
|
111
112
|
logger.warning("roles_file is None or empty, permissions will use default configuration")
|
@@ -152,7 +153,7 @@ class SecurityIntegration:
|
|
152
153
|
logging_config = LoggingConfig(
|
153
154
|
enabled=security_section.get("logging", {}).get("enabled", True),
|
154
155
|
level=security_section.get("logging", {}).get("level", "INFO"),
|
155
|
-
format=security_section.get("logging", {}).get("format"),
|
156
|
+
format=security_section.get("logging", {}).get("format", "%(asctime)s - %(name)s - %(levelname)s - %(message)s"),
|
156
157
|
console_output=security_section.get("logging", {}).get("console_output", True),
|
157
158
|
file_path=security_section.get("logging", {}).get("file_path")
|
158
159
|
)
|
@@ -37,7 +37,7 @@ def generate_http_token_config(port: int = 8001) -> Dict[str, Any]:
|
|
37
37
|
"security": {
|
38
38
|
"enabled": True,
|
39
39
|
"auth": {"enabled": True, "methods": ["api_key"]},
|
40
|
-
"permissions": {"enabled":
|
40
|
+
"permissions": {"enabled": True, "roles_file": "./roles.json"}
|
41
41
|
},
|
42
42
|
"registration": {
|
43
43
|
"enabled": True,
|
@@ -83,7 +83,7 @@ def generate_https_token_config(port: int = 8003) -> Dict[str, Any]:
|
|
83
83
|
"security": {
|
84
84
|
"enabled": True,
|
85
85
|
"auth": {"enabled": True, "methods": ["api_key"]},
|
86
|
-
"permissions": {"enabled":
|
86
|
+
"permissions": {"enabled": True, "roles_file": "./roles.json"}
|
87
87
|
},
|
88
88
|
"registration": {
|
89
89
|
"enabled": True,
|
@@ -110,7 +110,7 @@ def generate_mtls_no_roles_config(port: int = 8004) -> Dict[str, Any]:
|
|
110
110
|
"security": {
|
111
111
|
"enabled": True,
|
112
112
|
"auth": {"enabled": True, "methods": ["certificate"]},
|
113
|
-
"permissions": {"enabled":
|
113
|
+
"permissions": {"enabled": True, "roles_file": "./roles.json"}
|
114
114
|
},
|
115
115
|
"protocols": {"enabled": True, "allowed_protocols": ["https", "mtls"]}
|
116
116
|
}
|
mcp_proxy_adapter/main.py
CHANGED
@@ -10,6 +10,7 @@ import sys
|
|
10
10
|
import hypercorn.asyncio
|
11
11
|
import hypercorn.config
|
12
12
|
import asyncio
|
13
|
+
import argparse
|
13
14
|
from pathlib import Path
|
14
15
|
|
15
16
|
# Add the project root to the path
|
@@ -21,8 +22,16 @@ from mcp_proxy_adapter.config import Config
|
|
21
22
|
|
22
23
|
def main():
|
23
24
|
"""Main entry point for the MCP Proxy Adapter."""
|
25
|
+
# Parse command line arguments
|
26
|
+
parser = argparse.ArgumentParser(description="MCP Proxy Adapter Server")
|
27
|
+
parser.add_argument("--config", "-c", type=str, help="Path to configuration file")
|
28
|
+
args = parser.parse_args()
|
29
|
+
|
24
30
|
# Load configuration
|
25
|
-
config
|
31
|
+
if args.config:
|
32
|
+
config = Config(config_path=args.config)
|
33
|
+
else:
|
34
|
+
config = Config()
|
26
35
|
|
27
36
|
# Create application
|
28
37
|
app = create_app(app_config=config)
|
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.2.
|
3
|
+
Version: 6.2.18
|
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=B7m1YWyv_Wb87-Q-JqVpHQgwajnfIgDyZ_iIxzdTbBY,1021
|
2
|
-
mcp_proxy_adapter/__main__.py,sha256=
|
2
|
+
mcp_proxy_adapter/__main__.py,sha256=2KC6jaaiykt9HvrEvZTXB72tDJ4IQF4jzts8pyfkypc,769
|
3
3
|
mcp_proxy_adapter/config.py,sha256=z4rUbJdxYj6vYw05OM_kMXs1Qn2HRQXGHI9PB4hgPd4,12867
|
4
4
|
mcp_proxy_adapter/custom_openapi.py,sha256=jYUrCy8C1mShh3sjKj-JkzSMLAvxDLTvtzSJFj5HUNg,15023
|
5
|
-
mcp_proxy_adapter/main.py,sha256=
|
5
|
+
mcp_proxy_adapter/main.py,sha256=5awVAnVEbauXI2XEl1kKEykLpc_Z08Dwbhqxtu7vYKM,2481
|
6
6
|
mcp_proxy_adapter/openapi.py,sha256=36vOEbJjGnVZR6hUhl6mHCD29HYOEFKo2bL0JdGSm-4,13952
|
7
|
-
mcp_proxy_adapter/version.py,sha256=
|
7
|
+
mcp_proxy_adapter/version.py,sha256=ChtZxn5xZ210qvOzaJka2JQNCXWnc5f_3hSOKhOgL2g,76
|
8
8
|
mcp_proxy_adapter/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
9
9
|
mcp_proxy_adapter/api/app.py,sha256=khl4kaI4mJ6dNbfAK7hR97Ek-eWC9NBeuXHr6GVbLoU,28911
|
10
10
|
mcp_proxy_adapter/api/handlers.py,sha256=DcZT7MVBV33q-0EJ0iFqxE0VgBkFt6d_SqoRkntwyvc,8477
|
@@ -20,7 +20,7 @@ mcp_proxy_adapter/api/middleware/logging.py,sha256=VvUUX7bN4davCzFO6GYbN1O4sgJjO
|
|
20
20
|
mcp_proxy_adapter/api/middleware/performance.py,sha256=dHBxTF43LEGXMKHMH3A8ybKmwAWURd_zswqq_oC4xbw,2454
|
21
21
|
mcp_proxy_adapter/api/middleware/protocol_middleware.py,sha256=RwXBew04AatChvcmyuOOPCOkyJ2_RwCpnZWbKKn4XPM,5547
|
22
22
|
mcp_proxy_adapter/api/middleware/transport_middleware.py,sha256=Esy2gGKpEV5RoUTilr1YKKTDc5jh5RxsomD0VXyR2pE,4396
|
23
|
-
mcp_proxy_adapter/api/middleware/unified_security.py,sha256=
|
23
|
+
mcp_proxy_adapter/api/middleware/unified_security.py,sha256=AgL0YaiJ2VW0GBqHRqFfvcXwNZ9SjFsSnIK7dfXVBOE,5697
|
24
24
|
mcp_proxy_adapter/api/middleware/user_info_middleware.py,sha256=dQJWroIihEa5aZmrzrNAYE189K1Uy9OJyeOa9XpWaJk,2682
|
25
25
|
mcp_proxy_adapter/commands/__init__.py,sha256=r791wg4FKhWSi5rqA3vekDcGf5kr18pwF1woX-dnZKo,1525
|
26
26
|
mcp_proxy_adapter/commands/auth_validation_command.py,sha256=z612WJDVgZwaCrxdQhATwRc5i3qxH37MPuIV6SuZPn8,15083
|
@@ -72,7 +72,7 @@ mcp_proxy_adapter/core/proxy_registration.py,sha256=87ko1vw61nHJGo0-xrObXiyQhrYK
|
|
72
72
|
mcp_proxy_adapter/core/role_utils.py,sha256=wMoTVz3gF5fM7jozNMwsEwPkp1tui26M-t_KH1Oz8gs,12880
|
73
73
|
mcp_proxy_adapter/core/security_adapter.py,sha256=wZ3OH1WzhUdpN8N8CrGJSFFVNi474DqdazIqQ1T8PN4,13343
|
74
74
|
mcp_proxy_adapter/core/security_factory.py,sha256=4r7qvBq30XfosGD_b1ZHyNVLN8rOQ3NAKuaCOCEK8jA,8262
|
75
|
-
mcp_proxy_adapter/core/security_integration.py,sha256=
|
75
|
+
mcp_proxy_adapter/core/security_integration.py,sha256=6oJKVCL1CRnk3sTWX-PBzDjv737oe4QL-9r3l89kRkc,13715
|
76
76
|
mcp_proxy_adapter/core/server_adapter.py,sha256=8dhUlLxuYjaoNgMHieFCFgDRjxskP--Y5uoAhbN6RLw,9823
|
77
77
|
mcp_proxy_adapter/core/server_engine.py,sha256=SFENSDrVMlBD--HgKSRVklhrtLKSRSZhs_3UHxFCGbg,9540
|
78
78
|
mcp_proxy_adapter/core/settings.py,sha256=ZfUnmqD1tjAuaQo2VAF8evC1oHUit7gTu4WkTF0IMYI,10628
|
@@ -80,7 +80,7 @@ mcp_proxy_adapter/core/ssl_utils.py,sha256=_2mhpuoiRpSbUBifnQvtuziQfBRrXQUKtB58A
|
|
80
80
|
mcp_proxy_adapter/core/transport_manager.py,sha256=ppcgjO-7Ulrk1ovlzlXVM89Iw4VOGA3awKgLf7FFAJ0,9518
|
81
81
|
mcp_proxy_adapter/core/unified_config_adapter.py,sha256=cpN_VrliIFGDH3JsfRkTlFdQvLcmuMYYedq0QEzlb0Y,22857
|
82
82
|
mcp_proxy_adapter/core/utils.py,sha256=ly8Ttg2v1OBukThJLxudRvmttU1hxJFLJUfat4b2dOI,3268
|
83
|
-
mcp_proxy_adapter/examples/__init__.py,sha256=
|
83
|
+
mcp_proxy_adapter/examples/__init__.py,sha256=Ph2FBqr4O81suCOVyoaZmlrxIvhwFY_Bf5Nt6i7HoFE,450
|
84
84
|
mcp_proxy_adapter/examples/create_certificates_simple.py,sha256=2KS-s3amvAqasvdh-cxY7ARuFAHVjtbtr_EJF2SKVQ0,23221
|
85
85
|
mcp_proxy_adapter/examples/debug_request_state.py,sha256=x_H3NIlkmIS6lZimvEM6kCXxGdpgFw99Sdui8qa_qeU,4347
|
86
86
|
mcp_proxy_adapter/examples/debug_role_chain.py,sha256=33l2Tk5mrcnwPFwqm2NTHcrWaJrXUU2wxW2I6Y4uIg4,8344
|
@@ -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
|
91
|
+
mcp_proxy_adapter/examples/generate_test_configs.py,sha256=JG3HdHCHFA5p93Fpkoa7kXjex6x6HqPExZrkyJfZtpo,10714
|
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
|
@@ -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.18.dist-info/licenses/LICENSE,sha256=6KdtUcTwmTRbJrAmYjVn7e6S-V42ubeDJ-AiVEzZ510,1075
|
118
|
+
mcp_proxy_adapter-6.2.18.dist-info/METADATA,sha256=3o4ohjogBp812CYFnKBoHvL8bnp3guuA0YrQ1fsWB4M,22199
|
119
|
+
mcp_proxy_adapter-6.2.18.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
120
|
+
mcp_proxy_adapter-6.2.18.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
|
121
|
+
mcp_proxy_adapter-6.2.18.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|