Skip to content

[Bug]: Server instruction not set properly in the engine. #3283

@JerryNixon

Description

@JerryNixon

What?

The runtime.mcp.description config value is read into McpRuntimeOptions.Description and emitted as instructions in the stdio server's HandleInitialize, but the HTTP/SSE transport configured in McpServerConfiguration.cs never sets McpServerOptions.Instructions. MCP clients connecting over HTTP/SSE never receive instructions in the initialize response.

Suggestion

services.PostConfigure<McpServerOptions>(options =>
{
    options.ServerInfo = new() { Name = McpProtocolDefaults.MCP_SERVER_NAME, Version = McpProtocolDefaults.MCP_SERVER_VERSION };
    options.Capabilities ??= new();
    options.Capabilities.Tools ??= new();
    
    // Read the description from runtime config and set it as instructions
    // (This needs access to RuntimeConfigProvider, so the implementation 
    //  would need to use services.AddOptions<McpServerOptions>() with a 
    //  configure callback that resolves from the service provider)
    options.Instructions = runtimeConfig.Runtime?.Mcp?.Description;
});

Also

Additionally, the description property is missing from the mcp object in schemas/dab.draft.schema.json, so configs using it fail schema validation since that object has "additionalProperties": false. #3282

Metadata

Metadata

Assignees

Type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions