mcp-proxy-adapter 2.1.9__py3-none-any.whl → 2.1.10__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- mcp_proxy_adapter/adapter.py +3 -13
- mcp_proxy_adapter/dispatchers/json_rpc_dispatcher.py +17 -11
- mcp_proxy_adapter/examples/help_best_practices.py +2 -2
- mcp_proxy_adapter/examples/help_usage.py +2 -2
- {mcp_proxy_adapter-2.1.9.dist-info → mcp_proxy_adapter-2.1.10.dist-info}/METADATA +1 -1
- {mcp_proxy_adapter-2.1.9.dist-info → mcp_proxy_adapter-2.1.10.dist-info}/RECORD +9 -9
- {mcp_proxy_adapter-2.1.9.dist-info → mcp_proxy_adapter-2.1.10.dist-info}/WHEEL +0 -0
- {mcp_proxy_adapter-2.1.9.dist-info → mcp_proxy_adapter-2.1.10.dist-info}/licenses/LICENSE +0 -0
- {mcp_proxy_adapter-2.1.9.dist-info → mcp_proxy_adapter-2.1.10.dist-info}/top_level.txt +0 -0
mcp_proxy_adapter/adapter.py
CHANGED
@@ -493,13 +493,6 @@ class MCPProxyAdapter:
|
|
493
493
|
"details": "Request requires 'command', 'method' or 'params' field"
|
494
494
|
}
|
495
495
|
}
|
496
|
-
# Подмена help -> __help
|
497
|
-
if command == "help":
|
498
|
-
command = "__help"
|
499
|
-
# Переименовываем параметр внутри params
|
500
|
-
if "command" in params:
|
501
|
-
params["cmdname"] = params.pop("command")
|
502
|
-
logger.info(f"[DEBUG] MCP CMD: command={command}, params={params}")
|
503
496
|
|
504
497
|
# Check if command exists
|
505
498
|
if command not in self.registry.dispatcher.get_valid_commands():
|
@@ -508,14 +501,12 @@ class MCPProxyAdapter:
|
|
508
501
|
"error": {
|
509
502
|
"code": 404,
|
510
503
|
"message": f"Unknown command: {command}",
|
511
|
-
"details": f"
|
504
|
+
"details": f"Command '{command}' not found in registry. Available commands: {', '.join(self.registry.dispatcher.get_valid_commands())}"
|
512
505
|
}
|
513
506
|
}
|
514
507
|
|
515
|
-
logger.info(f"[DEBUG] MCP CMD: command={command}, params={params}")
|
516
508
|
# Check for required parameters
|
517
509
|
command_info = self.registry.dispatcher.get_command_info(command)
|
518
|
-
logger.info(f"[DEBUG] MCP CMD: command_info={command_info}")
|
519
510
|
if command_info and "params" in command_info:
|
520
511
|
missing_params = []
|
521
512
|
for param_name, param_info in command_info["params"].items():
|
@@ -531,7 +522,7 @@ class MCPProxyAdapter:
|
|
531
522
|
"details": f"Command '{command}' requires following parameters: {', '.join(missing_params)}"
|
532
523
|
}
|
533
524
|
}
|
534
|
-
|
525
|
+
|
535
526
|
# Check parameter types
|
536
527
|
type_errors = self._validate_param_types(command, params)
|
537
528
|
if type_errors:
|
@@ -543,10 +534,9 @@ class MCPProxyAdapter:
|
|
543
534
|
"details": "Check parameter types and try again"
|
544
535
|
}
|
545
536
|
}
|
546
|
-
|
537
|
+
|
547
538
|
# Execute the command
|
548
539
|
try:
|
549
|
-
logger.info(f"[DEBUG] MCP CMD: executing command={command}, params={params}")
|
550
540
|
result = self.registry.dispatcher.execute(command, **params)
|
551
541
|
|
552
542
|
# Return result in MCP Proxy format
|
@@ -41,7 +41,7 @@ class JsonRpcDispatcher(BaseDispatcher):
|
|
41
41
|
description="Returns information about available commands",
|
42
42
|
summary="Command help",
|
43
43
|
params={
|
44
|
-
"
|
44
|
+
"command": {
|
45
45
|
"type": "string",
|
46
46
|
"description": "Command name for detailed information",
|
47
47
|
"required": False
|
@@ -157,26 +157,31 @@ class JsonRpcDispatcher(BaseDispatcher):
|
|
157
157
|
def _help_command(self, params: Dict[str, Any] = None) -> Dict[str, Any]:
|
158
158
|
"""
|
159
159
|
Built-in help command for getting command information.
|
160
|
+
|
160
161
|
Args:
|
161
|
-
params: Command parameters
|
162
|
-
|
162
|
+
params: Command parameters
|
163
|
+
command: Command name for detailed information
|
164
|
+
|
163
165
|
Returns:
|
164
166
|
Dict[str, Any]: Command help information
|
165
167
|
"""
|
166
|
-
if params
|
168
|
+
if not params:
|
167
169
|
params = {}
|
170
|
+
|
168
171
|
# If specific command is specified, return information only about it
|
169
|
-
|
170
|
-
|
171
|
-
if
|
172
|
+
if "command" in params and params["command"]:
|
173
|
+
command = params["command"]
|
174
|
+
if command not in self._metadata:
|
172
175
|
return {
|
173
|
-
"error": f"Command '{
|
176
|
+
"error": f"Command '{command}' not found",
|
174
177
|
"available_commands": list(self._metadata.keys())
|
175
178
|
}
|
179
|
+
|
176
180
|
return {
|
177
|
-
"
|
178
|
-
"info": self._metadata[
|
181
|
+
"command": command,
|
182
|
+
"info": self._metadata[command]
|
179
183
|
}
|
184
|
+
|
180
185
|
# Otherwise return brief information about all commands
|
181
186
|
commands_info = {}
|
182
187
|
for cmd, info in self._metadata.items():
|
@@ -185,8 +190,9 @@ class JsonRpcDispatcher(BaseDispatcher):
|
|
185
190
|
"description": info["description"],
|
186
191
|
"params_count": len(info["params"])
|
187
192
|
}
|
193
|
+
|
188
194
|
return {
|
189
195
|
"commands": commands_info,
|
190
196
|
"total": len(commands_info),
|
191
|
-
"note": "Use the '
|
197
|
+
"note": "Use the 'command' parameter to get detailed information about a specific command"
|
192
198
|
}
|
@@ -12,10 +12,10 @@ Run:
|
|
12
12
|
"""
|
13
13
|
import os
|
14
14
|
import sys
|
15
|
-
sys.path.insert(0, os.path.abspath(os.path.
|
15
|
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../..')))
|
16
16
|
from typing import Any, Dict
|
17
17
|
from mcp_proxy_adapter.adapter import MCPProxyAdapter
|
18
|
-
from
|
18
|
+
from mcp_proxy_adapter.testing_utils import MockRegistry
|
19
19
|
|
20
20
|
# --- Setup registry and adapter ---
|
21
21
|
registry = MockRegistry()
|
@@ -12,12 +12,12 @@ Run:
|
|
12
12
|
"""
|
13
13
|
import os
|
14
14
|
import sys
|
15
|
-
sys.path.insert(0, os.path.abspath(os.path.
|
15
|
+
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../..')))
|
16
16
|
from typing import Any, Dict
|
17
17
|
|
18
18
|
# Assume MCPProxyAdapter and MockRegistry are available from src and tests
|
19
19
|
from mcp_proxy_adapter.adapter import MCPProxyAdapter
|
20
|
-
from
|
20
|
+
from mcp_proxy_adapter.testing_utils import MockRegistry
|
21
21
|
|
22
22
|
# --- Setup registry and adapter ---
|
23
23
|
registry = MockRegistry()
|
@@ -1,5 +1,5 @@
|
|
1
1
|
mcp_proxy_adapter/__init__.py,sha256=_6D-TfANWp9zc550M5LUeGPvioFqG1bAl3tZj-gNmJU,463
|
2
|
-
mcp_proxy_adapter/adapter.py,sha256=
|
2
|
+
mcp_proxy_adapter/adapter.py,sha256=76dkVeDuqLsJ5AhuftzLlwy2M6yr_PfNbmNfo9dXVhc,28844
|
3
3
|
mcp_proxy_adapter/models.py,sha256=acqVQBYAojHXeJ1MJyvpMyT6-J6aMxWuZMszn_-RsOU,2338
|
4
4
|
mcp_proxy_adapter/registry.py,sha256=jgC4TKaPbMbAsoxvGp2ToaOE4drD-VfZug7WJbm4IW4,15853
|
5
5
|
mcp_proxy_adapter/schema.py,sha256=HZM0TTQTSi8ha1TEeVevdCyGZOUPoT1soB7Nex0hV50,10947
|
@@ -9,21 +9,21 @@ mcp_proxy_adapter/analyzers/docstring_analyzer.py,sha256=T3FLJEo_uChShfiEKRl8GpV
|
|
9
9
|
mcp_proxy_adapter/analyzers/type_analyzer.py,sha256=6Wac7osKwF03waFSwQ8ZM0Wqn_zAP2D-I4WMEpR0hQM,5230
|
10
10
|
mcp_proxy_adapter/dispatchers/__init__.py,sha256=FWgimgInGphIjCEnvA3-ZExiapUzYAVis2H9C5IWivU,365
|
11
11
|
mcp_proxy_adapter/dispatchers/base_dispatcher.py,sha256=S5_Xri058jAmOWeit1tedB_GMZQ9RLcNcYabA83ZF6k,2288
|
12
|
-
mcp_proxy_adapter/dispatchers/json_rpc_dispatcher.py,sha256=
|
12
|
+
mcp_proxy_adapter/dispatchers/json_rpc_dispatcher.py,sha256=ffu1M32E1AdC7IB44mlbV2L56eJQMsp-7fYi_r4rmHc,6331
|
13
13
|
mcp_proxy_adapter/examples/analyze_config.py,sha256=vog7TNHDw5ZoYhQLbAvZvEoufmQwH54KJzQBJrSq5w4,4283
|
14
14
|
mcp_proxy_adapter/examples/basic_integration.py,sha256=w_oA777YiQt36gzI113KPQ6k45caXbMCqW9hD8sy8zo,4657
|
15
15
|
mcp_proxy_adapter/examples/docstring_and_schema_example.py,sha256=c96L4KF_7yWzffmvd4hyeQuXSdYyYkv7Uvuy0QxgMcQ,1929
|
16
16
|
mcp_proxy_adapter/examples/extension_example.py,sha256=vnatnFdNTapMpPcQ79Ugitk92ZiUfpLTs7Dvsodf1og,2277
|
17
|
-
mcp_proxy_adapter/examples/help_best_practices.py,sha256=
|
18
|
-
mcp_proxy_adapter/examples/help_usage.py,sha256=
|
17
|
+
mcp_proxy_adapter/examples/help_best_practices.py,sha256=Bit9Ywl9vGvM_kuV8DJ6pIDK4mY4mF2Gia9rLc56RpI,2646
|
18
|
+
mcp_proxy_adapter/examples/help_usage.py,sha256=JIUsZofdLFyI7FcwPF-rLxipF1-HaZINzVK1KBh0vxA,2577
|
19
19
|
mcp_proxy_adapter/examples/mcp_proxy_client.py,sha256=z4IzFlGigVTQSb8TpcrQ_a0migsmC58LnNwc8wZmTfw,3811
|
20
20
|
mcp_proxy_adapter/examples/openapi_server.py,sha256=MXCr5qifI03oexgdY05SsnbhWCe2_6ebnYOfAdk_Uug,14027
|
21
21
|
mcp_proxy_adapter/examples/project_structure_example.py,sha256=sswTo6FZb1F5juHa0FYG3cgvrh3wfgGfJu2bBy5tCm4,1460
|
22
22
|
mcp_proxy_adapter/examples/testing_example.py,sha256=AB13c4C1bjs1145O-yriwyreeVXtMOlQLzs2BCGmprk,1719
|
23
23
|
mcp_proxy_adapter/validators/docstring_validator.py,sha256=Onpq2iNJ1qF4ejkJJIlBkLROuSNIVALHVmXIgkCpaFI,2934
|
24
24
|
mcp_proxy_adapter/validators/metadata_validator.py,sha256=uCrn38-VYYn89l6f5CC_GoTAHAweaOW2Z6Esro1rtGw,3155
|
25
|
-
mcp_proxy_adapter-2.1.
|
26
|
-
mcp_proxy_adapter-2.1.
|
27
|
-
mcp_proxy_adapter-2.1.
|
28
|
-
mcp_proxy_adapter-2.1.
|
29
|
-
mcp_proxy_adapter-2.1.
|
25
|
+
mcp_proxy_adapter-2.1.10.dist-info/licenses/LICENSE,sha256=OkApFEwdgMCt_mbvUI-eIwKMSTe38K3XnU2DT5ub-wI,1072
|
26
|
+
mcp_proxy_adapter-2.1.10.dist-info/METADATA,sha256=FwAOoTRde0ChFdXa0IeXX-X2ENXCU1m31eWls2BO54I,12579
|
27
|
+
mcp_proxy_adapter-2.1.10.dist-info/WHEEL,sha256=GHB6lJx2juba1wDgXDNlMTyM13ckjBMKf-OnwgKOCtA,91
|
28
|
+
mcp_proxy_adapter-2.1.10.dist-info/top_level.txt,sha256=JZT7vPLBYrtroX-ij68JBhJYbjDdghcV-DFySRy-Nnw,18
|
29
|
+
mcp_proxy_adapter-2.1.10.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|