Skip to content
AdminKit

MCP logging

What is MCP logging?

MCP logging is a Model Context Protocol capability letting a server send structured, leveled log messages to the client that connects it to an AI agent, for debugging and visibility rather than for the agent's own reasoning. The AdminKit MCP & Agent Gateway, which Netbase deploys and runs for customers, keeps its own operator-facing audit log alongside this client-facing one.

By AdminKit team, Netbase JSC · Updated

The Model Context Protocol defines a logging capability that lets a server declare support for sending structured log messages to the client, using the same severity levels RFC 5424 (see its IETF Datatracker entry for the document’s current status) defines for syslog, from debug up through emergency. A client can send a logging/setLevel request to set the minimum severity it wants to receive, and the server then pushes notifications/message events carrying a level, an optional logger name and arbitrary JSON data — useful for debugging a tool call or surfacing a server-side warning without the agent itself ever seeing or acting on that data. The specification’s security guidance warns that log messages must never carry credentials, secrets or personal data, since a client may display, store or forward them well beyond the original request’s trust boundary. That matches general logging practice: the OWASP Logging Cheat Sheet lists session identifiers, access tokens, authentication passwords, encryption keys and sensitive personal data among the things that should usually be removed, masked, sanitized, hashed or encrypted rather than recorded directly in logs.

Like other optional MCP utilities, such as progress notifications, logging support must be explicitly declared as a capability before a client can assume a server implements it.

AdminKit groups mCP logging under its AI agents & MCP cluster — browse the AdminKit glossary index for other related terms.

Frequently asked questions

Can an AI agent see or act on MCP log messages?

No -- MCP logging sends structured log messages to the client for debugging and visibility, not to the agent's own reasoning; the agent never sees or acts on that data directly.

What severity levels does MCP logging use?

The same levels RFC 5424 defines for syslog, from debug up through emergency, since the MCP logging capability reuses that existing scale rather than inventing its own.

Can a client control how much MCP log detail it receives?

Yes -- a client can send a logging/setLevel request to set the minimum severity it wants, and the server then pushes notifications/message events at or above that level.

Is it safe for an MCP server to log credentials or secrets?

No -- the specification's security guidance warns log messages must never carry credentials, secrets or personal data, since a client may display, store or forward them well beyond the original request's trust boundary.