hanzo-mcp 0.1.32__py3-none-any.whl → 0.1.33__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.
Potentially problematic release.
This version of hanzo-mcp might be problematic. Click here for more details.
- hanzo_mcp/tools/common/version_tool.py +89 -17
- {hanzo_mcp-0.1.32.dist-info → hanzo_mcp-0.1.33.dist-info}/METADATA +3 -3
- {hanzo_mcp-0.1.32.dist-info → hanzo_mcp-0.1.33.dist-info}/RECORD +7 -7
- {hanzo_mcp-0.1.32.dist-info → hanzo_mcp-0.1.33.dist-info}/WHEEL +0 -0
- {hanzo_mcp-0.1.32.dist-info → hanzo_mcp-0.1.33.dist-info}/entry_points.txt +0 -0
- {hanzo_mcp-0.1.32.dist-info → hanzo_mcp-0.1.33.dist-info}/licenses/LICENSE +0 -0
- {hanzo_mcp-0.1.32.dist-info → hanzo_mcp-0.1.33.dist-info}/top_level.txt +0 -0
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
"""Version tool for displaying project version information."""
|
|
2
2
|
|
|
3
3
|
import importlib.metadata
|
|
4
|
-
|
|
4
|
+
import os
|
|
5
|
+
import tomllib
|
|
6
|
+
from typing import Any, Dict, TypedDict, cast, final, override
|
|
5
7
|
|
|
8
|
+
from mcp.server.fastmcp import Context as MCPContext
|
|
6
9
|
from mcp.server.fastmcp import FastMCP
|
|
7
10
|
|
|
11
|
+
from hanzo_mcp.tools.common.base import BaseTool
|
|
12
|
+
from hanzo_mcp.tools.common.context import create_tool_context
|
|
13
|
+
|
|
8
14
|
|
|
9
15
|
class VersionToolResponse(TypedDict):
|
|
10
16
|
"""Response from the version tool."""
|
|
@@ -14,27 +20,80 @@ class VersionToolResponse(TypedDict):
|
|
|
14
20
|
|
|
15
21
|
|
|
16
22
|
@final
|
|
17
|
-
class VersionTool:
|
|
23
|
+
class VersionTool(BaseTool):
|
|
18
24
|
"""Tool for displaying version information about the Hanzo MCP package."""
|
|
19
25
|
|
|
26
|
+
@property
|
|
27
|
+
@override
|
|
28
|
+
def name(self) -> str:
|
|
29
|
+
"""Get the tool name.
|
|
30
|
+
|
|
31
|
+
Returns:
|
|
32
|
+
Tool name
|
|
33
|
+
"""
|
|
34
|
+
return "version"
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
@override
|
|
38
|
+
def description(self) -> str:
|
|
39
|
+
"""Get the tool description.
|
|
40
|
+
|
|
41
|
+
Returns:
|
|
42
|
+
Tool description
|
|
43
|
+
"""
|
|
44
|
+
return "Display the current version of hanzo-mcp"
|
|
45
|
+
|
|
46
|
+
@property
|
|
47
|
+
@override
|
|
48
|
+
def parameters(self) -> dict[str, Any]:
|
|
49
|
+
"""Get the parameter specifications for the tool.
|
|
50
|
+
|
|
51
|
+
Returns:
|
|
52
|
+
Parameter specifications
|
|
53
|
+
"""
|
|
54
|
+
return {
|
|
55
|
+
"properties": {},
|
|
56
|
+
"required": [],
|
|
57
|
+
"title": "versionArguments",
|
|
58
|
+
"type": "object"
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
@override
|
|
63
|
+
def required(self) -> list[str]:
|
|
64
|
+
"""Get the list of required parameter names.
|
|
65
|
+
|
|
66
|
+
Returns:
|
|
67
|
+
List of required parameter names
|
|
68
|
+
"""
|
|
69
|
+
return []
|
|
70
|
+
|
|
20
71
|
def __init__(self, mcp_server: FastMCP) -> None:
|
|
21
|
-
"""Initialize the version tool.
|
|
72
|
+
"""Initialize the version tool and register it with the server.
|
|
22
73
|
|
|
23
74
|
Args:
|
|
24
75
|
mcp_server: The MCP server to register with
|
|
25
76
|
"""
|
|
26
|
-
self.mcp_server
|
|
27
|
-
self._register()
|
|
77
|
+
self.register(mcp_server)
|
|
28
78
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
79
|
+
@override
|
|
80
|
+
async def call(self, ctx: MCPContext, **params: Any) -> str:
|
|
81
|
+
"""Execute the tool with the given parameters.
|
|
82
|
+
|
|
83
|
+
Args:
|
|
84
|
+
ctx: MCP context
|
|
85
|
+
**params: Tool parameters
|
|
86
|
+
|
|
87
|
+
Returns:
|
|
88
|
+
Tool result with version information
|
|
89
|
+
"""
|
|
90
|
+
tool_ctx = create_tool_context(ctx)
|
|
91
|
+
tool_ctx.set_tool_info(self.name)
|
|
92
|
+
|
|
93
|
+
version_info = self.get_version()
|
|
94
|
+
await tool_ctx.info(f"Hanzo MCP version: {version_info['version']}")
|
|
95
|
+
|
|
96
|
+
return f"Hanzo MCP version: {version_info['version']}"
|
|
38
97
|
|
|
39
98
|
def get_version(self) -> VersionToolResponse:
|
|
40
99
|
"""Get the current version of the hanzo-mcp package.
|
|
@@ -46,9 +105,6 @@ class VersionTool:
|
|
|
46
105
|
version = importlib.metadata.version("hanzo-mcp")
|
|
47
106
|
except importlib.metadata.PackageNotFoundError:
|
|
48
107
|
# If package not installed, try to read from pyproject.toml
|
|
49
|
-
import os
|
|
50
|
-
import tomllib
|
|
51
|
-
|
|
52
108
|
try:
|
|
53
109
|
root_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", ".."))
|
|
54
110
|
toml_path = os.path.join(root_dir, "pyproject.toml")
|
|
@@ -60,3 +116,19 @@ class VersionTool:
|
|
|
60
116
|
version = "unknown"
|
|
61
117
|
|
|
62
118
|
return {"version": version, "package_name": "hanzo-mcp"}
|
|
119
|
+
|
|
120
|
+
@override
|
|
121
|
+
def register(self, mcp_server: FastMCP) -> None:
|
|
122
|
+
"""Register this version tool with the MCP server.
|
|
123
|
+
|
|
124
|
+
Creates a wrapper function that calls this tool's call method and
|
|
125
|
+
registers it with the MCP server.
|
|
126
|
+
|
|
127
|
+
Args:
|
|
128
|
+
mcp_server: The FastMCP server instance
|
|
129
|
+
"""
|
|
130
|
+
tool_self = self # Create a reference to self for use in the closure
|
|
131
|
+
|
|
132
|
+
@mcp_server.tool(name=self.name, description=self.mcp_description)
|
|
133
|
+
async def version(ctx: MCPContext) -> str:
|
|
134
|
+
return await tool_self.call(ctx)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hanzo-mcp
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.33
|
|
4
4
|
Summary: MCP implementation of Hanzo capabilities
|
|
5
5
|
Author-email: Hanzo Industries Inc <dev@hanzo.ai>
|
|
6
6
|
License: MIT
|
|
@@ -11,10 +11,10 @@ Keywords: mcp,claude,hanzo,code,agent
|
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Classifier: License :: OSI Approved :: MIT License
|
|
13
13
|
Classifier: Operating System :: OS Independent
|
|
14
|
-
Requires-Python: >=3.
|
|
14
|
+
Requires-Python: >=3.12
|
|
15
15
|
Description-Content-Type: text/markdown
|
|
16
16
|
License-File: LICENSE
|
|
17
|
-
Requires-Dist: mcp>=1.
|
|
17
|
+
Requires-Dist: mcp>=1.6.0
|
|
18
18
|
Requires-Dist: httpx>=0.27.0
|
|
19
19
|
Requires-Dist: uvicorn>=0.23.1
|
|
20
20
|
Requires-Dist: openai>=1.50.0
|
|
@@ -13,7 +13,7 @@ hanzo_mcp/tools/common/permissions.py,sha256=4YCfA2PJUOl-z_47n5uaRXO8gAZ_shMaPhp
|
|
|
13
13
|
hanzo_mcp/tools/common/session.py,sha256=csX5ZhgBjO2bdXXXPpsUPzOCc7Tib-apYe01AP8sh8k,2774
|
|
14
14
|
hanzo_mcp/tools/common/thinking_tool.py,sha256=I-O6ipM-PUofkNoMMzv37Y_2Yfx9mh7F1upTTsfRN4M,4046
|
|
15
15
|
hanzo_mcp/tools/common/validation.py,sha256=gB3uM_cbPZsH4Ez0hnTgIcdP-AUlHZU02aRmZEpk_6I,3648
|
|
16
|
-
hanzo_mcp/tools/common/version_tool.py,sha256=
|
|
16
|
+
hanzo_mcp/tools/common/version_tool.py,sha256=3QiSCRTc0fgf2vZw0XVCL1V3Gl7T5OMFrAUUJSJqMVE,4018
|
|
17
17
|
hanzo_mcp/tools/filesystem/__init__.py,sha256=-wNhb0IjJgz05n_fRP0wDXfKgJ6fgBp4wrGo62Hpyvc,3265
|
|
18
18
|
hanzo_mcp/tools/filesystem/base.py,sha256=HAzuMCrS0dKOBZNoLr7y74tdbYyKpi0FGhStuRgkFTU,3917
|
|
19
19
|
hanzo_mcp/tools/filesystem/content_replace.py,sha256=ZwzxyOTASUmzP-jtEnsSR-MKtNFC4R3kQunpV3KOCyg,11049
|
|
@@ -38,9 +38,9 @@ hanzo_mcp/tools/shell/command_executor.py,sha256=5GcJvg54uty9fl_tkGdWTBcHyjxuynQ
|
|
|
38
38
|
hanzo_mcp/tools/shell/run_command.py,sha256=r7HBw0lqabgkGnVsDXmLnrTo0SU9g8gLvzpa-9n-cmM,6891
|
|
39
39
|
hanzo_mcp/tools/shell/run_script.py,sha256=CLYnDc0Ze8plkXU6d98RgE4UrBg-fwaMVdcn9Fc6Ixw,7432
|
|
40
40
|
hanzo_mcp/tools/shell/script_tool.py,sha256=s63tawIZBvwgm_kU9P7A3D4v2ulVw7j4l_rpsa_zGuc,8680
|
|
41
|
-
hanzo_mcp-0.1.
|
|
42
|
-
hanzo_mcp-0.1.
|
|
43
|
-
hanzo_mcp-0.1.
|
|
44
|
-
hanzo_mcp-0.1.
|
|
45
|
-
hanzo_mcp-0.1.
|
|
46
|
-
hanzo_mcp-0.1.
|
|
41
|
+
hanzo_mcp-0.1.33.dist-info/licenses/LICENSE,sha256=mf1qZGFsPGskoPgytp9B-RsahfKvXsBpmaAbTLGTt8Y,1063
|
|
42
|
+
hanzo_mcp-0.1.33.dist-info/METADATA,sha256=FPFTd1ry4CzrABIY_vy8W87Y4tAgHEKnSPhpmQzNlIE,7277
|
|
43
|
+
hanzo_mcp-0.1.33.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
|
44
|
+
hanzo_mcp-0.1.33.dist-info/entry_points.txt,sha256=aRKOKXtuQr-idSr-yH4efnRl2v8te94AcgN3ysqqSYs,49
|
|
45
|
+
hanzo_mcp-0.1.33.dist-info/top_level.txt,sha256=eGFANatA0MHWiVlpS56fTYRIShtibrSom1uXI6XU0GU,10
|
|
46
|
+
hanzo_mcp-0.1.33.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|