Primitives, Capabilities & Utilities in MCP
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:
| Level | Code | Description |
|---|---|---|
| Debug | 7 | Detailed information for debugging |
| Info | 6 | General informational messages |
| Notice | 5 | Normal but significant conditions |
| Warning | 4 | Warning conditions that may need attention |
| Error | 3 | Error conditions that require attention |
| Critical |
Practical MCP with FastMCP & LangChain
Engineering the Agentic ExperienceEnroll 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!
