sylearn求教:在windows上无法启动MCP服务器的某些工具 中发帖

工具函数如下: 
@mcp.tool()
async def execute_command(command: str, timeout: int = 10) -> str:
"""执行系统命令并返回输出结果

这个函数会继承当前环境变量来执行系统命令。它使用subprocess.run来运行命令,
并捕获命令的标准输出和标准错误。如果命令执行失败或超时,会返回错误信息。

Args:
command: 要执行的系统命令字符串
timeout: 命令执行超时时间(秒),默认60秒

Returns:
str: 命令执行的输出结果(包含stdout和stderr)
"""
try:
# 使用shell=True允许执行shell命令,env=None表示继承当前环境变量
...