Skip to main content
Configurable logging setup for MCP servers.

InspectorLogFilter

from mcp_use.server.logging.config import InspectorLogFilter

method init

Parameters
inspector_path
str
default:"/inspector"
File path
Signature
def __init__(inspector_path: str = "/inspector"):

MCPLogsOnlyFilter

from mcp_use.server.logging.config import 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
name
default:""
Name identifier
Signature
def __init__(name = ""):

setup_logging

function setup_logging

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