-
Notifications
You must be signed in to change notification settings - Fork 319
Description
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.
data-api-builder/src/Azure.DataApiBuilder.Mcp/Core/McpStdioServer.cs
Lines 188 to 199 in 9563a20
| 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
- CLI
--LogLevel— takes highest precedence (IsCliOverriddenflag inDynamicLogLevelProvider`) - Config
runtime.host.logging.level— second precedence - 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
