mcp-proxy-adapter 6.2.5__py3-none-any.whl → 6.2.6__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.5")
19
+ print("MCP Proxy Adapter v6.2.6")
20
20
  print("========================")
21
21
  print()
22
22
  print("Usage:")
@@ -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.5"
16
+ __version__ = "6.2.6"
@@ -2,6 +2,8 @@
2
2
 
3
3
  This example demonstrates the fundamental usage of MCP Proxy Adapter
4
4
  with minimal configuration and basic command registration.
5
- """
6
5
 
7
- from .main import app
6
+ Note: This package provides a basic example of MCP Proxy Adapter usage.
7
+ The main application is created dynamically in main.py and not exported
8
+ as a global variable for this example.
9
+ """
@@ -2,105 +2,162 @@
2
2
  """
3
3
  Certificate Generation Script
4
4
  This script generates all necessary certificates for the examples using
5
- mcp_security_framework certificate management tools.
5
+ mcp_security_framework API directly.
6
6
  Author: Vasiliy Zdanovskiy
7
7
  email: vasilyvz@gmail.com
8
8
  """
9
9
  import os
10
- import subprocess
11
- import sys
12
10
  from pathlib import Path
13
- def run_command(cmd, description):
14
- """Run a command and handle errors."""
15
- print(f"🔧 {description}...")
16
- try:
17
- result = subprocess.run(cmd, shell=True, check=True, capture_output=True, text=True)
18
- print(f"✅ {description} completed successfully")
19
- return True
20
- except subprocess.CalledProcessError as e:
21
- print(f"❌ {description} failed: {e}")
22
- print(f"Error output: {e.stderr}")
23
- return False
11
+ from datetime import datetime, timedelta, timezone
12
+
24
13
  def main():
25
14
  """Generate all certificates for examples."""
26
15
  print("🔐 Certificate Generation Script")
27
16
  print("=" * 50)
17
+
28
18
  # Create directories
29
19
  cert_dir = Path("certs")
20
+ key_dir = Path("keys")
30
21
  cert_dir.mkdir(exist_ok=True)
22
+ key_dir.mkdir(exist_ok=True)
23
+
31
24
  # Check if mcp_security_framework is available
32
25
  try:
33
- import mcp_security_framework
34
- print(f"✅ mcp_security_framework version {mcp_security_framework.__version__} found")
35
- except ImportError:
36
- print("❌ mcp_security_framework not found")
37
- return False
38
- # Generate CA certificate
39
- if not run_command(
40
- "python -m mcp_security_framework.cli.cert_cli create-ca "
41
- "--common-name 'MCP Proxy Adapter CA' "
42
- "--organization 'MCP Proxy Adapter' "
43
- "--country 'US' "
44
- "--state 'State' "
45
- "--locality 'City' "
46
- "--validity-years 10 "
47
- "--key-size 2048",
48
- "Creating root CA certificate"
49
- ):
50
- return False
51
- # Generate server certificate
52
- if not run_command(
53
- "python -m mcp_security_framework.cli.cert_cli -c cert_config.json create-server "
54
- "--common-name 'localhost' "
55
- "--organization 'MCP Proxy Adapter' "
56
- "--country 'US' "
57
- "--validity-days 365 "
58
- "--key-size 2048",
59
- "Creating server certificate"
60
- ):
26
+ from mcp_security_framework.core.cert_manager import CertificateManager
27
+ from mcp_security_framework.schemas import (
28
+ CAConfig, ServerCertConfig, ClientCertConfig, CertificateConfig
29
+ )
30
+ print("✅ mcp_security_framework API available")
31
+ except ImportError as e:
32
+ print(f"❌ mcp_security_framework not found: {e}")
61
33
  return False
