mcp-proxy-adapter 2.1.17__tar.gz → 3.0.1__tar.gz
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-3.0.1/MANIFEST.in +28 -0
- mcp_proxy_adapter-3.0.1/PKG-INFO +200 -0
- mcp_proxy_adapter-3.0.1/README.md +148 -0
- mcp_proxy_adapter-3.0.1/docs/EN/API_SCHEMA.md +183 -0
- mcp_proxy_adapter-3.0.1/docs/EN/AUTOMATED_PUBLISHING.md +121 -0
- mcp_proxy_adapter-3.0.1/docs/EN/BASIC_ARCHITECTURE.md +210 -0
- mcp_proxy_adapter-3.0.1/docs/EN/COMMAND_CHECKLIST.md +81 -0
- mcp_proxy_adapter-3.0.1/docs/EN/COMMAND_RESULTS.md +252 -0
- mcp_proxy_adapter-3.0.1/docs/EN/COMMAND_TEMPLATE.md +283 -0
- mcp_proxy_adapter-3.0.1/docs/EN/CONFIGURATION_PRINCIPLES.md +305 -0
- mcp_proxy_adapter-3.0.1/docs/EN/DOCUMENTATION_MAP.md +92 -0
- mcp_proxy_adapter-3.0.1/docs/EN/DOCUMENTATION_STANDARDS.md +118 -0
- mcp_proxy_adapter-3.0.1/docs/EN/ERROR_HANDLING.md +225 -0
- mcp_proxy_adapter-3.0.1/docs/EN/EXAMPLES_COMMAND_CLASSES.md +87 -0
- mcp_proxy_adapter-3.0.1/docs/EN/GLOSSARY.md +53 -0
- mcp_proxy_adapter-3.0.1/docs/EN/LOGGING_SYSTEM.md +258 -0
- mcp_proxy_adapter-3.0.1/docs/EN/NAMING_STANDARDS.md +216 -0
- mcp_proxy_adapter-3.0.1/docs/EN/OPENAPI_SCHEMA.md +487 -0
- mcp_proxy_adapter-3.0.1/docs/EN/PROJECT_EXTENSION_GUIDE.md +696 -0
- mcp_proxy_adapter-3.0.1/docs/EN/PROJECT_IDEOLOGY.md +139 -0
- mcp_proxy_adapter-3.0.1/docs/EN/PROJECT_RULES.md +161 -0
- mcp_proxy_adapter-3.0.1/docs/EN/PROJECT_STRUCTURE.md +166 -0
- mcp_proxy_adapter-3.0.1/docs/EN/PUBLISHING_TO_PYPI.md +175 -0
- mcp_proxy_adapter-3.0.1/docs/EN/README.md +20 -0
- mcp_proxy_adapter-3.0.1/docs/EN/api/cmd_endpoint.md +177 -0
- mcp_proxy_adapter-3.0.1/docs/EN/api/errors.md +100 -0
- mcp_proxy_adapter-3.0.1/docs/EN/api/intro.md +30 -0
- mcp_proxy_adapter-3.0.1/docs/EN/api/requests.md +79 -0
- mcp_proxy_adapter-3.0.1/docs/EN/api/responses.md +104 -0
- mcp_proxy_adapter-3.0.1/docs/EN/commands/get_date_command.md +128 -0
- mcp_proxy_adapter-3.0.1/docs/EN/commands/help_command.md +239 -0
- mcp_proxy_adapter-3.0.1/docs/EN/commands/index.md +54 -0
- mcp_proxy_adapter-3.0.1/docs/EN/commands/new_uuid4_command.md +110 -0
- mcp_proxy_adapter-3.0.1/docs/EN/development/COMMAND_METADATA_ENHANCEMENT.md +350 -0
- mcp_proxy_adapter-3.0.1/docs/EN/development/METADATA_COMMANDS.md +149 -0
- mcp_proxy_adapter-3.0.1/docs/EN/development/OPENAPI_CUSTOMIZATION.md +412 -0
- mcp_proxy_adapter-3.0.1/docs/EN/development/REMOVE_COMMAND_GUIDE.md +122 -0
- mcp_proxy_adapter-3.0.1/docs/EN/development/TOOL_INTEGRATION.md +252 -0
- mcp_proxy_adapter-3.0.1/docs/EN/development/architecture.md +97 -0
- mcp_proxy_adapter-3.0.1/docs/EN/examples/README.md +37 -0
- mcp_proxy_adapter-3.0.1/docs/EN/examples/anti_patterns.md +156 -0
- mcp_proxy_adapter-3.0.1/docs/EN/examples/basic_example.md +168 -0
- mcp_proxy_adapter-3.0.1/docs/EN/examples/complete_example.md +190 -0
- mcp_proxy_adapter-3.0.1/docs/EN/examples/minimal_example.md +127 -0
- mcp_proxy_adapter-3.0.1/docs/EN/testing/README.md +172 -0
- mcp_proxy_adapter-3.0.1/docs/EN/user/basic_usage.md +122 -0
- mcp_proxy_adapter-3.0.1/docs/EN/user/configuration.md +67 -0
- mcp_proxy_adapter-3.0.1/docs/EN/user/deployment.md +166 -0
- mcp_proxy_adapter-3.0.1/docs/EN/user/examples.md +169 -0
- mcp_proxy_adapter-3.0.1/docs/EN/user/installation.md +56 -0
- mcp_proxy_adapter-3.0.1/docs/RU/API_SCHEMA.md +183 -0
- mcp_proxy_adapter-3.0.1/docs/RU/AUTOMATED_PUBLISHING.md +121 -0
- mcp_proxy_adapter-3.0.1/docs/RU/BASIC_ARCHITECTURE.md +210 -0
- mcp_proxy_adapter-3.0.1/docs/RU/COMMAND_CHECKLIST.md +152 -0
- mcp_proxy_adapter-3.0.1/docs/RU/COMMAND_RESULTS.md +286 -0
- mcp_proxy_adapter-3.0.1/docs/RU/COMMAND_TEMPLATE.md +283 -0
- mcp_proxy_adapter-3.0.1/docs/RU/CONFIGURATION_PRINCIPLES.md +305 -0
- mcp_proxy_adapter-3.0.1/docs/RU/DOCUMENTATION_MAP.md +92 -0
- mcp_proxy_adapter-3.0.1/docs/RU/DOCUMENTATION_STANDARDS.md +118 -0
- mcp_proxy_adapter-3.0.1/docs/RU/ERROR_HANDLING.md +225 -0
- mcp_proxy_adapter-3.0.1/docs/RU/EXAMPLES_COMMAND_CLASSES.md +87 -0
- mcp_proxy_adapter-3.0.1/docs/RU/GLOSSARY.md +53 -0
- mcp_proxy_adapter-3.0.1/docs/RU/LOGGING_SYSTEM.md +258 -0
- mcp_proxy_adapter-3.0.1/docs/RU/NAMING_STANDARDS.md +216 -0
- mcp_proxy_adapter-3.0.1/docs/RU/OPENAPI_SCHEMA.md +487 -0
- mcp_proxy_adapter-3.0.1/docs/RU/PROJECT_EXTENSION_GUIDE.md +612 -0
- mcp_proxy_adapter-3.0.1/docs/RU/PROJECT_IDEOLOGY.md +139 -0
- mcp_proxy_adapter-3.0.1/docs/RU/PROJECT_RULES.md +161 -0
- mcp_proxy_adapter-3.0.1/docs/RU/PROJECT_STRUCTURE.md +166 -0
- mcp_proxy_adapter-3.0.1/docs/RU/PUBLISHING_TO_PYPI.md +175 -0
- mcp_proxy_adapter-3.0.1/docs/RU/README.md +20 -0
- mcp_proxy_adapter-3.0.1/docs/RU/api/cmd_endpoint.md +177 -0
- mcp_proxy_adapter-3.0.1/docs/RU/api/errors.md +100 -0
- mcp_proxy_adapter-3.0.1/docs/RU/api/intro.md +30 -0
- mcp_proxy_adapter-3.0.1/docs/RU/api/requests.md +79 -0
- mcp_proxy_adapter-3.0.1/docs/RU/api/responses.md +104 -0
- mcp_proxy_adapter-3.0.1/docs/RU/commands/get_date_command.md +128 -0
- mcp_proxy_adapter-3.0.1/docs/RU/commands/help_command.md +239 -0
- mcp_proxy_adapter-3.0.1/docs/RU/commands/index.md +54 -0
- mcp_proxy_adapter-3.0.1/docs/RU/commands/new_uuid4_command.md +110 -0
- mcp_proxy_adapter-3.0.1/docs/RU/development/COMMAND_METADATA_ENHANCEMENT.md +350 -0
- mcp_proxy_adapter-3.0.1/docs/RU/development/METADATA_COMMANDS.md +149 -0
- mcp_proxy_adapter-3.0.1/docs/RU/development/OPENAPI_CUSTOMIZATION.md +411 -0
- mcp_proxy_adapter-3.0.1/docs/RU/development/PLAN_REALIZACII_METADATA.md +452 -0
- mcp_proxy_adapter-3.0.1/docs/RU/development/REMOVE_COMMAND_GUIDE.md +122 -0
- mcp_proxy_adapter-3.0.1/docs/RU/development/TOOL_INTEGRATION.md +252 -0
- mcp_proxy_adapter-3.0.1/docs/RU/development/architecture.md +97 -0
- mcp_proxy_adapter-3.0.1/docs/RU/examples/README.md +37 -0
- mcp_proxy_adapter-3.0.1/docs/RU/examples/anti_patterns.md +156 -0
- mcp_proxy_adapter-3.0.1/docs/RU/examples/basic_example.md +168 -0
- mcp_proxy_adapter-3.0.1/docs/RU/examples/complete_example.md +190 -0
- mcp_proxy_adapter-3.0.1/docs/RU/examples/minimal_example.md +127 -0
- mcp_proxy_adapter-3.0.1/docs/RU/testing/README.md +172 -0
- mcp_proxy_adapter-3.0.1/docs/RU/user/basic_usage.md +122 -0
- mcp_proxy_adapter-3.0.1/docs/RU/user/configuration.md +67 -0
- mcp_proxy_adapter-3.0.1/docs/RU/user/deployment.md +166 -0
- mcp_proxy_adapter-3.0.1/docs/RU/user/examples.md +169 -0
- mcp_proxy_adapter-3.0.1/docs/RU/user/installation.md +56 -0
- mcp_proxy_adapter-3.0.1/examples/__init__.py +19 -0
- mcp_proxy_adapter-3.0.1/examples/anti_patterns/README.md +51 -0
- mcp_proxy_adapter-3.0.1/examples/anti_patterns/__init__.py +9 -0
- mcp_proxy_adapter-3.0.1/examples/anti_patterns/bad_design/README.md +72 -0
- mcp_proxy_adapter-3.0.1/examples/anti_patterns/bad_design/global_state.py +170 -0
- mcp_proxy_adapter-3.0.1/examples/anti_patterns/bad_design/monolithic_command.py +272 -0
- mcp_proxy_adapter-3.0.1/examples/basic_example/README.md +245 -0
- mcp_proxy_adapter-3.0.1/examples/basic_example/__init__.py +8 -0
- mcp_proxy_adapter-3.0.1/examples/basic_example/commands/__init__.py +5 -0
- mcp_proxy_adapter-3.0.1/examples/basic_example/commands/echo_command.py +95 -0
- mcp_proxy_adapter-3.0.1/examples/basic_example/commands/math_command.py +151 -0
- mcp_proxy_adapter-3.0.1/examples/basic_example/commands/time_command.py +152 -0
- mcp_proxy_adapter-3.0.1/examples/basic_example/config.json +25 -0
- mcp_proxy_adapter-3.0.1/examples/basic_example/docs/EN/README.md +177 -0
- mcp_proxy_adapter-3.0.1/examples/basic_example/docs/RU/README.md +177 -0
- mcp_proxy_adapter-3.0.1/examples/basic_example/server.py +151 -0
- mcp_proxy_adapter-3.0.1/examples/basic_example/tests/conftest.py +243 -0
- mcp_proxy_adapter-3.0.1/examples/commands/echo_command.py +52 -0
- mcp_proxy_adapter-3.0.1/examples/commands/echo_result.py +65 -0
- mcp_proxy_adapter-3.0.1/examples/commands/get_date_command.py +98 -0
- mcp_proxy_adapter-3.0.1/examples/commands/new_uuid4_command.py +91 -0
- mcp_proxy_adapter-3.0.1/examples/complete_example/Dockerfile +24 -0
- mcp_proxy_adapter-3.0.1/examples/complete_example/README.md +92 -0
- mcp_proxy_adapter-3.0.1/examples/complete_example/__init__.py +8 -0
- mcp_proxy_adapter-3.0.1/examples/complete_example/commands/__init__.py +5 -0
- mcp_proxy_adapter-3.0.1/examples/complete_example/commands/system_command.py +328 -0
- mcp_proxy_adapter-3.0.1/examples/complete_example/config.json +41 -0
- mcp_proxy_adapter-3.0.1/examples/complete_example/configs/config.dev.yaml +40 -0
- mcp_proxy_adapter-3.0.1/examples/complete_example/configs/config.docker.yaml +40 -0
- mcp_proxy_adapter-3.0.1/examples/complete_example/docker-compose.yml +35 -0
- mcp_proxy_adapter-3.0.1/examples/complete_example/requirements.txt +20 -0
- mcp_proxy_adapter-3.0.1/examples/complete_example/server.py +139 -0
- mcp_proxy_adapter-3.0.1/examples/minimal_example/README.md +65 -0
- mcp_proxy_adapter-3.0.1/examples/minimal_example/__init__.py +8 -0
- mcp_proxy_adapter-3.0.1/examples/minimal_example/config.json +14 -0
- mcp_proxy_adapter-3.0.1/examples/minimal_example/main.py +136 -0
- mcp_proxy_adapter-3.0.1/examples/minimal_example/simple_server.py +163 -0
- mcp_proxy_adapter-3.0.1/examples/minimal_example/tests/conftest.py +171 -0
- mcp_proxy_adapter-3.0.1/examples/minimal_example/tests/test_hello_command.py +111 -0
- mcp_proxy_adapter-3.0.1/examples/minimal_example/tests/test_integration.py +181 -0
- mcp_proxy_adapter-3.0.1/examples/server.py +69 -0
- mcp_proxy_adapter-3.0.1/examples/simple_server.py +128 -0
- mcp_proxy_adapter-3.0.1/examples/test_server.py +134 -0
- mcp_proxy_adapter-3.0.1/examples/tool_description_example.py +82 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/__init__.py +33 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/__init__.py +0 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/app.py +391 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/handlers.py +229 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/middleware/__init__.py +49 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/middleware/auth.py +146 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/middleware/base.py +79 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/middleware/error_handling.py +198 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/middleware/logging.py +96 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/middleware/performance.py +83 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/middleware/rate_limit.py +152 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/schemas.py +305 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/tool_integration.py +223 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/api/tools.py +198 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/commands/__init__.py +19 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/commands/base.py +301 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/commands/command_registry.py +231 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/commands/config_command.py +113 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/commands/health_command.py +136 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/commands/help_command.py +193 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/commands/result.py +215 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/config.py +195 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/core/__init__.py +0 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/core/errors.py +173 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/core/logging.py +205 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/core/utils.py +138 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/custom_openapi.py +125 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/openapi.py +403 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/py.typed +0 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/schemas/base_schema.json +114 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/schemas/openapi_schema.json +314 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/__init__.py +0 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/api/__init__.py +3 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/api/test_cmd_endpoint.py +115 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/api/test_middleware.py +336 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/commands/__init__.py +3 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/commands/test_config_command.py +211 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/commands/test_echo_command.py +127 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/commands/test_help_command.py +133 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/conftest.py +131 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/functional/__init__.py +3 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/functional/test_api.py +235 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/integration/__init__.py +3 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/integration/test_cmd_integration.py +130 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/integration/test_integration.py +255 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/performance/__init__.py +3 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/performance/test_performance.py +189 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/stubs/__init__.py +10 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/stubs/echo_command.py +104 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/test_api_endpoints.py +271 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/test_api_handlers.py +289 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/test_base_command.py +123 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/test_batch_requests.py +117 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/test_command_registry.py +245 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/test_config.py +127 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/test_utils.py +65 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/unit/__init__.py +3 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/unit/test_base_command.py +130 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/tests/unit/test_config.py +217 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter/version.py +3 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter.egg-info/PKG-INFO +200 -0
- mcp_proxy_adapter-3.0.1/mcp_proxy_adapter.egg-info/SOURCES.txt +213 -0
- {mcp_proxy_adapter-2.1.17 → mcp_proxy_adapter-3.0.1}/mcp_proxy_adapter.egg-info/requires.txt +2 -0
- {mcp_proxy_adapter-2.1.17 → mcp_proxy_adapter-3.0.1}/mcp_proxy_adapter.egg-info/top_level.txt +1 -0
- mcp_proxy_adapter-3.0.1/pyproject.toml +70 -0
- mcp_proxy_adapter-3.0.1/requirements.txt +115 -0
- mcp_proxy_adapter-3.0.1/setup.py +50 -0
- mcp_proxy_adapter-3.0.1/tests/api/test_tool_description.py +240 -0
- mcp_proxy_adapter-3.0.1/tests/commands/test_command_metadata.py +128 -0
- mcp_proxy_adapter-3.0.1/tests/commands/test_help_command.py +202 -0
- mcp_proxy_adapter-2.1.17/MANIFEST.in +0 -12
- mcp_proxy_adapter-2.1.17/PKG-INFO +0 -376
- mcp_proxy_adapter-2.1.17/README.md +0 -344
- mcp_proxy_adapter-2.1.17/code_index.yaml +0 -263
- mcp_proxy_adapter-2.1.17/docs/RU/FAQ_HOWTO.md +0 -95
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/__init__.py +0 -1
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/adapter.py +0 -697
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/analyzers/__init__.py +0 -1
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/analyzers/docstring_analyzer.py +0 -199
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/analyzers/type_analyzer.py +0 -151
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/dispatchers/__init__.py +0 -1
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/dispatchers/base_dispatcher.py +0 -85
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/dispatchers/json_rpc_dispatcher.py +0 -262
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/examples/analyze_config.py +0 -141
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/examples/basic_integration.py +0 -155
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/examples/docstring_and_schema_example.py +0 -69
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/examples/extension_example.py +0 -72
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/examples/help_best_practices.py +0 -67
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/examples/help_usage.py +0 -64
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/examples/mcp_proxy_client.py +0 -131
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/examples/openapi_server.py +0 -383
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/examples/project_structure_example.py +0 -47
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/examples/testing_example.py +0 -64
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/models.py +0 -47
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/registry.py +0 -439
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/schema.py +0 -257
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/testing_utils.py +0 -112
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/validators/__init__.py +0 -1
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/validators/docstring_validator.py +0 -75
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter/validators/metadata_validator.py +0 -76
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter.egg-info/PKG-INFO +0 -376
- mcp_proxy_adapter-2.1.17/mcp_proxy_adapter.egg-info/SOURCES.txt +0 -50
- mcp_proxy_adapter-2.1.17/pyproject.toml +0 -50
- mcp_proxy_adapter-2.1.17/requirements.txt +0 -10
- mcp_proxy_adapter-2.1.17/setup.py +0 -46
- mcp_proxy_adapter-2.1.17/tests/conftest.py +0 -12
- mcp_proxy_adapter-2.1.17/tests/test_adapter.py +0 -529
- mcp_proxy_adapter-2.1.17/tests/test_adapter_coverage.py +0 -274
- mcp_proxy_adapter-2.1.17/tests/test_basic_dispatcher.py +0 -175
- mcp_proxy_adapter-2.1.17/tests/test_command_registry.py +0 -332
- mcp_proxy_adapter-2.1.17/tests/test_examples.py +0 -32
- mcp_proxy_adapter-2.1.17/tests/test_mcp_proxy_adapter.py +0 -568
- mcp_proxy_adapter-2.1.17/tests/test_mcp_proxy_adapter_basic.py +0 -262
- mcp_proxy_adapter-2.1.17/tests/test_part1.py +0 -348
- mcp_proxy_adapter-2.1.17/tests/test_part2.py +0 -524
- mcp_proxy_adapter-2.1.17/tests/test_schema.py +0 -358
- mcp_proxy_adapter-2.1.17/tests/test_simple_adapter.py +0 -255
- {mcp_proxy_adapter-2.1.17 → mcp_proxy_adapter-3.0.1}/LICENSE +0 -0
- {mcp_proxy_adapter-2.1.17 → mcp_proxy_adapter-3.0.1}/mcp_proxy_adapter.egg-info/dependency_links.txt +0 -0
- {mcp_proxy_adapter-2.1.17 → mcp_proxy_adapter-3.0.1}/setup.cfg +0 -0
@@ -0,0 +1,28 @@
|
|
1
|
+
include README.md
|
2
|
+
include LICENSE
|
3
|
+
include requirements.txt
|
4
|
+
include pyproject.toml
|
5
|
+
include code_index.yaml
|
6
|
+
include mcp_proxy_adapter/py.typed
|
7
|
+
|
8
|
+
# Основные модули пакета
|
9
|
+
recursive-include mcp_proxy_adapter *.py *.json *.yaml
|
10
|
+
recursive-include mcp_proxy_adapter/api *.py
|
11
|
+
recursive-include mcp_proxy_adapter/commands *.py
|
12
|
+
recursive-include mcp_proxy_adapter/core *.py
|
13
|
+
recursive-include mcp_proxy_adapter/schemas *.json *.yaml
|
14
|
+
|
15
|
+
# Документация
|
16
|
+
recursive-include docs *.md
|
17
|
+
|
18
|
+
# Примеры
|
19
|
+
recursive-include examples *.py *.json *.yaml *.md *.txt *.yml Dockerfile
|
20
|
+
|
21
|
+
# Тесты
|
22
|
+
recursive-include tests *.py
|
23
|
+
|
24
|
+
# Исключения
|
25
|
+
global-exclude __pycache__
|
26
|
+
global-exclude *.py[cod]
|
27
|
+
global-exclude *.so
|
28
|
+
global-exclude .DS_Store
|
@@ -0,0 +1,200 @@
|
|
1
|
+
Metadata-Version: 2.4
|
2
|
+
Name: mcp_proxy_adapter
|
3
|
+
Version: 3.0.1
|
4
|
+
Summary: Reliable microservice with unified JSON-RPC endpoint
|
5
|
+
Home-page: https://github.com/yourusername/mcp-proxy-adapter
|
6
|
+
Author: MCP Team
|
7
|
+
Author-email: Vasiliy Zubarev <vasiliy.zubarev@example.com>
|
8
|
+
License: MIT License
|
9
|
+
|
10
|
+
Copyright (c) 2023-2024 Vasiliy VZ
|
11
|
+
|
12
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
13
|
+
of this software and associated documentation files (the "Software"), to deal
|
14
|
+
in the Software without restriction, including without limitation the rights
|
15
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
16
|
+
copies of the Software, and to permit persons to whom the Software is
|
17
|
+
furnished to do so, subject to the following conditions:
|
18
|
+
|
19
|
+
The above copyright notice and this permission notice shall be included in all
|
20
|
+
copies or substantial portions of the Software.
|
21
|
+
|
22
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
23
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
24
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
25
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
26
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
27
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
28
|
+
SOFTWARE.
|
29
|
+
Project-URL: Documentation, https://github.com/maverikod/vvz-mcp-proxy-adapter/tree/main/docs/RU/README.md
|
30
|
+
Project-URL: Source, https://github.com/maverikod/vvz-mcp-proxy-adapter
|
31
|
+
Project-URL: Bug Reports, https://github.com/maverikod/vvz-mcp-proxy-adapter/issues
|
32
|
+
Classifier: Programming Language :: Python :: 3
|
33
|
+
Classifier: License :: OSI Approved :: MIT License
|
34
|
+
Classifier: Operating System :: OS Independent
|
35
|
+
Classifier: Framework :: FastAPI
|
36
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
37
|
+
Classifier: Intended Audience :: Developers
|
38
|
+
Requires-Python: >=3.9
|
39
|
+
Description-Content-Type: text/markdown
|
40
|
+
License-File: LICENSE
|
41
|
+
Requires-Dist: fastapi<1.0.0,>=0.95.0
|
42
|
+
Requires-Dist: pydantic>=2.0.0
|
43
|
+
Requires-Dist: uvicorn<1.0.0,>=0.22.0
|
44
|
+
Requires-Dist: docstring-parser<1.0.0,>=0.15
|
45
|
+
Requires-Dist: typing-extensions<5.0.0,>=4.5.0
|
46
|
+
Requires-Dist: jsonrpc>=1.2.0
|
47
|
+
Requires-Dist: psutil>=5.9.0
|
48
|
+
Dynamic: author
|
49
|
+
Dynamic: home-page
|
50
|
+
Dynamic: license-file
|
51
|
+
Dynamic: requires-python
|
52
|
+
|
53
|
+
# MCP Proxy Adapter
|
54
|
+
|
55
|
+
**MCP Proxy Adapter** - это фреймворк для создания микросервисов на основе JSON-RPC. Он предоставляет базовую инфраструктуру для создания команд, обработки запросов и возвращения ответов через JSON-RPC API.
|
56
|
+
|
57
|
+
**MCP Proxy Adapter** - это фреймворк для создания микросервисов на основе JSON-RPC. Он предоставляет базовую инфраструктуру для создания команд, обработки запросов и возвращения ответов через JSON-RPC API.
|
58
|
+
|
59
|
+
## Установка
|
60
|
+
|
61
|
+
```bash
|
62
|
+
pip install mcp-proxy-adapter
|
63
|
+
```
|
64
|
+
|
65
|
+
## Использование
|
66
|
+
|
67
|
+
1. Создайте свой проект и установите зависимость:
|
68
|
+
|
69
|
+
```bash
|
70
|
+
pip install mcp-proxy-adapter
|
71
|
+
```
|
72
|
+
|
73
|
+
2. Создайте свои команды:
|
74
|
+
|
75
|
+
```python
|
76
|
+
from mcp_proxy_adapter.commands.base import Command
|
77
|
+
from mcp_proxy_adapter.commands.result import SuccessResult
|
78
|
+
|
79
|
+
class YourCommand(Command):
|
80
|
+
name = "your_command"
|
81
|
+
|
82
|
+
async def execute(self, param1: str, param2: int = 0) -> SuccessResult:
|
83
|
+
# Ваша логика
|
84
|
+
result_data = {"param1": param1, "param2": param2}
|
85
|
+
return SuccessResult(data=result_data)
|
86
|
+
```
|
87
|
+
|
88
|
+
3. Запустите сервер:
|
89
|
+
|
90
|
+
```python
|
91
|
+
import uvicorn
|
92
|
+
from mcp_proxy_adapter.api.app import create_app
|
93
|
+
|
94
|
+
# Регистрация ваших команд происходит автоматически
|
95
|
+
app = create_app()
|
96
|
+
|
97
|
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|
98
|
+
```
|
99
|
+
|
100
|
+
## Структура проекта
|
101
|
+
|
102
|
+
Проект представляет собой фреймворк с базовой инфраструктурой:
|
103
|
+
|
104
|
+
* **mcp_proxy_adapter/** - основной модуль фреймворка
|
105
|
+
* **api/** - модуль API
|
106
|
+
* **commands/** - базовые классы команд
|
107
|
+
* **core/** - ядро фреймворка
|
108
|
+
* **schemas/** - JSON-схемы
|
109
|
+
* **examples/** - примеры использования фреймворка
|
110
|
+
* **basic_example/** - базовый пример
|
111
|
+
* **minimal_example/** - минимальный пример
|
112
|
+
* **complete_example/** - полный пример с Docker
|
113
|
+
|
114
|
+
## Базовые команды
|
115
|
+
|
116
|
+
Фреймворк включает следующие базовые команды:
|
117
|
+
|
118
|
+
- `help` - получение справки по доступным командам
|
119
|
+
- `health` - проверка состояния сервиса
|
120
|
+
|
121
|
+
## API
|
122
|
+
|
123
|
+
Фреймворк предоставляет следующие эндпоинты:
|
124
|
+
|
125
|
+
- `POST /api/jsonrpc` - основной JSON-RPC эндпоинт для выполнения команд
|
126
|
+
- `POST /api/command/{command_name}` - REST эндпоинт для выполнения конкретной команды
|
127
|
+
- `GET /api/commands` - получение списка доступных команд
|
128
|
+
- `GET /api/commands/{command_name}` - получение информации о конкретной команде
|
129
|
+
- `GET /health` - проверка состояния сервиса
|
130
|
+
|
131
|
+
## Запуск примеров
|
132
|
+
|
133
|
+
```bash
|
134
|
+
# Базовый пример
|
135
|
+
cd examples/basic_example
|
136
|
+
python main.py
|
137
|
+
|
138
|
+
# Минимальный пример
|
139
|
+
cd examples/minimal_example
|
140
|
+
python main.py
|
141
|
+
|
142
|
+
# Полный пример с Docker
|
143
|
+
cd examples/complete_example
|
144
|
+
docker-compose up -d
|
145
|
+
```
|
146
|
+
|
147
|
+
## Создание новой команды
|
148
|
+
|
149
|
+
Пример создания новой команды:
|
150
|
+
|
151
|
+
```python
|
152
|
+
from typing import Dict, Any, ClassVar, Type
|
153
|
+
from mcp_proxy_adapter.commands.base import Command
|
154
|
+
from mcp_proxy_adapter.commands.result import SuccessResult
|
155
|
+
|
156
|
+
class CustomResult(SuccessResult):
|
157
|
+
"""
|
158
|
+
Пользовательский класс результата.
|
159
|
+
"""
|
160
|
+
|
161
|
+
def __init__(self, value: str):
|
162
|
+
super().__init__(data={"value": value})
|
163
|
+
|
164
|
+
@classmethod
|
165
|
+
def get_schema(cls) -> Dict[str, Any]:
|
166
|
+
return {
|
167
|
+
"type": "object",
|
168
|
+
"properties": {
|
169
|
+
"data": {
|
170
|
+
"type": "object",
|
171
|
+
"properties": {
|
172
|
+
"value": {"type": "string"}
|
173
|
+
},
|
174
|
+
"required": ["value"]
|
175
|
+
}
|
176
|
+
},
|
177
|
+
"required": ["data"]
|
178
|
+
}
|
179
|
+
|
180
|
+
class CustomCommand(Command):
|
181
|
+
"""
|
182
|
+
Пользовательская команда.
|
183
|
+
"""
|
184
|
+
|
185
|
+
name: ClassVar[str] = "custom"
|
186
|
+
result_class: ClassVar[Type[SuccessResult]] = CustomResult
|
187
|
+
|
188
|
+
async def execute(self, input_text: str) -> CustomResult:
|
189
|
+
return CustomResult(value=f"Processed: {input_text}")
|
190
|
+
|
191
|
+
@classmethod
|
192
|
+
def get_schema(cls) -> Dict[str, Any]:
|
193
|
+
return {
|
194
|
+
"type": "object",
|
195
|
+
"properties": {
|
196
|
+
"input_text": {"type": "string"}
|
197
|
+
},
|
198
|
+
"required": ["input_text"],
|
199
|
+
"additionalProperties": False
|
200
|
+
}
|
@@ -0,0 +1,148 @@
|
|
1
|
+
# MCP Proxy Adapter
|
2
|
+
|
3
|
+
**MCP Proxy Adapter** - это фреймворк для создания микросервисов на основе JSON-RPC. Он предоставляет базовую инфраструктуру для создания команд, обработки запросов и возвращения ответов через JSON-RPC API.
|
4
|
+
|
5
|
+
**MCP Proxy Adapter** - это фреймворк для создания микросервисов на основе JSON-RPC. Он предоставляет базовую инфраструктуру для создания команд, обработки запросов и возвращения ответов через JSON-RPC API.
|
6
|
+
|
7
|
+
## Установка
|
8
|
+
|
9
|
+
```bash
|
10
|
+
pip install mcp-proxy-adapter
|
11
|
+
```
|
12
|
+
|
13
|
+
## Использование
|
14
|
+
|
15
|
+
1. Создайте свой проект и установите зависимость:
|
16
|
+
|
17
|
+
```bash
|
18
|
+
pip install mcp-proxy-adapter
|
19
|
+
```
|
20
|
+
|
21
|
+
2. Создайте свои команды:
|
22
|
+
|
23
|
+
```python
|
24
|
+
from mcp_proxy_adapter.commands.base import Command
|
25
|
+
from mcp_proxy_adapter.commands.result import SuccessResult
|
26
|
+
|
27
|
+
class YourCommand(Command):
|
28
|
+
name = "your_command"
|
29
|
+
|
30
|
+
async def execute(self, param1: str, param2: int = 0) -> SuccessResult:
|
31
|
+
# Ваша логика
|
32
|
+
result_data = {"param1": param1, "param2": param2}
|
33
|
+
return SuccessResult(data=result_data)
|
34
|
+
```
|
35
|
+
|
36
|
+
3. Запустите сервер:
|
37
|
+
|
38
|
+
```python
|
39
|
+
import uvicorn
|
40
|
+
from mcp_proxy_adapter.api.app import create_app
|
41
|
+
|
42
|
+
# Регистрация ваших команд происходит автоматически
|
43
|
+
app = create_app()
|
44
|
+
|
45
|
+
uvicorn.run(app, host="0.0.0.0", port=8000)
|
46
|
+
```
|
47
|
+
|
48
|
+
## Структура проекта
|
49
|
+
|
50
|
+
Проект представляет собой фреймворк с базовой инфраструктурой:
|
51
|
+
|
52
|
+
* **mcp_proxy_adapter/** - основной модуль фреймворка
|
53
|
+
* **api/** - модуль API
|
54
|
+
* **commands/** - базовые классы команд
|
55
|
+
* **core/** - ядро фреймворка
|
56
|
+
* **schemas/** - JSON-схемы
|
57
|
+
* **examples/** - примеры использования фреймворка
|
58
|
+
* **basic_example/** - базовый пример
|
59
|
+
* **minimal_example/** - минимальный пример
|
60
|
+
* **complete_example/** - полный пример с Docker
|
61
|
+
|
62
|
+
## Базовые команды
|
63
|
+
|
64
|
+
Фреймворк включает следующие базовые команды:
|
65
|
+
|
66
|
+
- `help` - получение справки по доступным командам
|
67
|
+
- `health` - проверка состояния сервиса
|
68
|
+
|
69
|
+
## API
|
70
|
+
|
71
|
+
Фреймворк предоставляет следующие эндпоинты:
|
72
|
+
|
73
|
+
- `POST /api/jsonrpc` - основной JSON-RPC эндпоинт для выполнения команд
|
74
|
+
- `POST /api/command/{command_name}` - REST эндпоинт для выполнения конкретной команды
|
75
|
+
- `GET /api/commands` - получение списка доступных команд
|
76
|
+
- `GET /api/commands/{command_name}` - получение информации о конкретной команде
|
77
|
+
- `GET /health` - проверка состояния сервиса
|
78
|
+
|
79
|
+
## Запуск примеров
|
80
|
+
|
81
|
+
```bash
|
82
|
+
# Базовый пример
|
83
|
+
cd examples/basic_example
|
84
|
+
python main.py
|
85
|
+
|
86
|
+
# Минимальный пример
|
87
|
+
cd examples/minimal_example
|
88
|
+
python main.py
|
89
|
+
|
90
|
+
# Полный пример с Docker
|
91
|
+
cd examples/complete_example
|
92
|
+
docker-compose up -d
|
93
|
+
```
|
94
|
+
|
95
|
+
## Создание новой команды
|
96
|
+
|
97
|
+
Пример создания новой команды:
|
98
|
+
|
99
|
+
```python
|
100
|
+
from typing import Dict, Any, ClassVar, Type
|
101
|
+
from mcp_proxy_adapter.commands.base import Command
|
102
|
+
from mcp_proxy_adapter.commands.result import SuccessResult
|
103
|
+
|
104
|
+
class CustomResult(SuccessResult):
|
105
|
+
"""
|
106
|
+
Пользовательский класс результата.
|
107
|
+
"""
|
108
|
+
|
109
|
+
def __init__(self, value: str):
|
110
|
+
super().__init__(data={"value": value})
|
111
|
+
|
112
|
+
@classmethod
|
113
|
+
def get_schema(cls) -> Dict[str, Any]:
|
114
|
+
return {
|
115
|
+
"type": "object",
|
116
|
+
"properties": {
|
117
|
+
"data": {
|
118
|
+
"type": "object",
|
119
|
+
"properties": {
|
120
|
+
"value": {"type": "string"}
|
121
|
+
},
|
122
|
+
"required": ["value"]
|
123
|
+
}
|
124
|
+
},
|
125
|
+
"required": ["data"]
|
126
|
+
}
|
127
|
+
|
128
|
+
class CustomCommand(Command):
|
129
|
+
"""
|
130
|
+
Пользовательская команда.
|
131
|
+
"""
|
132
|
+
|
133
|
+
name: ClassVar[str] = "custom"
|
134
|
+
result_class: ClassVar[Type[SuccessResult]] = CustomResult
|
135
|
+
|
136
|
+
async def execute(self, input_text: str) -> CustomResult:
|
137
|
+
return CustomResult(value=f"Processed: {input_text}")
|
138
|
+
|
139
|
+
@classmethod
|
140
|
+
def get_schema(cls) -> Dict[str, Any]:
|
141
|
+
return {
|
142
|
+
"type": "object",
|
143
|
+
"properties": {
|
144
|
+
"input_text": {"type": "string"}
|
145
|
+
},
|
146
|
+
"required": ["input_text"],
|
147
|
+
"additionalProperties": False
|
148
|
+
}
|
@@ -0,0 +1,183 @@
|
|
1
|
+
# API and Interaction Schema
|
2
|
+
|
3
|
+
## Basic Principles
|
4
|
+
|
5
|
+
1. **Single Entry Point for Commands**
|
6
|
+
- All commands are executed through a unified mechanism, regardless of the calling method (REST or JSON-RPC)
|
7
|
+
- The intermediate layer (adapter) transforms incoming requests into a unified format
|
8
|
+
|
9
|
+
2. **Supported Protocols**
|
10
|
+
- JSON-RPC 2.0 (`/cmd`)
|
11
|
+
- REST API (standard endpoints + `/cmd`)
|
12
|
+
|
13
|
+
3. **Response Format**
|
14
|
+
- Always returns HTTP code 200
|
15
|
+
- Response body is always in JSON-RPC 2.0 format
|
16
|
+
- Errors are transmitted in the error field of the JSON-RPC response
|
17
|
+
- HTTP codes 4xx and 5xx are not used
|
18
|
+
|
19
|
+
## Request and Response Structure
|
20
|
+
|
21
|
+
### JSON-RPC Format
|
22
|
+
|
23
|
+
```json
|
24
|
+
// Request
|
25
|
+
{
|
26
|
+
"jsonrpc": "2.0",
|
27
|
+
"method": "command_name",
|
28
|
+
"params": {
|
29
|
+
"param1": "value1",
|
30
|
+
"param2": "value2"
|
31
|
+
},
|
32
|
+
"id": 1
|
33
|
+
}
|
34
|
+
|
35
|
+
// Successful response
|
36
|
+
{
|
37
|
+
"jsonrpc": "2.0",
|
38
|
+
"result": {
|
39
|
+
"data": "command result"
|
40
|
+
},
|
41
|
+
"id": 1
|
42
|
+
}
|
43
|
+
|
44
|
+
// Error response
|
45
|
+
{
|
46
|
+
"jsonrpc": "2.0",
|
47
|
+
"error": {
|
48
|
+
"code": -32000,
|
49
|
+
"message": "Error description",
|
50
|
+
"data": {
|
51
|
+
"details": "Additional error info"
|
52
|
+
}
|
53
|
+
},
|
54
|
+
"id": 1
|
55
|
+
}
|
56
|
+
```
|
57
|
+
|
58
|
+
### REST Format
|
59
|
+
|
60
|
+
```
|
61
|
+
GET /api/v1/commands # List of available commands
|
62
|
+
GET /api/v1/commands/{name} # Command information
|
63
|
+
POST /cmd # Command execution (similar to JSON-RPC)
|
64
|
+
```
|
65
|
+
|
66
|
+
The response is always wrapped in JSON-RPC format:
|
67
|
+
|
68
|
+
```json
|
69
|
+
// GET /api/v1/commands
|
70
|
+
{
|
71
|
+
"jsonrpc": "2.0",
|
72
|
+
"result": {
|
73
|
+
"commands": [
|
74
|
+
{
|
75
|
+
"name": "command1",
|
76
|
+
"description": "Command description",
|
77
|
+
"params": {...}
|
78
|
+
}
|
79
|
+
]
|
80
|
+
},
|
81
|
+
"id": null
|
82
|
+
}
|
83
|
+
```
|
84
|
+
|
85
|
+
## Intermediate Layer (Adapter)
|
86
|
+
|
87
|
+
```python
|
88
|
+
class CommandAdapter:
|
89
|
+
"""
|
90
|
+
Intermediate layer for transforming REST/RPC requests
|
91
|
+
into a unified command format
|
92
|
+
"""
|
93
|
+
|
94
|
+
async def execute_command(self, command: str, params: dict) -> CommandResult:
|
95
|
+
"""Single point of command execution"""
|
96
|
+
pass
|
97
|
+
|
98
|
+
def to_jsonrpc_response(self, result: CommandResult) -> dict:
|
99
|
+
"""Converting the result to JSON-RPC format"""
|
100
|
+
pass
|
101
|
+
```
|
102
|
+
|
103
|
+
## OpenAPI Schema
|
104
|
+
|
105
|
+
The schema must correspond to the MCP Proxy format (port 8001):
|
106
|
+
|
107
|
+
```yaml
|
108
|
+
openapi: 3.0.0
|
109
|
+
paths:
|
110
|
+
/cmd:
|
111
|
+
post:
|
112
|
+
requestBody:
|
113
|
+
content:
|
114
|
+
application/json:
|
115
|
+
schema:
|
116
|
+
$ref: '#/components/schemas/CommandRequest'
|
117
|
+
responses:
|
118
|
+
'200':
|
119
|
+
content:
|
120
|
+
application/json:
|
121
|
+
schema:
|
122
|
+
$ref: '#/components/schemas/JsonRpcResponse'
|
123
|
+
components:
|
124
|
+
schemas:
|
125
|
+
CommandRequest:
|
126
|
+
type: object
|
127
|
+
properties:
|
128
|
+
jsonrpc:
|
129
|
+
type: string
|
130
|
+
enum: ['2.0']
|
131
|
+
method:
|
132
|
+
type: string
|
133
|
+
params:
|
134
|
+
type: object
|
135
|
+
id:
|
136
|
+
type: [integer, string, null]
|
137
|
+
JsonRpcResponse:
|
138
|
+
type: object
|
139
|
+
properties:
|
140
|
+
jsonrpc:
|
141
|
+
type: string
|
142
|
+
enum: ['2.0']
|
143
|
+
result:
|
144
|
+
type: object
|
145
|
+
error:
|
146
|
+
type: object
|
147
|
+
id:
|
148
|
+
type: [integer, string, null]
|
149
|
+
```
|
150
|
+
|
151
|
+
## Error Handling
|
152
|
+
|
153
|
+
All errors are returned in JSON-RPC format with HTTP code 200:
|
154
|
+
|
155
|
+
| Error Type | code | message |
|
156
|
+
|------------|------|---------|
|
157
|
+
| Parse error | -32700 | "Parse error" |
|
158
|
+
| Invalid Request | -32600 | "Invalid Request" |
|
159
|
+
| Method not found | -32601 | "Method not found" |
|
160
|
+
| Invalid params | -32602 | "Invalid params" |
|
161
|
+
| Internal error | -32603 | "Internal error" |
|
162
|
+
| Server error | -32000 to -32099 | "Server error" |
|
163
|
+
|
164
|
+
## Usage Examples
|
165
|
+
|
166
|
+
### REST Request
|
167
|
+
```bash
|
168
|
+
curl -X GET http://localhost:8000/api/v1/commands
|
169
|
+
```
|
170
|
+
|
171
|
+
### JSON-RPC Request
|
172
|
+
```bash
|
173
|
+
curl -X POST http://localhost:8000/cmd \
|
174
|
+
-H "Content-Type: application/json" \
|
175
|
+
-d '{
|
176
|
+
"jsonrpc": "2.0",
|
177
|
+
"method": "get_status",
|
178
|
+
"params": {},
|
179
|
+
"id": 1
|
180
|
+
}'
|
181
|
+
```
|
182
|
+
|
183
|
+
Both requests will be processed through a unified mechanism and return a response in JSON-RPC format.
|
@@ -0,0 +1,121 @@
|
|
1
|
+
# Automated Package Publishing
|
2
|
+
|
3
|
+
## Introduction
|
4
|
+
|
5
|
+
This document describes the automated process for publishing the `mcp_proxy_adapter` package to PyPI using the developed scripts.
|
6
|
+
|
7
|
+
## Publishing Scripts
|
8
|
+
|
9
|
+
The project includes the following scripts to automate the publishing process:
|
10
|
+
|
11
|
+
1. `scripts/publish_and_test.py` - main script for publishing and testing
|
12
|
+
2. `scripts/test_install.py` - script for verifying the correctness of package installation
|
13
|
+
|
14
|
+
## Publishing Process
|
15
|
+
|
16
|
+
### 1. Preparation for Publishing
|
17
|
+
|
18
|
+
Before publishing, make sure to check:
|
19
|
+
- All necessary code changes have been made
|
20
|
+
- Tests pass successfully
|
21
|
+
- Documentation is updated
|
22
|
+
|
23
|
+
### 2. Automated Publishing
|
24
|
+
|
25
|
+
To publish the package, use the `publish_and_test.py` script:
|
26
|
+
|
27
|
+
```bash
|
28
|
+
# Update version and publish to main PyPI
|
29
|
+
python scripts/publish_and_test.py --version 3.0.1
|
30
|
+
|
31
|
+
# Publish to TestPyPI
|
32
|
+
python scripts/publish_and_test.py --test
|
33
|
+
|
34
|
+
# Build package only without publishing
|
35
|
+
python scripts/publish_and_test.py --build-only
|
36
|
+
```
|
37
|
+
|
38
|
+
### 3. What the Publishing Script Does
|
39
|
+
|
40
|
+
The `publish_and_test.py` script performs the following actions:
|
41
|
+
|
42
|
+
1. **Version Update** (when the `--version` parameter is specified):
|
43
|
+
- Updates the version in `mcp_proxy_adapter/version.py`
|
44
|
+
- Adds a new entry to the `CHANGELOG.md` and `CHANGELOG_ru.md` files
|
45
|
+
|
46
|
+
2. **Package Building**:
|
47
|
+
- Cleans previous builds
|
48
|
+
- Creates `.tar.gz` and `.whl` archives
|
49
|
+
|
50
|
+
3. **Package Publishing**:
|
51
|
+
- Uploads the package to PyPI or TestPyPI
|
52
|
+
|
53
|
+
4. **Installation Testing**:
|
54
|
+
- Creates an isolated environment
|
55
|
+
- Installs the package
|
56
|
+
- Verifies the correctness of the installation
|
57
|
+
- Tests project creation
|
58
|
+
|
59
|
+
### 4. Manual Testing
|
60
|
+
|
61
|
+
For manual testing of package installation, you can use the `test_install.py` script:
|
62
|
+
|
63
|
+
```bash
|
64
|
+
python scripts/test_install.py
|
65
|
+
```
|
66
|
+
|
67
|
+
## Requirements
|
68
|
+
|
69
|
+
The following tools are required to use the publishing scripts:
|
70
|
+
|
71
|
+
1. Python 3.6 or higher
|
72
|
+
2. `build` and `twine` modules:
|
73
|
+
```bash
|
74
|
+
pip install build twine
|
75
|
+
```
|
76
|
+
3. Configured access to PyPI (`.pypirc` file or environment variables)
|
77
|
+
|
78
|
+
## Configuring Access to PyPI
|
79
|
+
|
80
|
+
### 1. Using a Configuration File
|
81
|
+
|
82
|
+
Create a `~/.pypirc` file with the following content:
|
83
|
+
|
84
|
+
```ini
|
85
|
+
[distutils]
|
86
|
+
index-servers =
|
87
|
+
pypi
|
88
|
+
testpypi
|
89
|
+
|
90
|
+
[pypi]
|
91
|
+
username = __token__
|
92
|
+
password = pypi-API-token
|
93
|
+
|
94
|
+
[testpypi]
|
95
|
+
repository = https://test.pypi.org/legacy/
|
96
|
+
username = __token__
|
97
|
+
password = testpypi-API-token
|
98
|
+
```
|
99
|
+
|
100
|
+
### 2. Using Environment Variables
|
101
|
+
|
102
|
+
```bash
|
103
|
+
export TWINE_USERNAME=__token__
|
104
|
+
export TWINE_PASSWORD=pypi-API-token
|
105
|
+
```
|
106
|
+
|
107
|
+
## Troubleshooting
|
108
|
+
|
109
|
+
### Publishing Error
|
110
|
+
|
111
|
+
If an error occurs when publishing the package, check:
|
112
|
+
1. Correctness of PyPI credentials
|
113
|
+
2. Uniqueness of the package version (you cannot re-upload an already published version)
|
114
|
+
3. Compliance of the package name with PyPI requirements
|
115
|
+
|
116
|
+
### Installation Error
|
117
|
+
|
118
|
+
If the package is installed but errors occur during import:
|
119
|
+
1. Check if all necessary files are included in the package (MANIFEST.in)
|
120
|
+
2. Make sure dependencies are correctly specified in setup.py or pyproject.toml
|
121
|
+
3. Try installing the package in debug mode: `pip install -v mcp_proxy_adapter`
|