arnavranjan005/mcp-telemetry

πŸ“Š Monitoring
0 Views
0 Installs

πŸ“‡ 🏠 🍎 πŸͺŸ 🐧 - Socket.IO-style telemetry for MCP servers. Instrument a tool call with a few lines of mcp-telemetry-sdk, and telemetrysubscribe streams its live progress (steps, logs, cost, done) to any connected MCP client via notifications/progress β€” no polling, and a job started in one session can be watched from a completely different one.

Quick Install

One-Click IDE Configuration
claude_desktop_config.json
{
  "mcpServers": {
    "arnavranjan005-mcp-telemetry": {
      "command": "npx",
      "args": [
        "-y",
        "arnavranjan005-mcp-telemetry"
      ]
    }
  }
}
Or

Using an AI coding agent (Claude Code, Cursor, etc.)? Copy a ready-made prompt that tells it to fetch the setup instructions and install this server for you.

Documentation Overview

mcp-telemetry

CI npm (sdk) npm (server) License: MIT

Socket.IO for AI agents. Instrument any MCP server's tool calls with a few lines, and any MCP client watching (Claude Code, Cursor, or your own tooling) gets live, structured progress β€” no polling, no context-flooding tool calls.

mcp-telemetry demo

Your MCP server                    mcp-telemetry server         Agent
─────────────────                  ────────────────────         ─────
mcp-telemetry-sdk
  job.stepStart('build')
       β”‚
       β”‚ local socket (queued, persistent connection)
       β–Ό
  collector receives event
  store updates job state
       β”‚
       β”‚ MCP notifications/progress
       β–Ό
                                    telemetry_subscribe tool     Claude Code
                                    pushes event to agent   β†’   sees inline
                                                                 live status

Why this exists

MCP tool calls are synchronous: an agent calls a tool, waits, gets a result. For anything long-running, that leaves two bad options β€” block the whole call with no visibility, or have the agent poll a status tool in a loop (which floods the conversation with repeated tool calls and burns context for no new information).

MCP does have one legitimate way for a server to push updates mid-call: notifications/progress, keyed to a progressToken on the in-flight request. But every MCP server author ends up re-implementing the same plumbing β€” extracting the token, wiring a timer, tailing output, cleaning up on completion. mcp-telemetry is that plumbing, factored out once, plus a companion server so a job started in one session can be watched from a completely different one.

How it fits together

Two packages, one job each:

PackageWho uses itWhat it does
mcp-telemetry-sdkMCP server authorsImport it, call job.start() / .stepDone() / .log() from your tool handlers. Zero runtime dependencies β€” it's a socket writer with a persistent, queued connection and nothing else.
mcp-telemetry-serverAgent usersAn MCP server you register once. Exposes telemetry_subscribe (blocks and streams live progress for a job), plus telemetry_jobs/telemetry_job_status for point-in-time queries.

These two packages are architecturally independent β€” the SDK never calls any MCP tool, and the server never imports your tool's code. They only ever meet at a local socket, so a producer with a broken connection can't take down anything, and a collector that's overwhelmed can't block your tool call.

Quickstart

1. Instrument your MCP server (mcp-telemetry-sdk)

npm install mcp-telemetry-sdk
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
import { MCPTelemetry } from "mcp-telemetry-sdk";

const server = new McpServer({ name: "my-deploy-server", version: "1.0.0" });
const telemetry = new MCPTelemetry(); // zero config β€” derives a socket path from cwd

server.tool("deploy", { env: z.string() }, async ({ env }) => {
  const job = telemetry.createJob({ task: `deploy ${env}` });

  job.start();
  job.stepStart("build");
  await runBuild();
  job.stepDone("build", { duration: 2100 });

  job.stepStart("test");
  const passed = await runTests();
  if (!passed) {
    job.stepFailed("test", "3 tests failed");
    await job.done(1);
    return { content: [{ type: "text", text: "Deploy failed at test stage" }] };
  }
  job.stepDone("test");

  await job.done(0);
  return { content: [{ type: "text", text: "Deployed successfully" }] };
});

