The Model Context Protocol (MCP) provides a standardized way for servers to send structured log messages to clients. Clients can control logging verbosity by setting minimum log levels, with servers sending notifications containing severity levels, optional logger names, and arbitrary JSON-serializable data.
Implementations are free to expose logging through any interface pattern that suits their needs—the protocol itself does not mandate any specific user interaction model.
Servers that emit log message notifications MUST declare the logging
capability:
The protocol follows the standard syslog severity levels specified in RFC 5424:
Level | Description | Example Use Case |
---|---|---|
debug | Detailed debugging information | Function entry/exit points |
info | General informational messages | Operation progress updates |
notice | Normal but significant events | Configuration changes |
warning | Warning conditions | Deprecated feature usage |
error | Error conditions | Operation failures |
critical | Critical conditions | System component failures |
alert | Action must be taken immediately | Data corruption detected |
emergency | System is unusable | Complete system failure |
To configure the minimum log level, clients MAY send a logging/setLevel
request:
Request:
Servers send log messages using notifications/message
notifications:
Servers SHOULD return standard JSON-RPC errors for common failure cases:
-32602
(Invalid params)-32603
(Internal error)Servers SHOULD:
Clients MAY:
Log messages MUST NOT contain:
Implementations SHOULD:
The Model Context Protocol (MCP) provides a standardized way for servers to send structured log messages to clients. Clients can control logging verbosity by setting minimum log levels, with servers sending notifications containing severity levels, optional logger names, and arbitrary JSON-serializable data.
Implementations are free to expose logging through any interface pattern that suits their needs—the protocol itself does not mandate any specific user interaction model.
Servers that emit log message notifications MUST declare the logging
capability:
The protocol follows the standard syslog severity levels specified in RFC 5424:
Level | Description | Example Use Case |
---|---|---|
debug | Detailed debugging information | Function entry/exit points |
info | General informational messages | Operation progress updates |
notice | Normal but significant events | Configuration changes |
warning | Warning conditions | Deprecated feature usage |
error | Error conditions | Operation failures |
critical | Critical conditions | System component failures |
alert | Action must be taken immediately | Data corruption detected |
emergency | System is unusable | Complete system failure |
To configure the minimum log level, clients MAY send a logging/setLevel
request:
Request:
Servers send log messages using notifications/message
notifications:
Servers SHOULD return standard JSON-RPC errors for common failure cases:
-32602
(Invalid params)-32603
(Internal error)Servers SHOULD:
Clients MAY:
Log messages MUST NOT contain:
Implementations SHOULD: