mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-17 17:02:01 -05:00
[GH-ISSUE #21827] feat: support for MCP server's instructions field
#90326
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Simon-Stone on GitHub (Feb 24, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/21827
Check Existing Issues
Verify Feature Scope
Problem Description
The MCP standard specifies a field called
instructionsthat can be used to offer a description of the exposed toolset and high-level instructions on when and how to use tools. This is intended to be injected into the system message.The implementation of Open WebUI's MCP client discards the return value of
session.initialize(), which includes theinstructionsfield.Without surfacing the
instructionsfield, the LLM has no server-provided guidance on how to use the exposed tools effectively. Tool descriptions alone often aren't sufficient because servers may need to communicate higher-level context like preferred tool ordering, common workflows, constraints, or when not to use certain tools. By discarding theinitialize()result, Open WebUI loses this context, which can lead to the model misusing tools, calling them in suboptimal sequences, or missing intended usage patterns that the server author designed for.Injecting
instructionsinto the system prompt (as the spec intends) would let MCP server authors improve tool-use reliability without users needing to manually write prompt engineering workarounds.Desired Solution you'd like
Capture the
InitializeResultreturned bysession.initialize()and, when theinstructionsfield is present, inject its contents into the system prompt for conversations that have access to that server's tools. This aligns with the MCP specification's intended use of the field.Ideally this would also be surfaced somewhere in the admin UI (e.g. on the Tool Server configuration page) so that administrators can review what instructions a server is providing before they get injected into prompts.
Alternatives Considered
No response
Additional Context
No response