That's the entire integration. If nothing is listening on the socket, every call is a fast no-op β€” your server behaves identically with or without a collector running.

2. Watch it from an agent (mcp-telemetry-server)

npm install -g mcp-telemetry-server

Register it as an MCP server, alongside your instrumented one:

{
  "mcpServers": {
    "deploy": { "command": "npx", "args": ["-y", "deploy-mcp"] },
    "telemetry": { "command": "npx", "args": ["-y", "mcp-telemetry-server"] }
  }
}

Then, in your agent session:

You:   deploy to staging
Agent: calls the deploy tool, then telemetry_subscribe with the returned job id

  β–Ά deploy staging
  ↻ build
  βœ“ build (duration=2100)
  ↻ test
  βœ“ test
  βœ“ job done (exit 0)

Agent: "Deployed to staging successfully."

No polling, no separate terminal, no context-flooding tool calls β€” one deploy call plus one telemetry_subscribe call, regardless of how long the job runs.

API reference

mcp-telemetry-sdk

new MCPTelemetry(opts?) Creates a telemetry client. opts.socketPath overrides the default (derived from process.cwd() via getSocketPath()). Owns one persistent, queued connection shared by every job it creates.

telemetry.createJob({ id?, task }) β†’ JobHandle Starts tracking a job. id defaults to an auto-incrementing job-N.

telemetry.disconnect() Closes the underlying connection. Call on server shutdown if you want a clean teardown instead of letting it idle.

JobHandle methodEmitsNotes
start()job_startCall once, at the beginning of the tool handler.
stepStart(name, meta?)step_startname is any string β€” 'build', 'implement', whatever fits your domain.
stepDone(name, meta?)step_donemeta is arbitrary key/value data (shown in telemetry_subscribe's live output).
stepFailed(name, reason?)step_failed
log(line, stream?)logstream is 'stdout' | 'stderr', optional. Rapid log lines are coalesced by the server before being pushed live β€” see below.
cost(amount, meta?)costamount in USD.
done(exitCode?)job_doneAsync. This is the terminal event β€” nothing else may be sent after it, so it actively retries delivery for up to 1.5s instead of relying on a future send() to recover from a transient connection failure. Safe to call without await.

getSocketPath(root?) is also exported, for advanced cases where you need to compute the same path a producer and a server will independently derive.

mcp-telemetry-server

Exposes three MCP tools:

ToolBehavior
telemetry_subscribe({ jobId?, timeoutMs? })Blocks and streams live notifications/progress for the given job (or the next job to start, if jobId is omitted) until it finishes or timeoutMs elapses (default 5 min). This is the tool your agent calls to watch a job.
telemetry_jobs()Lists all jobs the server currently knows about, with status and cost.
telemetry_job_status({ jobId })Full state of one job β€” every step, cost, and any failure reason.

Comparison

Three genuinely different categories of approach exist near this space β€” none of them solve the same problem:

mcp-telemetryAsync job runnersCompletion notifiersOpenTelemetry MCP instrumentation
MechanismPush (notifications/progress)Poll (call a status/tail tool yourself)Push, but only at completion (webhook/sound)Traces/metrics to an observability backend
Live step-by-step progressYesNo β€” you ask, it answersNo β€” only "it's done"No β€” post-hoc analysis
Watch from a different sessionYesNo β€” tied to the session that started itPartial (a webhook can fire anywhere)N/A β€” not agent-facing
Who it's forAny MCP server author + any agentAnyone needing async shell execution specificallyAnyone wanting a completion pingServer operators monitoring their own deployment

Relationship to SEP-1686 (MCP Tasks): the MCP spec's own answer to this problem β€” Accepted into the spec (not just proposed), giving requests a durable task handle (taskId) with tasks/get polling and a progressToken valid for the task's whole lifetime. It's the eventual "correct" fix, backed by real production cases (Amazon cites healthcare data pipelines, CI/CD wrapping, and multi-agent systems in the SEP itself). The catch: it's labeled awaiting-sdk-change β€” the standard is settled, but client/server SDKs haven't implemented it yet, so it isn't something you can rely on today. mcp-telemetry solves the same problem now, on the current stable protocol β€” a working bridge you can adopt today and retire once Tasks lands in the SDKs you depend on, not a competing standard.

Design notes worth knowing before you rely on this

  • The producerβ†’server connection is a persistent, queued socket, not one connection per event. Events are flushed in order once connected; a burst that arrives before the connection finishes establishing is queued and delivered in order once it does.
  • Delivery is best-effort, not guaranteed, with one exception: done(). Every other event silently drops if the collector isn't reachable and nothing else triggers a retry β€” this is deliberate (telemetry should never be able to block or crash your actual tool call). done() is the one event that actively retries for a bounded window, since it's usually the last thing a job ever sends.
  • telemetry_subscribe only shows live-forward events β€” it doesn't replay history. If a job already finished before you subscribed, use telemetry_job_status instead.
  • This is not a distributed job queue. There's no persistence across a collector restart, no cross-machine delivery, and no retry policy beyond what's described above. If you need that, you want a real message queue β€” this is deliberately just enough to solve "watch a local MCP tool call live," nothing more.

Development

git clone https://github.com/arnavranjan005/mcp-telemetry.git
cd mcp-telemetry
npm install
npm run build
npm test

See CONTRIBUTING.md for the full setup, monorepo layout, and PR expectations.

License

MIT Β© Arnav Ranjan

Related MCP Servers

aayushmdesai/mcp-dotnet-diagnostics

🏠 🍎 🐧 - Live .NET runtime diagnostics for AI assistants. Ask Claude to diagnose memory leaks, GC pressure, LOH fragmentation, and thread starvation in any running .NET process β€” no code changes required. Install: dotnet tool install -g mcp-dotnet-diagnostics

πŸ“Š Monitoring0 views
adanb13/cirdan

🐍 🏠 🍎 πŸͺŸ 🐧 - AI infrastructure cartographer & MCP server: fingerprints, graphs, and watches the live infrastructure an agent can reach (Docker, Kubernetes, cloud, IaC) and detects incidents.

πŸ“Š Monitoring0 views
agentkitai/agentlens

πŸ“‡ 🏠 ☁️ 🍎 πŸͺŸ 🐧 - Tamper-evident observability for AI agents: a SHA-256 hash-chained audit log with chain verification and signed export (EU AI Act Art. 12). Instrument any agent with zero code via npx -y @agentlensai/mcp; also ingests OpenTelemetry GenAI traces.

πŸ“Š Monitoring0 views
alilxxey/openobserve-community-mcp

🐍 🏠 🍎 πŸͺŸ 🐧 - Read-only MCP server for OpenObserve Community Edition via REST API. Search logs, traces, stream schemas, and dashboards without requiring the Enterprise license.

πŸ“Š Monitoring0 views

Engagement

Views
0
Installs
0
Upvotes
0

Views and upvotes are unique per visitor network (hashed IP). Installs count copy actions.

Status

Health: Not checked yet

We have not completed a health check for this listing yet.

Last checked: 7/28/2026, 3:01:07 PM

Unclaimed listing (imported or pending owner verification). Claim it β†’
β˜… Spotlight Slot

Feature Your MCP Server

Get maximum visibility for your server across our directory, search results, and detail pages.

Spotlight Your Server

Own this project?

This directory is pre-filled from public sources. Claim via GitHub README, site badge, or DNS TXT to get the verified badge and attach your website.

Claim this listing

Promote this listing

Optional paid placement. Free listings stay free forever.

Share & Embed

Add our SVG badge (dark/light directory styles) or embeddable widget to your site.