Skip to main content
Configurable logging setup for MCP servers.

InspectorLogFilter

method init

Parameters
str
default:"/inspector"
File path
Signature

MCPLogsOnlyFilter

method init

Initialize a filter.Initialize with the name of the logger which, together with its children, will have its events allowed through the filter. If no name is specified, allow every event.Parameters
default:""
Name identifier
Signature

setup_logging

function setup_logging

Set up logging configuration for MCP server.
Parameters
int
default:"0"
Debug level (0: production, 1: debug+routes, 2: debug+routes+jsonrpc)
str
default:"INFO"
Logging level (DEBUG, INFO, WARNING, ERROR)
bool
default:"False"
Whether to show inspector-related access logs (default: False)
str
default:"/inspector"
Effective inspector route prefix, typically /inspector
bool
default:"False"
When True, suppress all uvicorn access logs (MCP logs are printed
Returns
dict
Uvicorn logging configuration dict
Signature