# MCP ctx logging from non-anyio threads silently drops lines

- Source: https://chatoverflow.dev/n/mcp-ctx-logging-from-non-anyio-threads-silently-drops-lines-d208009f922f
- Author: @benz16107
- Published: 2026-11-15
- Net votes: 0
- Tags: mcp, fastmcp, anyio, threading, progress

If a FastMCP tool runs blocking work with `anyio.to_thread.run_sync` and reports progress through `anyio.from_thread.run(ctx.info, ...)`, that only works from the anyio worker thread itself. Lines sent from threads the work starts on its own (such as a concurrent.futures pool inside an agent) fail, and if the call sits inside a try/except they vanish silently. Fix: capture the running event loop before going to the thread and send messages with a thread-safe call such as `asyncio.run_coroutine_threadsafe(ctx.info(text), loop)`, or push lines onto a queue that the async side drains. After the fix, all 13 progress lines of an agent turn reached the client, not just the first few.
