mcp-proxy-adapter 3.0.0__tar.gz → 3.0.2__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.2/MANIFEST.in +28 -0
- {mcp_proxy_adapter-3.0.0/mcp_proxy_adapter.egg-info → mcp_proxy_adapter-3.0.2}/PKG-INFO +1 -1
- mcp_proxy_adapter-3.0.2/docs/EN/AUTOMATED_PUBLISHING.md +121 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/DOCUMENTATION_MAP.md +10 -4
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/OPENAPI_SCHEMA.md +49 -1
- mcp_proxy_adapter-3.0.2/docs/EN/development/COMMAND_METADATA_ENHANCEMENT.md +350 -0
- mcp_proxy_adapter-3.0.2/docs/EN/development/METADATA_COMMANDS.md +149 -0
- mcp_proxy_adapter-3.0.2/docs/EN/development/OPENAPI_CUSTOMIZATION.md +412 -0
- mcp_proxy_adapter-3.0.2/docs/EN/development/TOOL_INTEGRATION.md +252 -0
- mcp_proxy_adapter-3.0.2/docs/RU/AUTOMATED_PUBLISHING.md +121 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/DOCUMENTATION_MAP.md +10 -4
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/OPENAPI_SCHEMA.md +49 -1
- mcp_proxy_adapter-3.0.2/docs/RU/development/COMMAND_METADATA_ENHANCEMENT.md +350 -0
- mcp_proxy_adapter-3.0.2/docs/RU/development/METADATA_COMMANDS.md +149 -0
- mcp_proxy_adapter-3.0.2/docs/RU/development/OPENAPI_CUSTOMIZATION.md +411 -0
- mcp_proxy_adapter-3.0.2/docs/RU/development/PLAN_REALIZACII_METADATA.md +452 -0
- mcp_proxy_adapter-3.0.2/docs/RU/development/TOOL_INTEGRATION.md +252 -0
- mcp_proxy_adapter-3.0.2/examples/basic_example/README.md +245 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/basic_example/config.json +4 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/basic_example/docs/EN/README.md +46 -5
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/basic_example/docs/RU/README.md +46 -5
- mcp_proxy_adapter-3.0.2/examples/basic_example/server.py +151 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/complete_example/commands/system_command.py +1 -0
- mcp_proxy_adapter-3.0.2/examples/complete_example/server.py +113 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/minimal_example/README.md +20 -6
- mcp_proxy_adapter-3.0.2/examples/minimal_example/config.json +14 -0
- mcp_proxy_adapter-3.0.2/examples/minimal_example/main.py +136 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/minimal_example/simple_server.py +53 -14
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/minimal_example/tests/conftest.py +1 -1
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/minimal_example/tests/test_integration.py +8 -10
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/simple_server.py +12 -21
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/test_server.py +22 -14
- mcp_proxy_adapter-3.0.2/examples/tool_description_example.py +82 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/__init__.py +0 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/app.py +391 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/handlers.py +229 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/middleware/__init__.py +49 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/middleware/auth.py +146 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/middleware/base.py +79 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/middleware/error_handling.py +198 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/middleware/logging.py +96 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/middleware/performance.py +83 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/middleware/rate_limit.py +152 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/schemas.py +305 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/tool_integration.py +223 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/api/tools.py +198 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/commands/__init__.py +19 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/commands/base.py +301 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/commands/command_registry.py +231 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/commands/config_command.py +113 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/commands/health_command.py +136 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/commands/help_command.py +193 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/commands/result.py +215 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/mcp_proxy_adapter/config.py +9 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/core/__init__.py +0 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/core/errors.py +173 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/core/logging.py +205 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/core/utils.py +138 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/mcp_proxy_adapter/custom_openapi.py +47 -10
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/py.typed +0 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/schemas/base_schema.json +114 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/schemas/openapi_schema.json +314 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/__init__.py +0 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/api/__init__.py +3 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/api/test_cmd_endpoint.py +115 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/api/test_middleware.py +336 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/commands/__init__.py +3 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/commands/test_config_command.py +211 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/commands/test_echo_command.py +127 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/commands/test_help_command.py +133 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/conftest.py +131 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/functional/__init__.py +3 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/functional/test_api.py +253 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/integration/__init__.py +3 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/integration/test_cmd_integration.py +130 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/integration/test_integration.py +255 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/performance/__init__.py +3 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/performance/test_performance.py +189 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/stubs/__init__.py +10 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/stubs/echo_command.py +104 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/test_api_endpoints.py +271 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/test_api_handlers.py +289 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/test_base_command.py +123 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/test_batch_requests.py +117 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/test_command_registry.py +245 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/test_config.py +127 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/test_utils.py +65 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/unit/__init__.py +3 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/unit/test_base_command.py +130 -0
- mcp_proxy_adapter-3.0.2/mcp_proxy_adapter/tests/unit/test_config.py +217 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/mcp_proxy_adapter/version.py +1 -1
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2/mcp_proxy_adapter.egg-info}/PKG-INFO +1 -1
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/mcp_proxy_adapter.egg-info/SOURCES.txt +71 -7
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/pyproject.toml +25 -4
- mcp_proxy_adapter-3.0.2/requirements.txt +115 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/setup.py +1 -1
- mcp_proxy_adapter-3.0.2/tests/api/test_tool_description.py +240 -0
- mcp_proxy_adapter-3.0.2/tests/commands/test_command_metadata.py +128 -0
- mcp_proxy_adapter-3.0.2/tests/commands/test_help_command.py +202 -0
- mcp_proxy_adapter-3.0.0/MANIFEST.in +0 -12
- mcp_proxy_adapter-3.0.0/code_index.yaml +0 -263
- mcp_proxy_adapter-3.0.0/examples/basic_example/README.md +0 -131
- mcp_proxy_adapter-3.0.0/examples/basic_example/config.yaml +0 -20
- mcp_proxy_adapter-3.0.0/examples/basic_example/main.py +0 -50
- mcp_proxy_adapter-3.0.0/examples/basic_example/server.py +0 -45
- mcp_proxy_adapter-3.0.0/examples/complete_example/main.py +0 -67
- mcp_proxy_adapter-3.0.0/examples/complete_example/server.py +0 -85
- mcp_proxy_adapter-3.0.0/examples/minimal_example/config.json +0 -21
- mcp_proxy_adapter-3.0.0/examples/minimal_example/config.yaml +0 -26
- mcp_proxy_adapter-3.0.0/examples/minimal_example/main.py +0 -67
- mcp_proxy_adapter-3.0.0/mcp_proxy_adapter/framework.py +0 -109
- mcp_proxy_adapter-3.0.0/requirements.txt +0 -9
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/LICENSE +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/README.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/API_SCHEMA.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/BASIC_ARCHITECTURE.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/COMMAND_CHECKLIST.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/COMMAND_RESULTS.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/COMMAND_TEMPLATE.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/CONFIGURATION_PRINCIPLES.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/DOCUMENTATION_STANDARDS.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/ERROR_HANDLING.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/EXAMPLES_COMMAND_CLASSES.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/GLOSSARY.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/LOGGING_SYSTEM.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/NAMING_STANDARDS.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/PROJECT_EXTENSION_GUIDE.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/PROJECT_IDEOLOGY.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/PROJECT_RULES.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/PROJECT_STRUCTURE.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/PUBLISHING_TO_PYPI.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/README.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/api/cmd_endpoint.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/api/errors.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/api/intro.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/api/requests.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/api/responses.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/commands/get_date_command.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/commands/help_command.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/commands/index.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/commands/new_uuid4_command.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/development/REMOVE_COMMAND_GUIDE.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/development/architecture.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/examples/README.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/examples/anti_patterns.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/examples/basic_example.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/examples/complete_example.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/examples/minimal_example.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/testing/README.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/user/basic_usage.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/user/configuration.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/user/deployment.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/user/examples.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/EN/user/installation.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/API_SCHEMA.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/BASIC_ARCHITECTURE.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/COMMAND_CHECKLIST.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/COMMAND_RESULTS.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/COMMAND_TEMPLATE.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/CONFIGURATION_PRINCIPLES.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/DOCUMENTATION_STANDARDS.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/ERROR_HANDLING.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/EXAMPLES_COMMAND_CLASSES.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/GLOSSARY.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/LOGGING_SYSTEM.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/NAMING_STANDARDS.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/PROJECT_EXTENSION_GUIDE.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/PROJECT_IDEOLOGY.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/PROJECT_RULES.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/PROJECT_STRUCTURE.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/PUBLISHING_TO_PYPI.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/README.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/api/cmd_endpoint.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/api/errors.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/api/intro.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/api/requests.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/api/responses.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/commands/get_date_command.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/commands/help_command.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/commands/index.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/commands/new_uuid4_command.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/development/REMOVE_COMMAND_GUIDE.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/development/architecture.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/examples/README.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/examples/anti_patterns.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/examples/basic_example.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/examples/complete_example.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/examples/minimal_example.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/testing/README.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/user/basic_usage.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/user/configuration.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/user/deployment.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/user/examples.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/docs/RU/user/installation.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/__init__.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/anti_patterns/README.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/anti_patterns/__init__.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/anti_patterns/bad_design/README.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/anti_patterns/bad_design/global_state.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/anti_patterns/bad_design/monolithic_command.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/basic_example/__init__.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/basic_example/commands/__init__.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/basic_example/commands/echo_command.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/basic_example/commands/math_command.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/basic_example/commands/time_command.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/basic_example/tests/conftest.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/commands/echo_command.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/commands/echo_result.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/commands/get_date_command.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/commands/new_uuid4_command.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/complete_example/Dockerfile +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/complete_example/README.md +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/complete_example/__init__.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/complete_example/commands/__init__.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/complete_example/config.json +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/complete_example/configs/config.dev.yaml +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/complete_example/configs/config.docker.yaml +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/complete_example/docker-compose.yml +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/complete_example/requirements.txt +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/minimal_example/__init__.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/minimal_example/tests/test_hello_command.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/examples/server.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/mcp_proxy_adapter/__init__.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/mcp_proxy_adapter/openapi.py +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/mcp_proxy_adapter.egg-info/dependency_links.txt +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/mcp_proxy_adapter.egg-info/requires.txt +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/mcp_proxy_adapter.egg-info/top_level.txt +0 -0
- {mcp_proxy_adapter-3.0.0 → mcp_proxy_adapter-3.0.2}/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,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`
|
@@ -17,14 +17,20 @@ The following files must exist in both language versions:
|
|
17
17
|
|---------------|---------|---------|
|
18
18
|
| Project Rules | [PROJECT_RULES.md](./PROJECT_RULES.md) | [PROJECT_RULES.md](../RU/PROJECT_RULES.md) |
|
19
19
|
| Naming Standards | [NAMING_STANDARDS.md](./NAMING_STANDARDS.md) | [NAMING_STANDARDS.md](../RU/NAMING_STANDARDS.md) |
|
20
|
-
|
|
20
|
+
| Project Architecture | [BASIC_ARCHITECTURE.md](./BASIC_ARCHITECTURE.md) | [BASIC_ARCHITECTURE.md](../RU/BASIC_ARCHITECTURE.md) |
|
21
|
+
| Project Structure | [PROJECT_STRUCTURE.md](./PROJECT_STRUCTURE.md) | [PROJECT_STRUCTURE.md](../RU/PROJECT_STRUCTURE.md) |
|
22
|
+
| Project Ideology | [PROJECT_IDEOLOGY.md](./PROJECT_IDEOLOGY.md) | [PROJECT_IDEOLOGY.md](../RU/PROJECT_IDEOLOGY.md) |
|
23
|
+
| API Schema | [API_SCHEMA.md](./API_SCHEMA.md) | [API_SCHEMA.md](../RU/API_SCHEMA.md) |
|
21
24
|
| Documentation Standards | [DOCUMENTATION_STANDARDS.md](./DOCUMENTATION_STANDARDS.md) | [DOCUMENTATION_STANDARDS.md](../RU/DOCUMENTATION_STANDARDS.md) |
|
22
|
-
| Glossary | [GLOSSARY.md](./GLOSSARY.md) | [GLOSSARY.md](../RU/GLOSSARY.md) |
|
23
25
|
| Command Template | [COMMAND_TEMPLATE.md](./COMMAND_TEMPLATE.md) | [COMMAND_TEMPLATE.md](../RU/COMMAND_TEMPLATE.md) |
|
24
|
-
|
|
25
|
-
|
|
26
|
+
| Command Checklist | [COMMAND_CHECKLIST.md](./COMMAND_CHECKLIST.md) | [COMMAND_CHECKLIST.md](../RU/COMMAND_CHECKLIST.md) |
|
27
|
+
| Logging | [LOGGING_SYSTEM.md](./LOGGING_SYSTEM.md) | [LOGGING_SYSTEM.md](../RU/LOGGING_SYSTEM.md) |
|
26
28
|
| Error Handling | [ERROR_HANDLING.md](./ERROR_HANDLING.md) | [ERROR_HANDLING.md](../RU/ERROR_HANDLING.md) |
|
29
|
+
| Command Results | [COMMAND_RESULTS.md](./COMMAND_RESULTS.md) | [COMMAND_RESULTS.md](../RU/COMMAND_RESULTS.md) |
|
30
|
+
| Configuration Principles | [CONFIGURATION_PRINCIPLES.md](./CONFIGURATION_PRINCIPLES.md) | [CONFIGURATION_PRINCIPLES.md](../RU/CONFIGURATION_PRINCIPLES.md) |
|
31
|
+
| Project Extension | [PROJECT_EXTENSION_GUIDE.md](./PROJECT_EXTENSION_GUIDE.md) | [PROJECT_EXTENSION_GUIDE.md](../RU/PROJECT_EXTENSION_GUIDE.md) |
|
27
32
|
| Publishing to PyPI | [PUBLISHING_TO_PYPI.md](./PUBLISHING_TO_PYPI.md) | [PUBLISHING_TO_PYPI.md](../RU/PUBLISHING_TO_PYPI.md) |
|
33
|
+
| Automated Publishing | [AUTOMATED_PUBLISHING.md](./AUTOMATED_PUBLISHING.md) | [AUTOMATED_PUBLISHING.md](../RU/AUTOMATED_PUBLISHING.md) |
|
28
34
|
|
29
35
|
### 2.2. Command Documentation
|
30
36
|
|
@@ -484,4 +484,52 @@ classDiagram
|
|
484
484
|
4. **Compatibility**
|
485
485
|
- Full support for JSON-RPC 2.0
|
486
486
|
- Compliance with OpenAPI 3.0 specification
|
487
|
-
- Backward compatibility with existing clients
|
487
|
+
- Backward compatibility with existing clients
|
488
|
+
|
489
|
+
## Customizing OpenAPI Schema Fields
|
490
|
+
|
491
|
+
You can override the `title`, `description`, and `version` fields of the OpenAPI schema without editing the base schema file. This is done by passing the corresponding parameters to the FastAPI application and using the `custom_openapi` function.
|
492
|
+
|
493
|
+
### Example
|
494
|
+
|
495
|
+
```python
|
496
|
+
from fastapi import FastAPI
|
497
|
+
from mcp_proxy_adapter.custom_openapi import custom_openapi
|
498
|
+
|
499
|
+
app = FastAPI(
|
500
|
+
title="Custom Project Title",
|
501
|
+
description="Custom project description for OpenAPI schema.",
|
502
|
+
version="2.1.0"
|
503
|
+
)
|
504
|
+
|
505
|
+
# Use custom OpenAPI schema
|
506
|
+
default_openapi = app.openapi
|
507
|
+
app.openapi = lambda: custom_openapi(app)
|
508
|
+
|
509
|
+
# Now /openapi.json will reflect the custom title, description, and version
|
510
|
+
```
|
511
|
+
|
512
|
+
**Advantages:**
|
513
|
+
- No need to manually edit the base OpenAPI schema file.
|
514
|
+
- Flexible for use in different projects.
|
515
|
+
- Standard FastAPI fields are used for customization.
|
516
|
+
|
517
|
+
### Test Example
|
518
|
+
|
519
|
+
A test is provided to ensure that custom `title`, `description`, and `version` are correctly set in the OpenAPI schema:
|
520
|
+
|
521
|
+
```python
|
522
|
+
def test_custom_openapi_schema_fields():
|
523
|
+
from fastapi import FastAPI
|
524
|
+
from mcp_proxy_adapter.custom_openapi import custom_openapi
|
525
|
+
|
526
|
+
app = FastAPI(
|
527
|
+
title="Custom Title",
|
528
|
+
description="Custom Description",
|
529
|
+
version="9.9.9"
|
530
|
+
)
|
531
|
+
schema = custom_openapi(app)
|
532
|
+
assert schema["info"]["title"] == "Custom Title"
|
533
|
+
assert schema["info"]["description"] == "Custom Description"
|
534
|
+
assert schema["info"]["version"] == "9.9.9"
|
535
|
+
```
|
@@ -0,0 +1,350 @@
|
|
1
|
+
# Enhancing Command Metadata
|
2
|
+
|
3
|
+
## Problem
|
4
|
+
|
5
|
+
Currently, the command registry stores command classes, but does not provide a convenient way to access command metadata without creating an instance of the command. Metadata about commands should be more readily available and structured to:
|
6
|
+
|
7
|
+
1. Support better documentation
|
8
|
+
2. Provide AI tools with rich information about available commands
|
9
|
+
3. Improve the help command's output
|
10
|
+
4. Enable better introspection capabilities
|
11
|
+
|
12
|
+
## Proposed Solution
|
13
|
+
|
14
|
+
Enhance the Command class and CommandRegistry to support comprehensive metadata retrieval:
|
15
|
+
|
16
|
+
1. Add a `get_metadata()` class method to the base Command class
|
17
|
+
2. Update the CommandRegistry to provide access to command metadata
|
18
|
+
3. Keep the existing command class storage for backward compatibility
|
19
|
+
|
20
|
+
## Implementation Plan
|
21
|
+
|
22
|
+
### 1. Enhance the Command Base Class
|
23
|
+
|
24
|
+
Add a new `get_metadata()` class method to the Command base class:
|
25
|
+
|
26
|
+
```python
|
27
|
+
@classmethod
|
28
|
+
def get_metadata(cls) -> Dict[str, Any]:
|
29
|
+
"""
|
30
|
+
Returns comprehensive metadata about the command.
|
31
|
+
|
32
|
+
This provides a single entry point for all command metadata.
|
33
|
+
|
34
|
+
Returns:
|
35
|
+
Dict with command metadata
|
36
|
+
"""
|
37
|
+
# Get docstring and format it
|
38
|
+
doc = cls.__doc__ or ""
|
39
|
+
description = inspect.cleandoc(doc) if doc else ""
|
40
|
+
|
41
|
+
# Extract first line for summary
|
42
|
+
summary = description.split("\n")[0] if description else ""
|
43
|
+
|
44
|
+
# Get parameter info
|
45
|
+
param_info = cls.get_param_info()
|
46
|
+
|
47
|
+
# Generate example(s) based on parameters
|
48
|
+
examples = cls._generate_examples(param_info)
|
49
|
+
|
50
|
+
return {
|
51
|
+
"name": cls.name,
|
52
|
+
"summary": summary,
|
53
|
+
"description": description,
|
54
|
+
"params": param_info,
|
55
|
+
"examples": examples,
|
56
|
+
"schema": cls.get_schema(),
|
57
|
+
"result_schema": cls.get_result_schema(),
|
58
|
+
"result_class": cls.result_class.__name__ if hasattr(cls, "result_class") else None,
|
59
|
+
}
|
60
|
+
|
61
|
+
@classmethod
|
62
|
+
def _generate_examples(cls, params: Dict[str, Dict[str, Any]]) -> List[Dict[str, Any]]:
|
63
|
+
"""
|
64
|
+
Generate usage examples for the command based on its parameters.
|
65
|
+
|
66
|
+
Args:
|
67
|
+
params: Command parameters information
|
68
|
+
|
69
|
+
Returns:
|
70
|
+
List of examples
|
71
|
+
"""
|
72
|
+
examples = []
|
73
|
+
|
74
|
+
# Simple example without parameters if all parameters are optional
|
75
|
+
if not any(param.get("required", False) for param in params.values()):
|
76
|
+
examples.append({
|
77
|
+
"command": cls.name,
|
78
|
+
"description": f"Call the {cls.name} command without parameters"
|
79
|
+
})
|
80
|
+
|
81
|
+
# Example with all required parameters
|
82
|
+
required_params = {k: v for k, v in params.items() if v.get("required", False)}
|
83
|
+
if required_params:
|
84
|
+
example_params = {}
|
85
|
+
for param_name, param_info in required_params.items():
|
86
|
+
# Generate appropriate example value based on parameter type
|
87
|
+
param_type = param_info.get("type", "")
|
88
|
+
if "str" in param_type.lower():
|
89
|
+
example_params[param_name] = f"example_{param_name}"
|
90
|
+
elif "int" in param_type.lower():
|
91
|
+
example_params[param_name] = 123
|
92
|
+
elif "float" in param_type.lower():
|
93
|
+
example_params[param_name] = 123.45
|
94
|
+
elif "bool" in param_type.lower():
|
95
|
+
example_params[param_name] = True
|
96
|
+
else:
|
97
|
+
example_params[param_name] = f"value_for_{param_name}"
|
98
|
+
|
99
|
+
examples.append({
|
100
|
+
"command": cls.name,
|
101
|
+
"params": example_params,
|
102
|
+
"description": f"Call the {cls.name} command with required parameters"
|
103
|
+
})
|
104
|
+
|
105
|
+
# Add an example with all parameters if there are optional ones
|
106
|
+
optional_params = {k: v for k, v in params.items() if not v.get("required", False)}
|
107
|
+
if optional_params and required_params:
|
108
|
+
full_example_params = dict(example_params) if 'example_params' in locals() else {}
|
109
|
+
|
110
|
+
for param_name, param_info in optional_params.items():
|
111
|
+
# Get default value or generate appropriate example
|
112
|
+
if "default" in param_info:
|
113
|
+
full_example_params[param_name] = param_info["default"]
|
114
|
+
else:
|
115
|
+
# Generate appropriate example value based on parameter type
|
116
|
+
param_type = param_info.get("type", "")
|
117
|
+
if "str" in param_type.lower():
|
118
|
+
full_example_params[param_name] = f"optional_{param_name}"
|
119
|
+
elif "int" in param_type.lower():
|
120
|
+
full_example_params[param_name] = 456
|
121
|
+
elif "float" in param_type.lower():
|
122
|
+
full_example_params[param_name] = 45.67
|
123
|
+
elif "bool" in param_type.lower():
|
124
|
+
full_example_params[param_name] = False
|
125
|
+
else:
|
126
|
+
full_example_params[param_name] = f"optional_value_for_{param_name}"
|
127
|
+
|
128
|
+
examples.append({
|
129
|
+
"command": cls.name,
|
130
|
+
"params": full_example_params,
|
131
|
+
"description": f"Call the {cls.name} command with all parameters"
|
132
|
+
})
|
133
|
+
|
134
|
+
return examples
|
135
|
+
```
|
136
|
+
|
137
|
+
### 2. Enhance the CommandRegistry
|
138
|
+
|
139
|
+
Update the CommandRegistry to provide access to command metadata:
|
140
|
+
|
141
|
+
```python
|
142
|
+
def get_command_metadata(self, command_name: str) -> Dict[str, Any]:
|
143
|
+
"""
|
144
|
+
Get comprehensive metadata for a command.
|
145
|
+
|
146
|
+
Args:
|
147
|
+
command_name: Name of the command
|
148
|
+
|
149
|
+
Returns:
|
150
|
+
Dict with command metadata
|
151
|
+
|
152
|
+
Raises:
|
153
|
+
NotFoundError: If command is not found
|
154
|
+
"""
|
155
|
+
command_class = self.get_command(command_name)
|
156
|
+
return command_class.get_metadata()
|
157
|
+
|
158
|
+
def get_all_metadata(self) -> Dict[str, Dict[str, Any]]:
|
159
|
+
"""
|
160
|
+
Get metadata for all registered commands.
|
161
|
+
|
162
|
+
Returns:
|
163
|
+
Dict with command names as keys and metadata as values
|
164
|
+
"""
|
165
|
+
metadata = {}
|
166
|
+
for name, command_class in self._commands.items():
|
167
|
+
metadata[name] = command_class.get_metadata()
|
168
|
+
return metadata
|
169
|
+
```
|
170
|
+
|
171
|
+
### 3. Update the Help Command
|
172
|
+
|
173
|
+
Enhance the HelpCommand to use the new metadata:
|
174
|
+
|
175
|
+
```python
|
176
|
+
async def execute(self, cmdname: Optional[str] = None) -> HelpResult:
|
177
|
+
"""
|
178
|
+
Execute help command.
|
179
|
+
|
180
|
+
Args:
|
181
|
+
cmdname: Name of the command to get information about (optional)
|
182
|
+
|
183
|
+
Returns:
|
184
|
+
HelpResult: Help command result
|
185
|
+
|
186
|
+
Raises:
|
187
|
+
NotFoundError: If specified command not found
|
188
|
+
"""
|
189
|
+
# If cmdname is provided, return information about specific command
|
190
|
+
if cmdname:
|
191
|
+
try:
|
192
|
+
# Get command metadata from registry
|
193
|
+
command_metadata = registry.get_command_metadata(cmdname)
|
194
|
+
return HelpResult(command_info=command_metadata)
|
195
|
+
except NotFoundError:
|
196
|
+
# If command not found, raise error
|
197
|
+
raise NotFoundError(f"Command '{cmdname}' not found")
|
198
|
+
|
199
|
+
# Otherwise, return information about all available commands
|
200
|
+
# and tool metadata
|
201
|
+
|
202
|
+
# Get metadata for all commands
|
203
|
+
all_metadata = registry.get_all_metadata()
|
204
|
+
|
205
|
+
# Prepare response format with tool metadata
|
206
|
+
result = {
|
207
|
+
"tool_info": {
|
208
|
+
"name": "MCP-Proxy API Service",
|
209
|
+
"description": "JSON-RPC API for executing microservice commands",
|
210
|
+
"version": "1.0.0"
|
211
|
+
},
|
212
|
+
"help_usage": {
|
213
|
+
"description": "Get information about commands",
|
214
|
+
"examples": [
|
215
|
+
{"command": "help", "description": "List all available commands"},
|
216
|
+
{"command": "help", "params": {"cmdname": "command_name"}, "description": "Get detailed info about a specific command"}
|
217
|
+
]
|
218
|
+
},
|
219
|
+
"commands": {}
|
220
|
+
}
|
221
|
+
|
222
|
+
# Add command summaries
|
223
|
+
for name, metadata in all_metadata.items():
|
224
|
+
result["commands"][name] = {
|
225
|
+
"summary": metadata["summary"],
|
226
|
+
"params_count": len(metadata["params"])
|
227
|
+
}
|
228
|
+
|
229
|
+
return HelpResult(commands_info=result)
|
230
|
+
```
|
231
|
+
|
232
|
+
### 4. Update the HelpResult Class
|
233
|
+
|
234
|
+
```python
|
235
|
+
class HelpResult(CommandResult):
|
236
|
+
"""
|
237
|
+
Result of the help command execution.
|
238
|
+
"""
|
239
|
+
|
240
|
+
def __init__(self, commands_info: Optional[Dict[str, Any]] = None, command_info: Optional[Dict[str, Any]] = None):
|
241
|
+
"""
|
242
|
+
Initialize help command result.
|
243
|
+
|
244
|
+
Args:
|
245
|
+
commands_info: Information about all commands (for request without parameters)
|
246
|
+
command_info: Information about a specific command (for request with cmdname parameter)
|
247
|
+
"""
|
248
|
+
self.commands_info = commands_info
|
249
|
+
self.command_info = command_info
|
250
|
+
|
251
|
+
def to_dict(self) -> Dict[str, Any]:
|
252
|
+
"""
|
253
|
+
Convert result to dictionary.
|
254
|
+
|
255
|
+
Returns:
|
256
|
+
Dict[str, Any]: Result as dictionary
|
257
|
+
"""
|
258
|
+
if self.command_info:
|
259
|
+
return {
|
260
|
+
"cmdname": self.command_info["name"],
|
261
|
+
"info": {
|
262
|
+
"description": self.command_info["description"],
|
263
|
+
"summary": self.command_info["summary"],
|
264
|
+
"params": self.command_info["params"],
|
265
|
+
"examples": self.command_info["examples"]
|
266
|
+
}
|
267
|
+
}
|
268
|
+
|
269
|
+
# For list of all commands, return as is (already formatted)
|
270
|
+
result = self.commands_info.copy()
|
271
|
+
|
272
|
+
# Add total count and usage note
|
273
|
+
result["total"] = len(result["commands"])
|
274
|
+
result["note"] = "To get detailed information about a specific command, call help with parameter: POST /cmd {\"command\": \"help\", \"params\": {\"cmdname\": \"<command_name>\"}}. Only the 'cmdname' parameter is supported."
|
275
|
+
|
276
|
+
return result
|
277
|
+
```
|
278
|
+
|
279
|
+
## Expected Results
|
280
|
+
|
281
|
+
### 1. Detailed command information
|
282
|
+
|
283
|
+
```json
|
284
|
+
{
|
285
|
+
"cmdname": "echo",
|
286
|
+
"info": {
|
287
|
+
"description": "Command that echoes back input message.\n\nThis command demonstrates simple parameter handling.",
|
288
|
+
"summary": "Command that echoes back input message",
|
289
|
+
"params": {
|
290
|
+
"message": {
|
291
|
+
"name": "message",
|
292
|
+
"required": true,
|
293
|
+
"type": "str",
|
294
|
+
"description": "Message to echo back"
|
295
|
+
}
|
296
|
+
},
|
297
|
+
"examples": [
|
298
|
+
{
|
299
|
+
"command": "echo",
|
300
|
+
"params": {"message": "example_message"},
|
301
|
+
"description": "Call the echo command with required parameters"
|
302
|
+
}
|
303
|
+
]
|
304
|
+
}
|
305
|
+
}
|
306
|
+
```
|
307
|
+
|
308
|
+
### 2. Enhanced command list with metadata
|
309
|
+
|
310
|
+
```json
|
311
|
+
{
|
312
|
+
"tool_info": {
|
313
|
+
"name": "MCP-Proxy API Service",
|
314
|
+
"description": "JSON-RPC API for executing microservice commands",
|
315
|
+
"version": "1.0.0"
|
316
|
+
},
|
317
|
+
"help_usage": {
|
318
|
+
"description": "Get information about commands",
|
319
|
+
"examples": [
|
320
|
+
{"command": "help", "description": "List all available commands"},
|
321
|
+
{"command": "help", "params": {"cmdname": "command_name"}, "description": "Get detailed info about a specific command"}
|
322
|
+
]
|
323
|
+
},
|
324
|
+
"commands": {
|
325
|
+
"help": {
|
326
|
+
"summary": "Command for getting help information about available commands",
|
327
|
+
"params_count": 1
|
328
|
+
},
|
329
|
+
"echo": {
|
330
|
+
"summary": "Command that echoes back input message",
|
331
|
+
"params_count": 1
|
332
|
+
},
|
333
|
+
"math": {
|
334
|
+
"summary": "Command for performing basic math operations",
|
335
|
+
"params_count": 3
|
336
|
+
}
|
337
|
+
},
|
338
|
+
"total": 3,
|
339
|
+
"note": "To get detailed information about a specific command, call help with parameter: POST /cmd {\"command\": \"help\", \"params\": {\"cmdname\": \"<command_name>\"}}. Only the 'cmdname' parameter is supported."
|
340
|
+
}
|
341
|
+
```
|
342
|
+
|
343
|
+
## Benefits
|
344
|
+
|
345
|
+
1. More comprehensive command metadata
|
346
|
+
2. Better documentation capabilities
|
347
|
+
3. Enhanced help command output with usage examples
|
348
|
+
4. Improved API self-description
|
349
|
+
5. Better support for AI tools integration
|
350
|
+
6. Cleaner separation of metadata and implementation
|