From 6326d7e4ba83babaf494207208439608357a884f Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Tue, 17 Feb 2026 02:19:36 +0800 Subject: [PATCH] fix: add MCP tools to function tool set in _plugin_tool_fix (#5144) --- astrbot/core/astr_main_agent.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/astrbot/core/astr_main_agent.py b/astrbot/core/astr_main_agent.py index 7883dca8f..106d7afe5 100644 --- a/astrbot/core/astr_main_agent.py +++ b/astrbot/core/astr_main_agent.py @@ -45,6 +45,7 @@ from astrbot.core.provider.entities import ProviderRequest from astrbot.core.skills.skill_manager import SkillManager, build_skills_prompt from astrbot.core.star.context import Context from astrbot.core.star.star_handler import star_map +from astrbot.core.provider.manager import llm_tools from astrbot.core.tools.cron_tools import ( CREATE_CRON_JOB_TOOL, DELETE_CRON_JOB_TOOL, @@ -769,6 +770,14 @@ def _plugin_tool_fix(event: AstrMessageEvent, req: ProviderRequest) -> None: if plugin.name in event.plugins_name or plugin.reserved: new_tool_set.add_tool(tool) req.func_tool = new_tool_set + else: + # mcp tools + tool_set = req.func_tool + if not tool_set: + tool_set = ToolSet() + for tool in llm_tools.func_list: + if isinstance(tool, MCPTool): + tool_set.add_tool(tool) async def _handle_webchat(