Skip to content

[Bug]: when using --mcp-stdio failure with "logging/setlevel" #3274

@JerryNixon

Description

@JerryNixon

What?

We get the error Method not found: logging/setLevel when our MCP Server (STDIO) starts.

Incoming request to our MCP

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "logging/setLevel",
  "params": {
    "level": "info"
  }
}

The problem

DAB already advertises the logging capability in its initialize response (see line 189), but the server's request dispatch loop has no handler for "logging/setLevel", so the client gets a JSON-RPC Method not found (-32601) error back.

tools = new { listChanged = true },
logging = new { }
},
serverInfo = new
{
name = McpProtocolDefaults.MCP_SERVER_NAME,
version = McpProtocolDefaults.MCP_SERVER_VERSION
},
instructions = !string.IsNullOrWhiteSpace(instructions) ? instructions : null
};
WriteResult(id, result);

The solution

  1. CLI --LogLevel — takes highest precedence (IsCliOverriddenflag inDynamicLogLevelProvider`)
  2. Config runtime.host.logging.level — second precedence
  3. MCP logging/setLevel — lowest precedence, should only apply if CLI didn't override

Then, add a case in the switch and route it through the existing DynamicLogLevelProvider.

Note

If IsCliOverridden is true, accept the request but silently ignore it — the client shouldn't get an error, but CLI wins.

Why?

This is the mcp.json file in the /.vscode folder.

{
	"servers": {
		"dab-todo-test-mcp": {
			"type": "stdio",
			"command": "dab",
			"args": [
				"start",
				"--mcp-stdio",
				"role:anonymous",
				"--LogLevel",
				"none",
				"--config",
				"${workspaceFolder}/dab-config.json"
			]
		}
	},
	"inputs": []
}

When starting the MCP Server, the client passes in:

But we do not support it, so we get:

Method not found: logging/setLevel
Image

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions