Skip to content

Commit 7179d31

Browse files
author
LittleCoinCoin
committed
fix: use the FastMCP instance and not HatchMCP
For now, to avoid compatibility issues when deploying MCP hosts from Hatch packages, we reference the `mcp_server.py` script and not the `hatch_mcp_server_entry.py`
1 parent aae1e85 commit 7179d31

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

hatch/cli_hatch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ def get_package_mcp_server_config(env_manager: HatchEnvironmentManager, env_name
8989
package_service = PackageService(metadata)
9090

9191
# Get the HatchMCP entry point (this handles both v1.2.0 and v1.2.1 schemas)
92-
hatch_mcp_entry_point = package_service.get_hatch_mcp_entry_point()
93-
if not hatch_mcp_entry_point:
92+
mcp_entry_point = package_service.get_mcp_entry_point()
93+
if not mcp_entry_point:
9494
raise ValueError(f"Package '{package_name}' does not have a HatchMCP entry point")
9595

9696
# Get environment-specific Python executable
@@ -100,7 +100,7 @@ def get_package_mcp_server_config(env_manager: HatchEnvironmentManager, env_name
100100
python_executable = "python"
101101

102102
# Create server configuration
103-
server_path = str(package_path / hatch_mcp_entry_point)
103+
server_path = str(package_path / mcp_entry_point)
104104
server_config = MCPServerConfig(
105105
name=package_name,
106106
command=python_executable,

tests/test_mcp_cli_package_management.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,15 +267,15 @@ def test_get_package_mcp_server_config_success(self):
267267
with patch('builtins.open', mock_open(read_data='{"package_schema_version": "1.2.1", "name": "test-package"}')):
268268
with patch('hatch_validator.package.package_service.PackageService') as mock_service_class:
269269
mock_service = MagicMock()
270-
mock_service.get_hatch_mcp_entry_point.return_value = "hatch_mcp_server.py"
270+
mock_service.get_mcp_entry_point.return_value = "mcp_server.py"
271271
mock_service_class.return_value = mock_service
272272

273273
config = get_package_mcp_server_config(mock_env_manager, "test-env", "test-package")
274274

275275
self.assertIsInstance(config, MCPServerConfig)
276276
self.assertEqual(config.name, "test-package")
277277
self.assertEqual(config.command, "/path/to/python") # Now uses environment-specific Python
278-
self.assertTrue(config.args[0].endswith("hatch_mcp_server.py"))
278+
self.assertTrue(config.args[0].endswith("mcp_server.py"))
279279

280280
@regression_test
281281
def test_get_package_mcp_server_config_package_not_found(self):

0 commit comments

Comments
 (0)