62
- # Generate admin client certificate
63
- if not run_command(
64
- "python -m mcp_security_framework.cli.cert_cli -c cert_config.json create-client "
65
- "--common-name 'admin' "
66
- "--organization 'MCP Proxy Adapter' "
67
- "--country 'US' "
68
- "--validity-days 365 "
69
- "--key-size 2048 "
70
- "--roles 'admin' "
71
- "--permissions 'read,write,delete'",
72
- "Creating admin client certificate"
73
- ):
74
- return False
75
- # Generate user client certificate
76
- if not run_command(
77
- "python -m mcp_security_framework.cli.cert_cli -c cert_config.json create-client "
78
- "--common-name 'user' "
79
- "--organization 'MCP Proxy Adapter' "
80
- "--country 'US' "
81
- "--validity-days 365 "
82
- "--key-size 2048 "
83
- "--roles 'user' "
84
- "--permissions 'read,write'",
85
- "Creating user client certificate"
86
- ):
87
- return False
88
- # Generate readonly client certificate
89
- if not run_command(
90
- "python -m mcp_security_framework.cli.cert_cli -c cert_config.json create-client "
91
- "--common-name 'readonly' "
92
- "--organization 'MCP Proxy Adapter' "
93
- "--country 'US' "
94
- "--validity-days 365 "
95
- "--key-size 2048 "
96
- "--roles 'readonly' "
97
- "--permissions 'read'",
98
- "Creating readonly client certificate"
99
- ):
34
+
35
+ try:
36
+ print("🔧 Creating root CA certificate...")
37
+ # Create CA certificate directly
38
+ ca_config = CAConfig(
39
+ common_name="MCP Proxy Adapter CA",
40
+ organization="MCP Proxy Adapter",
41
+ organizational_unit="Development",
42
+ country="US",
43
+ state="State",
44
+ locality="City",
45
+ validity_years=10,
46
+ key_size=2048
47
+ )
48
+
49
+ # Use CLI to create CA first
50
+ import subprocess
51
+ result = subprocess.run([
52
+ "python", "-m", "mcp_security_framework.cli.cert_cli", "create-ca",
53
+ "--common-name", "MCP Proxy Adapter CA",
54
+ "--organization", "MCP Proxy Adapter",
55
+ "--country", "US",
56
+ "--state", "State",
57
+ "--locality", "City",
58
+ "--validity-years", "10",
59
+ "--key-size", "2048"
60
+ ], capture_output=True, text=True)
61
+
62
+ if result.returncode != 0:
63
+ print(f" CA creation failed: {result.stderr}")
64
+ return False
65
+
66
+ ca_cert_path = cert_dir / "mcp_proxy_adapter_ca_ca.crt"
67
+ ca_key_path = key_dir / "mcp_proxy_adapter_ca_ca.key"
68
+ print(f" Root CA certificate created: {ca_cert_path}")
69
+
70
+ # Now initialize certificate manager with existing CA
71
+ cert_config = CertificateConfig(
72
+ enabled=True,
73
+ ca_cert_path=str(ca_cert_path),
74
+ ca_key_path=str(ca_key_path),
75
+ cert_storage_path=str(cert_dir),
76
+ key_storage_path=str(key_dir)
77
+ )
78
+
79
+ # Initialize certificate manager
80
+ cert_manager = CertificateManager(cert_config)
81
+
82
+ print("🔧 Creating server certificate...")
83
+ # Create server certificate
84
+ server_config = ServerCertConfig(
85
+ common_name="localhost",
86
+ organization="MCP Proxy Adapter",
87
+ country="US",
88
+ validity_days=365,
89
+ key_size=2048,
90
+ subject_alt_names=["localhost", "127.0.0.1"],
91
+ ca_cert_path=str(ca_cert_path),
92
+ ca_key_path=str(ca_key_path)
93
+ )
94
+
95
+ server_cert_pair = cert_manager.create_server_certificate(server_config)
96
+ print(f"✅ Server certificate created: {server_cert_pair.certificate_path}")
97
+
98
+ print("🔧 Creating admin client certificate...")
99
+ # Create admin client certificate
100
+ admin_config = ClientCertConfig(
101
+ common_name="admin",
102
+ organization="MCP Proxy Adapter",
103
+ country="US",
104
+ validity_days=365,
105
+ key_size=2048,
106
+ roles=["admin"],
107
+ permissions=["read", "write", "delete"],
108
+ ca_cert_path=str(ca_cert_path),
109
+ ca_key_path=str(ca_key_path)
110
+ )
111
+
112
+ admin_cert_pair = cert_manager.create_client_certificate(admin_config)
113
+ print(f"✅ Admin client certificate created: {admin_cert_pair.certificate_path}")
114
+
115
+ print("🔧 Creating user client certificate...")
116
+ # Create user client certificate
117
+ user_config = ClientCertConfig(
118
+ common_name="user",
119
+ organization="MCP Proxy Adapter",
120
+ country="US",
121
+ validity_days=365,
122
+ key_size=2048,
123
+ roles=["user"],
124
+ permissions=["read", "write"],
125
+ ca_cert_path=str(ca_cert_path),
126
+ ca_key_path=str(ca_key_path)
127
+ )
128
+
129
+ user_cert_pair = cert_manager.create_client_certificate(user_config)
130
+ print(f"✅ User client certificate created: {user_cert_pair.certificate_path}")
131
+
132
+ print("🔧 Creating readonly client certificate...")
133
+ # Create readonly client certificate
134
+ readonly_config = ClientCertConfig(
135
+ common_name="readonly",
136
+ organization="MCP Proxy Adapter",
137
+ country="US",
138
+ validity_days=365,
139
+ key_size=2048,
140
+ roles=["readonly"],
141
+ permissions=["read"],
142
+ ca_cert_path=str(ca_cert_path),
143
+ ca_key_path=str(ca_key_path)
144
+ )
145
+
146
+ readonly_cert_pair = cert_manager.create_client_certificate(readonly_config)
147
+ print(f"✅ Readonly client certificate created: {readonly_cert_pair.certificate_path}")
148
+
149
+ print("\n🎉 All certificates generated successfully!")
150
+ print(f"📁 Certificates are stored in the '{cert_dir}' directory")
151
+ print(f"🔑 Private keys are stored in the '{key_dir}' directory")
152
+ print(f"🔐 CA certificate: {ca_cert_path}")
153
+ print(f"🔐 Server certificate: {server_cert_pair.certificate_path}")
154
+ return True
155
+
156
+ except Exception as e:
157
+ print(f"❌ Certificate generation failed: {e}")
158
+ import traceback
159
+ traceback.print_exc()
100
160
  return False
