Feedback

Chat Icon

Practical MCP with FastMCP & LangChain

Engineering the Agentic Experience

Primitives, Capabilities & Utilities in MCP
12%

Logging (Server Side)

Logging in MCP is a structured way for a server to tell the host what is happening internally. It is not about AI reasoning but about observability.

Think of it as a standardized event stream. The server emits log messages with a severity level and structured data. The client decides how much noise it wants to hear.

At a basic level, logging solves a simple problem: when something goes wrong, or even when something succeeds, the host should not be blind. Instead of printing random console text, the server sends structured notifications that include:

  • a severity level (e.g., debug, info, warning, error, critical)
  • an optional logger name (e.g., "booking-server", "analytics-engine")
  • JSON data with context (e.g., error codes, file paths, API response details)

The Client can choose to get only warnings and errors, or to get everything, including debug. That filtering is part of the protocol and helps manage noise.

The protocol follows the standard syslog severity levels specified in RFC 5424:

LevelCodeDescription
Debug7Detailed information for debugging
Info6General informational messages
Notice5Normal but significant conditions
Warning4Warning conditions that may need attention
Error3Error conditions that require attention
Critical

Practical MCP with FastMCP & LangChain

Engineering the Agentic Experience

Enroll now to unlock current content and receive all future updates for free. Your purchase supports the author and fuels the creation of more exciting content. Act fast, as the price will rise as the course nears completion!