microsoft/semantic-kernel · error · KernelPluginInvalidConfigurationError
Prompts are not loaded for this server, please set load_prom
Error message
Prompts are not loaded for this server, please set load_prompts=True in the constructor.
What it means
Thrown by MCPPluginBase.get_prompt (mcp.py:631) as a KernelPluginInvalidConfigurationError when load_prompts_flag is False. The plugin only discovers and registers MCP prompts during connect() if load_prompts=True; with it disabled, get_prompt refuses because no prompts were loaded.
Source
Thrown at python/semantic_kernel/connectors/mcp.py:631
if not self.load_tools_flag:
raise KernelPluginInvalidConfigurationError(
"Tools are not loaded for this server, please set load_tools=True in the constructor."
)
try:
return _mcp_call_tool_result_to_kernel_contents(await self.session.call_tool(tool_name, arguments=kwargs))
except McpError:
raise
except Exception as ex:
raise FunctionExecutionException(f"Failed to call tool '{tool_name}'.") from ex
async def get_prompt(self, prompt_name: str, **kwargs: Any) -> list[ChatMessageContent]:
"""Call a prompt with the given arguments."""
if not self.session:
raise KernelPluginInvalidConfigurationError(
"MCP server not connected, please call connect() before using this method."
)
if not self.load_prompts_flag:
raise KernelPluginInvalidConfigurationError(
"Prompts are not loaded for this server, please set load_prompts=True in the constructor."
)
try:
prompt_result = await self.session.get_prompt(prompt_name, arguments=kwargs)
return [_mcp_prompt_message_to_kernel_content(message) for message in prompt_result.messages]
except McpError:
raise
except Exception as ex:
raise FunctionExecutionException(f"Failed to call prompt '{prompt_name}'.") from ex
def added_to_kernel(self, kernel: Kernel) -> None:
"""Add the plugin to the kernel."""
self.kernel = kernel
# region: MCP Plugin Implementations
View on GitHub (pinned to c028a0c7dc)
Solutions
- Construct with load_prompts=True if you intend to call prompts: MCPStdioPlugin(..., load_prompts=True).
- If prompts were intentionally disabled, do not call get_prompt; use call_tool instead.
- Re-create the plugin with the correct flags rather than toggling load_prompts_flag after init.
- Remember the constructor default is load_prompts=True; this only fires when you explicitly disabled it.
Example fix
# before
plugin = MCPStdioPlugin(..., load_prompts=False)
await plugin.get_prompt("greet")
# after
plugin = MCPStdioPlugin(..., load_prompts=True) Defensive patterns
Strategy: validation
Validate before calling
def can_call_prompts(plugin) -> bool:
return getattr(plugin, "load_prompts_flag", False) Type guard
def plugin_supports_prompts(plugin) -> bool:
return bool(getattr(plugin, "load_prompts_flag", False)) Try / catch
from semantic_kernel.exceptions.kernel_exceptions import KernelPluginInvalidConfigurationError
try:
await plugin.get_prompt("greet")
except KernelPluginInvalidConfigurationError as ex:
if "Prompts are not loaded" in str(ex):
plugin = MCPStdioPlugin(..., load_prompts=True) Prevention
- Construct with load_prompts=True whenever you intend to call prompts.
- Remember the default is True; this only fires when you disabled prompts.
- Do not call get_prompt on a tools-only plugin.
- Re-create the plugin with correct flags rather than toggling load_prompts_flag.
When it happens
Trigger: Constructing the plugin with load_prompts=False (e.g. tools-only) and then calling get_prompt. Guard at mcp.py:630-633, after the session check.
Common situations: Setting load_prompts=False for a tools-only integration, then later needing a prompt; copy-pasting config; misunderstanding that load_prompts gates get_prompt, not just auto-loading.
Related errors
- Failed to connect to the MCP server. Please check your confi
- Failed to create a session. Please check your configuration.
- Failed to initialize session. Please check your configuratio
- MCP server not connected, please call connect() before using
- Tools are not loaded for this server, please set load_tools=
AI-assisted analysis of microsoft/semantic-kernel@c028a0c7dc (2026-08-13).
Data as JSON: /api/errors/217ff7db1d5b40eb.
Report an issue: GitHub.