Skip to content

vMCP drops the instructions of backend servers #7020

Open
Viphava280444/toolhive
#1

Description

@Viphava280444

Hello All,

first of all, thank you very much for ToolHive and all the great work of all contributors. We run vMCP v0.58.0 in front of several MCP servers, and we noticed that the instructions text a backend sends in its initialize reply never reaches the client. The initialize reply of vMCP has no instructions key at all. Tool descriptions pass through correctly; only instructions is lost.

Here is a small test to reproduce it:

from mcp.server.fastmcp import FastMCP

mcp = FastMCP("demo", instructions="Start with hello. Never call it twice.",
              host="127.0.0.1", port=18765, stateless_http=True)

@mcp.tool()
def hello(name: str) -> str:
    """Say hello to one person."""
    return f"hello {name}"

mcp.run(transport="streamable-http")

A direct initialize request to http://127.0.0.1:18765/mcp returns "instructions": "Start with hello. Never call it twice.".

With vMCP in front of it (thv vmcp serve --config demo-vmcp.yaml --port 4483, one backend, anonymous incoming auth, unauthenticated outgoing auth), the same initialize request to http://127.0.0.1:4483/mcp returns:

{"jsonrpc":"2.0","id":1,"result":{"capabilities":{"completions":{},"logging":{},"prompts":{"listChanged":true},"resources":{"listChanged":true,"subscribe":true},"tools":{"listChanged":true}},"protocolVersion":"2025-06-18","serverInfo":{"name":"demo-vmcp","version":"dev"}}}

If I read the code correctly, initializeClient keeps only Capabilities and ProtocolVersion and never reads result.Instructions (

func initializeClient(ctx context.Context, c *client.Client) (*mcp.ServerCapabilities, string, error) {
result, err := c.Initialize(ctx, mcp.InitializeRequest{
Params: mcp.InitializeParams{
ProtocolVersion: mcp.LATEST_PROTOCOL_VERSION,
ClientInfo: mcp.Implementation{
Name: "toolhive-vmcp",
Version: versions.Version,
},
Capabilities: mcp.ClientCapabilities{
// Virtual MCP acts as a client to backends
Roots: &struct {
ListChanged bool `json:"listChanged,omitempty"`
}{
ListChanged: false,
},
},
},
})
if err != nil {
return nil, "", err
}
return &result.Capabilities, result.ProtocolVersion, nil
), and the server is created without an instructions option (
mcpServer := server.NewMCPServer(
serveCfg.Name,
serveCfg.Version,
server.WithToolCapabilities(true),
server.WithResourceCapabilities(true, true),
server.WithPromptCapabilities(true),
server.WithLogging(),
server.WithHooks(hooks),
server.WithCompletionHandler(completionHandler),
server.WithSubscribeHandlers(subscribeHandler, unsubscribeHandler),
)
). grep -ri instructions pkg/vmcp gives 0 hits, also on main. Please correct me if I missed a configuration option.

Would you consider forwarding them? For example one block per backend, labelled with the backend name, behind an opt-in configuration option, only for the backends the caller is allowed to use, and with a size cap.

I found #5774, but it is about the remote proxy, so I opened a separate issue. I hope that is fine.

I would be happy to work on a PR if you agree with the idea.

Thank you for your time.

Activity

  1. added
    needs-triage
    on Nov 2, 2026
  2. removed
    needs-triage
    on Nov 3, 2026
  3. jhrozek commented on Nov 3, 2026

    @jhrozek
    Contributor

    Hey @Viphava280444 thanks for the issue, I assigned it to you and I'll be happy to review a PR.

  4. Viphava280444 commented on Nov 3, 2026

    @Viphava280444
    Author

    Hello @jhrozek, thank you very much for the quick reply and for assigning the issue to me.

    I have opened the two PRs:

    They are meant to be read together. If you would prefer a different split or any change, please tell me, I am happy to adjust.

    Thank you for your time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions