Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.11
3.12
22 changes: 11 additions & 11 deletions pkg/cli/internal/frameworks/python/templates/pyproject.toml.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ description = "{{.ProjectName}} MCP server built with FastMCP"
{name = "Unknown Author"}
]{{end}}{{end}}
readme = "README.md"
requires-python = ">=3.10"
requires-python = ">=3.12"
dependencies = [
"fastmcp>=0.2.0",
"pydantic>=2.0.0",
"pyyaml>=6.0",
"python-dotenv>=1.0.0",
"fastmcp==3.0.0",
"pydantic==2.12.5",
"pyyaml==6.0.3",
"python-dotenv==1.2.1",
]

[build-system]
Expand All @@ -35,12 +35,12 @@ start = "src.main:start"

[tool.uv]
dev-dependencies = [
"pytest>=7.0.0",
"pytest-asyncio>=0.21.0",
"black>=22.0.0",
"mypy>=1.0.0",
"ruff>=0.1.0",
"types-PyYAML>=6.0.0",
"pytest==9.0.2",
"pytest-asyncio==1.3.0",
"black==26.1.0",
"mypy==1.19.1",
"ruff==0.15.1",
"types-PyYAML==6.0.12.20250915",
]

[tool.black]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This server automatically discovers and loads tools from the tools directory.
Each tool file should contain a function decorated with @mcp.tool().
"""

import asyncio
import importlib.util
import logging
import sys
Expand Down Expand Up @@ -75,14 +76,14 @@ class DynamicMCPServer:
for tool_file in tool_files:
try:
# Get the number of tools before importing
tools_before = len(self.mcp._tool_manager._tools)
tools_before = len(asyncio.run(self.mcp.list_tools()))

# Simply import the module - tools auto-register via @mcp.tool()
# decorator
tool_name = tool_file.stem
if self._import_tool_module(tool_file, tool_name):
# Check if any tools were actually registered
tools_after = len(self.mcp._tool_manager._tools)
tools_after = len(asyncio.run(self.mcp.list_tools()))
if tools_after > tools_before:
self.loaded_tools.append(tool_name)
loaded_count += 1
Expand Down Expand Up @@ -143,7 +144,8 @@ class DynamicMCPServer:
"""Get tools synchronously for testing purposes."""
# This is a simplified version for testing - in real usage, use get_tools()
# async
return self.mcp._tool_manager._tools
tools_list = asyncio.run(self.mcp.list_tools())
return {t.name: t for t in tools_list}

def run(self, transport_mode: str = "stdio", host: str = "localhost", port: int = 3000) -> None:
"""Run the FastMCP server.
Expand Down
Loading