[GH-ISSUE #21827] feat: support for MCP server's instructions field #74190

Closed
opened 2026-05-13 06:52:36 -05:00 by GiteaMirror · 0 comments
Owner

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

  • I have searched for all existing open AND closed issues and discussions for similar requests. I have found none that is comparable to my request.

Verify Feature Scope

  • I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions.

Problem Description

The MCP standard specifies a field called instructions that 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 the instructions field.

Without surfacing the instructions field, 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 the initialize() 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 instructions into 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 InitializeResult returned by session.initialize() and, when the instructions field 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

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 - [x] I have searched for all existing **open AND closed** issues and discussions for similar requests. I have found none that is comparable to my request. ### Verify Feature Scope - [x] I have read through and understood the scope definition for feature requests in the Issues section. I believe my feature request meets the definition and belongs in the Issues section instead of the Discussions. ### Problem Description The MCP standard [specifies a field called `instructions`](https://modelcontextprotocol.io/specification/draft/schema#initializeresult-instructions) that 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()`](https://github.com/open-webui/open-webui/blob/2461121637b3547019e8b9e519009811e4550a5c/backend/open_webui/utils/mcp/client.py#L63), which [includes the `instructions` field](https://modelcontextprotocol.github.io/python-sdk/api/?h=initialize#mcp.InitializeResult). Without surfacing the `instructions` field, 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 the `initialize()` 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 `instructions` into 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 `InitializeResult` returned by `session.initialize()` and, when the `instructions` field 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_
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#74190