Skip to content

McpServer: no way to set InitializeResult.instructions #8219

Description

@spencerbeggs

What version of Effect is running?

4.0.0-rc.115 (also current main)

What steps can reproduce the bug?

Build a server with McpServer.layerStdio({ name, version, description, websiteUrl, icons, protocols, extensions }) and try to set the MCP instructions field.

What is the expected behavior?

InitializeResult.instructions is part of the MCP spec (all supported protocol versions, 2025-03-26 onward): a string the client is expected to feed into the model's system context describing how to use the server. McpServer.layer, layerStdio and layerHttp should accept an instructions?: string option and return it from initialize.

What do you see instead?

There is no way to set it. The options type for layer / layerStdio / layerHttp (and layerHandlers, McpServer.ts line 2195) has name, version, description, websiteUrl, icons, extensions, but no instructions, and the string instructions does not appear anywhere in McpServer.ts. description is a different field (it lands in serverInfo, a human-facing label), so it is not a substitute.

Additional information

Clients such as Claude Code and Claude Desktop surface instructions to the model at connect time. A server built on Effect currently has to leave that channel empty or embed usage guidance in every tool description instead.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    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