mcp-proxy-adapter 6.2.16__py3-none-any.whl → 6.2.21__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.
@@ -16,7 +16,7 @@ from mcp_proxy_adapter.api.app import create_app
16
16
 
17
17
  def main():
18
18
  """Main CLI entry point."""
19
- print("MCP Proxy Adapter v6.2.16")
19
+ print("MCP Proxy Adapter v6.2.21")
20
20
  print("========================")
21
21
  print()
22
22
  print("Usage:")
@@ -60,9 +60,10 @@ class UnifiedSecurityMiddleware(BaseHTTPMiddleware):
60
60
 
61
61
  # Create security integration
62
62
  try:
63
- self.security_integration = create_security_integration(config)
63
+ security_config = config.get("security", {})
64
+ self.security_integration = create_security_integration(security_config)
64
65
  # Use framework's FastAPI middleware
65
- self.framework_middleware = self.security_integration.create_fastapi_middleware(app)
66
+ self.framework_middleware = self.security_integration.security_manager.create_fastapi_middleware()
66
67
  logger.info("Using mcp_security_framework FastAPI middleware")
67
68
  except Exception as e:
68
69
  logger.error(f"Security framework integration failed: {e}")
@@ -175,7 +175,7 @@ class Config:
175
175
  "renewal_threshold_days": 30
176
176
  },
177
177
  "permissions": {
178
- "enabled": False,
178
+ "enabled": True,
179
179
  "roles_file": None,
180
180
  "default_role": "guest",
181
181
  "admin_role": "admin",
@@ -72,7 +72,8 @@ class SecurityIntegration:
72
72
 
73
73
  def _create_security_config(self) -> SecurityConfig:
74
74
  """Create SecurityConfig from project configuration."""
75
- security_section = self.config.get("security", {})
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
  )
@@ -13,4 +13,4 @@ Examples include:
13
13
  For detailed documentation, see the main README.md file.
14
14
  """
15
15
 
16
- __version__ = "6.2.16"
16
+ __version__ = "6.2.21"
@@ -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": False, "roles_file": "./roles.json"}
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": False, "roles_file": "./roles.json"}
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": False, "roles_file": "./roles.json"}
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 = 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)
@@ -2,5 +2,5 @@
2
2
  Version information for MCP Proxy Adapter.
3
3
  """
4
4
 
5
- __version__ = "6.2.16"
5
+ __version__ = "6.2.21"
6
6
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-proxy-adapter
3
- Version: 6.2.16
3
+ Version: 6.2.21
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=eIGzrSpsJp6K3hRlge3aXv6wJV9LqhreCe5ADLh3ShA,769
3
- mcp_proxy_adapter/config.py,sha256=z4rUbJdxYj6vYw05OM_kMXs1Qn2HRQXGHI9PB4hgPd4,12867
2
+ mcp_proxy_adapter/__main__.py,sha256=-Wp1myP9DzJNB9j97mj62C8kFk5YUbCmd0e7Rnwte0A,769
3
+ mcp_proxy_adapter/config.py,sha256=syjTmiWh66rXcmgK6X2KSzbUkwTQC2W5FfMUpO5bjmo,12866
4
4
  mcp_proxy_adapter/custom_openapi.py,sha256=jYUrCy8C1mShh3sjKj-JkzSMLAvxDLTvtzSJFj5HUNg,15023
5
- mcp_proxy_adapter/main.py,sha256=_DJwMZdN0393UR-U7xfQh59EpbDDgv1oWPFf-v2MoII,2147
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=EbhAFYMvso3_sY9GXzxewJDgTXDNtxDrf6Tg5C3k068,76
7
+ mcp_proxy_adapter/version.py,sha256=hpLr_TlJwnITmGEWHlvCO6adJx7bu19jF22v6PonzaE,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=32BWiQaFyWgEgdIlj-La_4GUgD180zB4jh1O7-DkHDE,5377
23
+ mcp_proxy_adapter/api/middleware/unified_security.py,sha256=Z8R7fgGnCIhMjehRa2AE9ymdKwPKiTGL_oCsgP6H9nw,5457
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=yAAgL9Y7-VUMPhOLbDpBT2rRHDmmUWv1xolBrxbX29o,13601
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=IYBYlTvwsZ52462WSYLWNastsR9aG-C5DXfx2T0LXcQ,450
83
+ mcp_proxy_adapter/examples/__init__.py,sha256=k1F-EotAFbJ3JvK_rNgiH4bUztmxIWtYn0AfbAZ1ZGs,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=-g-03nFU3OhdJ_QCkUnM46ZfL-nK8l420p1CrQwhiSQ,10717
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.16.dist-info/licenses/LICENSE,sha256=6KdtUcTwmTRbJrAmYjVn7e6S-V42ubeDJ-AiVEzZ510,1075
118
- mcp_proxy_adapter-6.2.16.dist-info/METADATA,sha256=0fHA7VbwQ3MyC6UB4BlEgP1XKS7qh4m25UmQwQnaGts,22199
119
- mcp_proxy_adapter-6.2.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
120
- mcp_proxy_adapter-6.2.16.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
121
- mcp_proxy_adapter-6.2.16.dist-info/RECORD,,
117
+ mcp_proxy_adapter-6.2.21.dist-info/licenses/LICENSE,sha256=6KdtUcTwmTRbJrAmYjVn7e6S-V42ubeDJ-AiVEzZ510,1075
118
+ mcp_proxy_adapter-6.2.21.dist-info/METADATA,sha256=T1MUAD5jJwSfr8cgbwH9pS7h2GspLqGO-ycVAJe8BPo,22199
119
+ mcp_proxy_adapter-6.2.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
120
+ mcp_proxy_adapter-6.2.21.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
121
+ mcp_proxy_adapter-6.2.21.dist-info/RECORD,,