101
- print("\n🎉 All certificates generated successfully!")
102
- print("📁 Certificates are stored in the 'certs' directory")
103
- return True
104
161
  if __name__ == "__main__":
105
162
  success = main()
106
163
  sys.exit(0 if success else 1)
@@ -19,10 +19,8 @@ import sys
19
19
  import time
20
20
  from pathlib import Path
21
21
  from typing import Dict, List, Optional, Any
22
- # Add project root to path
23
- project_root = Path(__file__).parent.parent.parent
24
- sys.path.insert(0, str(project_root))
25
- from security_test_client import SecurityTestClient, TestResult
22
+ # Import security test client with proper module path
23
+ from mcp_proxy_adapter.examples.security_test_client import SecurityTestClient, TestResult
26
24
  class SecurityTestRunner:
27
25
  """Main test runner for security testing."""
28
26
  def __init__(self):
@@ -2,5 +2,5 @@
2
2
  Version information for MCP Proxy Adapter.
3
3
  """
4
4
 
5
- __version__ = "6.2.5"
5
+ __version__ = "6.2.6"
6
6
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mcp-proxy-adapter
3
- Version: 6.2.5
3
+ Version: 6.2.6
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
@@ -34,7 +34,7 @@ Requires-Dist: docstring-parser<1.0.0,>=0.15
34
34
  Requires-Dist: typing-extensions<5.0.0,>=4.5.0
35
35
  Requires-Dist: jsonrpc>=1.2.0
36
36
  Requires-Dist: psutil>=5.9.0
37
- Requires-Dist: mcp_security_framework>=1.1.1
37
+ Requires-Dist: mcp_security_framework>=1.1.2
38
38
  Requires-Dist: packaging>=20.0
39
39
  Requires-Dist: aiohttp<4.0.0,>=3.8.0
40
40
  Requires-Dist: requests<3.0.0,>=2.28.0
@@ -650,7 +650,7 @@ MIT License - see [LICENSE](https://github.com/maverikod/mcp-proxy-adapter/blob/
650
650
 
651
651
  ## 📊 Version
652
652
 
653
- **6.2.5** - Production-ready release with comprehensive security, proxy registration, and PyPI optimization.
653
+ **6.2.6** - Production-ready release with comprehensive security, proxy registration, and PyPI optimization.
654
654
 
655
655
  ---
656
656
 
@@ -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=l-rGcgJ0-YLmyL85-4FVItBoLHeTd35XDIXaeXRdx90,768
2
+ mcp_proxy_adapter/__main__.py,sha256=kS0wlTkQTJ5IXN2sHyaarTJ6XDkpaPcu9nv9DGXcFmY,768
3
3
  mcp_proxy_adapter/config.py,sha256=z4rUbJdxYj6vYw05OM_kMXs1Qn2HRQXGHI9PB4hgPd4,12867
4
4
  mcp_proxy_adapter/custom_openapi.py,sha256=jYUrCy8C1mShh3sjKj-JkzSMLAvxDLTvtzSJFj5HUNg,15023
5
5
  mcp_proxy_adapter/main.py,sha256=_DJwMZdN0393UR-U7xfQh59EpbDDgv1oWPFf-v2MoII,2147
6
6
  mcp_proxy_adapter/openapi.py,sha256=36vOEbJjGnVZR6hUhl6mHCD29HYOEFKo2bL0JdGSm-4,13952
7
- mcp_proxy_adapter/version.py,sha256=tG-J_zC_jpjNn5fUzw8RKMlzNS4-LeIZtsHtixap-8I,75
7
+ mcp_proxy_adapter/version.py,sha256=SxVTHO5GKd27BOlHcmnzOgE67CnXkAnJUdPhWA43Ct4,75
8
8
  mcp_proxy_adapter/api/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
9
9
  mcp_proxy_adapter/api/app.py,sha256=pYrsDWhZAYoYbxujD0MGeOWdTnBUGueIGmZqeAbaB9A,27884
10
10
  mcp_proxy_adapter/api/handlers.py,sha256=DcZT7MVBV33q-0EJ0iFqxE0VgBkFt6d_SqoRkntwyvc,8477
@@ -80,18 +80,18 @@ 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=wZIo2CYE6elIsJy6gju87CyJ7bz1BWxmtDoEwivdsTA,449
83
+ mcp_proxy_adapter/examples/__init__.py,sha256=GkqrX-xH_LOT0GdRZ2OOD0QTAofERsc4U1ajFwUD-_A,449
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
87
87
  mcp_proxy_adapter/examples/demo_client.py,sha256=inic-FP5qG8oQXUaCrtEhmhac_PDZ1pcxp-M1cxSzwA,10240
88
88
  mcp_proxy_adapter/examples/generate_all_certificates.py,sha256=rgcwqIkQ1eDfEIRFRXGIOz-jOSS1w0GPBRhYvMl6Vjc,16948
89
- mcp_proxy_adapter/examples/generate_certificates.py,sha256=KxsltDvO_qpN0MsRv6mCSog-gcEtI18ECyNzpNbKBVw,3672
89
+ mcp_proxy_adapter/examples/generate_certificates.py,sha256=kev902oGeQqtToFTsZn2xkNPT6JVkuaAm7x8vJ5ezrQ,5867
90
90
  mcp_proxy_adapter/examples/generate_certificates_and_tokens.py,sha256=J0qHm_BMY8RYqfuwf7V7xKsHcsRJx8E7x-8JxmW5sPw,15988
91
91
  mcp_proxy_adapter/examples/generate_test_configs.py,sha256=RoasOwO1B6gFaP4b6PjFTKsLSX_saBDhrgNbarpTufI,7648
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
- mcp_proxy_adapter/examples/run_security_tests.py,sha256=xUzsOwKEblZrPFFc-DDfQnWfID9nqGsCvb5VnHtVsT0,10703
94
+ mcp_proxy_adapter/examples/run_security_tests.py,sha256=D1djTn5fx1L4c0J0fwIUGduBneej1jrxzM10kUrGA8o,10668
95
95
  mcp_proxy_adapter/examples/run_security_tests_fixed.py,sha256=fNQsbALf9548xJ0OGPKYx5Crzg1GbcL8CSh1x_oKu_A,10540
96
96
  mcp_proxy_adapter/examples/security_test_client.py,sha256=eBy6pZ5Dhdo-qi_7Fk-IWGHq7zAJA-om8RBuOep4XSs,28022
97
97
  mcp_proxy_adapter/examples/setup_test_environment.py,sha256=erLnM5X4ys4wRl3u0wrnPJsy2luUPMfqxoyk6OZGNCU,7953
@@ -99,7 +99,7 @@ mcp_proxy_adapter/examples/test_config.py,sha256=1X9X8lNlWOcM1ZbIzteeMvLdgxnJEK_
99
99
  mcp_proxy_adapter/examples/test_config_generator.py,sha256=SBKL0bv-kUwUUbwrFVbxuA_6pDvK2573Jxm9wPiyI8s,3927
100
100
  mcp_proxy_adapter/examples/test_examples.py,sha256=KH095FFEQDMKYZglclr5qy3cW__t3H8VX1l8dvCkQos,12132
101
101
  mcp_proxy_adapter/examples/universal_client.py,sha256=IIKGRa0__KoWVla3VnVl-RjkkG_nPpM8vglPm70pV9c,26948
102
- mcp_proxy_adapter/examples/basic_framework/__init__.py,sha256=XtgxpS3kKQFLDh4onP9XayNTDPzkaAbP0ExkTw9BLkk,184
102
+ mcp_proxy_adapter/examples/basic_framework/__init__.py,sha256=4aYD--R6hy9n9CUxj7Osb9HcdVUMJ6_cfpu4ujkbCwI,345
103
103
  mcp_proxy_adapter/examples/basic_framework/main.py,sha256=cDmqeUN1lDBBwuwLjmnP3qIyofCZ3Jr5Ct7Im-qCsUU,1728
104
104
  mcp_proxy_adapter/examples/basic_framework/commands/__init__.py,sha256=_VQNLUEdsxUG-4yt9BZI_vtOxHAdGG0OUSsP6Wj-Vz4,76
105
105
  mcp_proxy_adapter/examples/basic_framework/hooks/__init__.py,sha256=IE_EIXMnkdXuakZn7wLD9kBFyfDF5lYi56ejgiBeb-A,70
@@ -113,8 +113,8 @@ mcp_proxy_adapter/examples/full_application/commands/dynamic_calculator_command.
113
113
  mcp_proxy_adapter/examples/full_application/hooks/__init__.py,sha256=ORG4cL8cSXEMmZ0CEPz75OVuwg54pdDm2GIBpP4dtcs,200
114
114
  mcp_proxy_adapter/examples/full_application/hooks/application_hooks.py,sha256=TYXuHI-KW_mH5r8mSKgNMJCr3moeEKrqC4Eex0U298k,3457
115
115
  mcp_proxy_adapter/examples/full_application/hooks/builtin_command_hooks.py,sha256=IaskSrckZS6bE3aGxSBL8aTj-iJTSI2ysfsFjhjncyM,2975
116
- mcp_proxy_adapter-6.2.5.dist-info/licenses/LICENSE,sha256=6KdtUcTwmTRbJrAmYjVn7e6S-V42ubeDJ-AiVEzZ510,1075
117
- mcp_proxy_adapter-6.2.5.dist-info/METADATA,sha256=FCn3Ohr6kOTW0qOohuLJ0mVSs3Ym0cbBGQQ-NresNPI,22198
118
- mcp_proxy_adapter-6.2.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
119
- mcp_proxy_adapter-6.2.5.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
120
- mcp_proxy_adapter-6.2.5.dist-info/RECORD,,
116
+ mcp_proxy_adapter-6.2.6.dist-info/licenses/LICENSE,sha256=6KdtUcTwmTRbJrAmYjVn7e6S-V42ubeDJ-AiVEzZ510,1075
117
+ mcp_proxy_adapter-6.2.6.dist-info/METADATA,sha256=6lo8JhQY-POJpuLuyFK94wEtMt0FsP0UCEw8v_Xc-74,22198
118
+ mcp_proxy_adapter-6.2.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
119
+ mcp_proxy_adapter-6.2.6.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
120
+ mcp_proxy_adapter-6.2.6.dist-info/RECORD,,