feat: 新增飞书和文件工具MCP服务并优化机器人配置
- 新增飞书MCP服务,包含图片上传和消息卡片发送功能 - 新增文件工具MCP服务,提供文件转JSON和data URI功能 - 更新机器人MCP服务配置,移除环境变量硬编码 - 升级机器人版本至0.1.28并优化迎宾功能参数 - 添加.gitignore和项目配置文件
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -1,17 +1,13 @@
|
||||
{
|
||||
"mcpServers": {
|
||||
"terminal-temi-mcp": {
|
||||
"terminal_temi_mcp": {
|
||||
"disabled": false,
|
||||
"type": "stdio",
|
||||
"timeout": 30,
|
||||
"command": "uvx",
|
||||
"args": [
|
||||
"terminal_temi_mcp"
|
||||
],
|
||||
"env": {
|
||||
"employeeId": "$employeeId$",
|
||||
"userId": "$employeeId$"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "terminal_temi_mcp"
|
||||
version = "0.1.21"
|
||||
version = "0.1.28"
|
||||
description = "MQTT-based navigation server for robot"
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
|
||||
@@ -50,7 +50,7 @@ class NavServer:
|
||||
params = {
|
||||
"data": {"location": location, "flag": flag}
|
||||
}
|
||||
return await self.publish_Cmd("123456", user_id, "nav", params)
|
||||
return await self.publish_Cmd("111111", user_id, "nav", params)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to call navigation mcp-tool: {str(e)} ", exc_info=True)
|
||||
return f"Failed to call navigation mcp-tool: {str(e)}"
|
||||
@@ -64,12 +64,12 @@ class NavServer:
|
||||
params = {
|
||||
"data": {"speech": speech}
|
||||
}
|
||||
return await self.publish_Cmd("123456", user_id, "speak", params)
|
||||
return await self.publish_Cmd("111111", user_id, "speak", params)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to call speak mcp-tool: {str(e)} ", exc_info=True)
|
||||
return f"Failed to call speak mcp-tool: {str(e)}"
|
||||
|
||||
async def reception(self, user_id: str, location: str):
|
||||
async def reception(self, user_id: str, location: str, name: str = "贵宾", waitingTime: int = 20*60*1000):
|
||||
"""轮足机器人移动到指定位置迎宾"""
|
||||
try:
|
||||
if not location:
|
||||
@@ -77,10 +77,12 @@ class NavServer:
|
||||
else:
|
||||
params = {
|
||||
"data": {
|
||||
"location": location
|
||||
"location": location,
|
||||
"name": name,
|
||||
"waitingTime": waitingTime
|
||||
}
|
||||
}
|
||||
return await self.publish_Cmd("123456", user_id, "reception", params)
|
||||
return await self.publish_Cmd("111111", user_id, "reception", params)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to call reception mcp-tool: {str(e)} ", exc_info=True)
|
||||
return f"Failed to call reception mcp-tool: {str(e)}"
|
||||
@@ -97,7 +99,7 @@ class NavServer:
|
||||
"text": text
|
||||
}
|
||||
}
|
||||
return await self.publish_Cmd("123456", user_id, "notification", params)
|
||||
return await self.publish_Cmd("111111", user_id, "notification", params)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to call notification mcp-tool: {str(e)} ", exc_info=True)
|
||||
return f"Failed to call notification mcp-tool: {str(e)}"
|
||||
@@ -110,7 +112,7 @@ class NavServer:
|
||||
"action": "repose"
|
||||
}
|
||||
}
|
||||
return await self.publish_Cmd("123456", user_id, "map", params)
|
||||
return await self.publish_Cmd("111111", user_id, "map", params)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to call repose mcp-tool: {str(e)} ", exc_info=True)
|
||||
return f"Failed to call repose mcp-tool: {str(e)}"
|
||||
@@ -127,7 +129,7 @@ class NavServer:
|
||||
"next_location": next_location
|
||||
}
|
||||
}
|
||||
return await self.publish_Cmd("123456", user_id, "delivery", params)
|
||||
return await self.publish_Cmd("111111", user_id, "delivery", params)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to call delivery mcp-tool: {str(e)} ", exc_info=True)
|
||||
return f"Failed to call delivery mcp-tool: {str(e)}"
|
||||
@@ -141,7 +143,7 @@ class NavServer:
|
||||
params = {
|
||||
"data": {"locations": locations}
|
||||
}
|
||||
return await self.publish_Cmd("123456", user_id, "patrol", params)
|
||||
return await self.publish_Cmd("111111", user_id, "patrol", params)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to call patrol mcp-tool: {str(e)} ", exc_info=True)
|
||||
return f"Failed to call patrol mcp-tool: {str(e)}"
|
||||
@@ -155,7 +157,7 @@ class NavServer:
|
||||
params = {
|
||||
"data": {}
|
||||
}
|
||||
return await self.publish_Cmd("123456", user_id, "face", params)
|
||||
return await self.publish_Cmd("111111", user_id, "face", params)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to call face recognize mcp-tool: {str(e)} ", exc_info=True)
|
||||
return f"Failed to call face recognize mcp-tool: {str(e)}"
|
||||
@@ -169,7 +171,7 @@ class NavServer:
|
||||
params = {
|
||||
"data": {}
|
||||
}
|
||||
return await self.publish_Cmd("123456", user_id, "qrcode", params)
|
||||
return await self.publish_Cmd("111111", user_id, "qrcode", params)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to call QR code scan mcp-tool: {str(e)} ", exc_info=True)
|
||||
return f"Failed to call QR code scan mcp-tool: {str(e)}"
|
||||
@@ -183,7 +185,7 @@ class NavServer:
|
||||
params = {
|
||||
"data": {"location_name": location_name}
|
||||
}
|
||||
return await self.publish_Cmd("123456", user_id, "saveLocation", params)
|
||||
return await self.publish_Cmd("111111", user_id, "saveLocation", params)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to call save_position mcp-tool: {str(e)} ", exc_info=True)
|
||||
return f"Failed to call save_position mcp-tool: {str(e)}"
|
||||
@@ -196,7 +198,7 @@ class NavServer:
|
||||
params = {
|
||||
"data": [data.model_dump() for data in datas]
|
||||
}
|
||||
return await self.publish_Cmd("123456", user_id, "guide", params)
|
||||
return await self.publish_Cmd("111111", user_id, "guide", params)
|
||||
except Exception as e:
|
||||
logger.error(f"Failed to call guide mcp-tool: {str(e)} ", exc_info=True)
|
||||
return f"Failed to call guide mcp-tool: {str(e)}"
|
||||
@@ -263,12 +265,22 @@ async def serve() -> None:
|
||||
"description": "引导接待客人到这个位置",
|
||||
"minLength": 1
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"description": "客人姓名",
|
||||
"minLength": 1
|
||||
},
|
||||
"waitingTime": {
|
||||
"type": "integer",
|
||||
"description": "等待时间(单位:毫秒)",
|
||||
"default": 20*60*1000
|
||||
},
|
||||
"user_id": {
|
||||
"type": "string",
|
||||
"description": "用户ID"
|
||||
}
|
||||
},
|
||||
"required": ["location", "user_id"]
|
||||
"required": ["location", "name", "user_id"]
|
||||
}
|
||||
),
|
||||
# Tool(
|
||||
@@ -437,7 +449,9 @@ async def serve() -> None:
|
||||
raise ValueError("缺少必要参数: location or user_id")
|
||||
result = await nav_server.reception(
|
||||
user_id=arguments["user_id"],
|
||||
location=arguments["location"]
|
||||
location=arguments["location"],
|
||||
name=arguments.get("name", ""),
|
||||
waitingTime=arguments.get("waitingTime", 20*60*1000)
|
||||
)
|
||||
# elif name == "notification":
|
||||
# if "location" not in arguments or "text" not in arguments or "user_id" not in arguments:
|
||||
|
||||
Reference in New Issue
Block a user