{"record":{"id":"217ff7db1d5b40eb","repo":"microsoft/semantic-kernel","slug":"prompts-are-not-loaded-for-this-server-please-set","errorCode":null,"errorMessage":"Prompts are not loaded for this server, please set load_prompts=True in the constructor.","messagePattern":"Prompts are not loaded for this server, please set load_prompts=True in the constructor\\.","errorType":"validation","errorClass":"KernelPluginInvalidConfigurationError","httpStatus":null,"severity":"error","filePath":"python/semantic_kernel/connectors/mcp.py","lineNumber":631,"sourceCode":"        if not self.load_tools_flag:\n            raise KernelPluginInvalidConfigurationError(\n                \"Tools are not loaded for this server, please set load_tools=True in the constructor.\"\n            )\n        try:\n            return _mcp_call_tool_result_to_kernel_contents(await self.session.call_tool(tool_name, arguments=kwargs))\n        except McpError:\n            raise\n        except Exception as ex:\n            raise FunctionExecutionException(f\"Failed to call tool '{tool_name}'.\") from ex\n\n    async def get_prompt(self, prompt_name: str, **kwargs: Any) -> list[ChatMessageContent]:\n        \"\"\"Call a prompt with the given arguments.\"\"\"\n        if not self.session:\n            raise KernelPluginInvalidConfigurationError(\n                \"MCP server not connected, please call connect() before using this method.\"\n            )\n        if not self.load_prompts_flag:\n            raise KernelPluginInvalidConfigurationError(\n                \"Prompts are not loaded for this server, please set load_prompts=True in the constructor.\"\n            )\n        try:\n            prompt_result = await self.session.get_prompt(prompt_name, arguments=kwargs)\n            return [_mcp_prompt_message_to_kernel_content(message) for message in prompt_result.messages]\n        except McpError:\n            raise\n        except Exception as ex:\n            raise FunctionExecutionException(f\"Failed to call prompt '{prompt_name}'.\") from ex\n\n    def added_to_kernel(self, kernel: Kernel) -> None:\n        \"\"\"Add the plugin to the kernel.\"\"\"\n        self.kernel = kernel\n\n\n# region: MCP Plugin Implementations\n\n","sourceCodeStart":613,"sourceCodeEnd":649,"githubUrl":"https://github.com/microsoft/semantic-kernel/blob/c028a0c7dc4f0814cdcbaba9d998f187a41197bf/python/semantic_kernel/connectors/mcp.py#L613-L649","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"# before\nplugin = MCPStdioPlugin(..., load_prompts=False)\nawait plugin.get_prompt(\"greet\")\n\n# after\nplugin = MCPStdioPlugin(..., load_prompts=True)","handlingStrategy":"validation","validationCode":"def can_call_prompts(plugin) -> bool:\n    return getattr(plugin, \"load_prompts_flag\", False)","typeGuard":"def plugin_supports_prompts(plugin) -> bool:\n    return bool(getattr(plugin, \"load_prompts_flag\", False))","tryCatchPattern":"from semantic_kernel.exceptions.kernel_exceptions import KernelPluginInvalidConfigurationError\n\ntry:\n    await plugin.get_prompt(\"greet\")\nexcept KernelPluginInvalidConfigurationError as ex:\n    if \"Prompts are not loaded\" in str(ex):\n        plugin = MCPStdioPlugin(..., load_prompts=True)","preventionTips":["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."],"tags":["mcp","get-prompt","configuration","load-prompts"],"backgroundTag":null,"analyzedSha":"c028a0c7dc4f0814cdcbaba9d998f187a41197bf","analyzedAt":"2026-08-13T13:48:05.040Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}