Intermediate LevelAI, LLMs, Embeddings & MCP
How do MCP Servers send real-time progress logs to host clients via notifications/message?
❓ Interview Prompt: Explain MCP notifications/message JSON-RPC events, log severity levels, and UI progress streaming.
During long-running tool executions (e.g. database migrations or heavy document processing), an MCP Server can stream real-time progress notifications back to the host client without completing the tool call.
Protocol Details:
•
Uses the `notifications/message` JSON-RPC notification method.
•
Supported severity levels:
debug, info, warning, error.•
Host clients display these logs in live UI status bars or progress logs.
Code Implementation Example
typescript
// Sending log notification from MCP Server tool handler
server.sendLoggingMessage({
level: 'info',
logger: 'db-migrator',
data: 'Migrated 500 of 2000 records (25% complete)...'
});💡Streaming real-time progress notifications from MCP Server.
🎯 Interview Key Takeaway
MCP servers stream live execution updates to clients using notifications/message JSON-RPC notifications.
#MCP#Logging#Notifications#JSON-RPC#Intermediate
Back to all AI, LLMs, Embeddings & MCP Questions→