Purpose
MCP tool calls are synchronous: the agent calls a tool, waits, and gets a result. For long-running tasks, this brings two options that are both undesirable—either the entire call is blocked with no visibility at all, or the agent is made to repeatedly poll a status tool in a loop, causing the conversation to be flooded with duplicate tool calls and wasting context for nothing.
MCP itself has a legitimate mid-flight push path: notifications/progress, bound to the progressToken of an in-progress request. But every MCP server author has to reimplement the same plumbing code—extract the token, hook up a timer, track output, clean up on completion. mcp-telemetry is about extracting this plumbing once, along with a companion server that makes it possible for a task started in one session to be observed from a completely different session.
Main capabilities
The project consists of two packages, each with its own role:
-
mcp-telemetry-sdk: instrumentation on the MCP server side.
new MCPTelemetry(opts?)Create a telemetry client.opts.socketPathThe default path can be overridden (by default it is derived bygetSocketPath()fromprocess.cwd()). It owns a persistent, queued connection shared by all tasks it creates.telemetry.createJob({ id?, task })ReturnsJobHandle, starting tracking of a task.idBy default it is an auto-incrementingjob-N。telemetry.disconnect()Close the underlying connection. Call it on server shutdown if you want a clean shutdown rather than idle.- It also exports
getSocketPath(root?), for advanced scenarios that need to independently compute the same path that the producer and server will derive.
-
mcp-telemetry-server: acts as the collection side, exposing three MCP tools (the materials explicitly mention only
telemetry_subscribeandtelemetry_job_statustwo names; the rest are not yet provided).
The two packages are architecturally independent of each other—the SDK never calls any MCP tool, and the server never imports your tool code. They meet only at the local socket, so a producer with a broken connection will not drag anything down, and an overwhelmed collection side will not block your tool calls.
How to use
- Instrument your MCP server with mcp-telemetry-sdk. If there is no listener on the socket, every call is a fast no-op—your server behaves the same whether or not a collection side is running.
- Register mcp-telemetry-server as an MCP server, alongside the instrumented servers.
- In the agent session, call deploy once, then call
telemetry_subscribeonce; no matter how long the task runs, there is no need to poll, no need for a separate terminal, and no flooding of the context with tool calls.
Note:telemetry_subscribe only shows subsequent events forwarded in real time; it does not replay history. If the task has already ended before you subscribe, use telemetry_job_status.
Use Cases
- Development scenarios where you need to observe the real-time progress of local MCP tool calls.
- Structured progress delivery for long tasks, including real-time steps, logs, costs, and more.
- Observing the same task across sessions (started in one session, watched in another).
Relationship to SEP-1686 (MCP Tasks)
The MCP specification's own answer to this problem has been accepted into the specification (not just proposed): it provides a persistent task handle (taskId) for requests, accompanied by tasks/get polling and a progressToken valid throughout the task's lifecycle, and is backed by real production cases. However, its status is marked as awaiting-sdk-change—the standard is set, but client/server SDKs have not yet implemented it, so it cannot be relied upon today. mcp-telemetry solves the same problem on the current stable protocol and is a transitional solution that can be adopted immediately, to be retired once Tasks lands in the SDK you depend on, rather than a competing standard.
Limitations
- The producer-to-server connection is a persistent, queued socket, not one connection per event. Events are flushed in order after the connection is established; bursts that arrive before the connection has finished being established are queued and delivered in order once it is established.
- Delivery is best-effort and not guaranteed, with the sole exception of
done(). When the collector is unreachable and there is no other trigger, other events are silently dropped—this is deliberate design (telemetry should never block or crash your actual tool calls).done()is the only event that is actively retried within a bounded window, because it is usually the last thing a task sends. - It is not a distributed task queue: the collector does not persist across restarts, does not support cross-machine delivery, and has no retry policy beyond the above. If you need those capabilities, you should use a real message queue; this project deliberately does only the minimum needed to "observe local MCP tool calls in real time."
- License: MIT, author Arnav Ranjan. For full installation steps, monorepo structure, and PR requirements, see CONTRIBUTING.md.