A tracing adapter can pass its internal tests while capturing nothing in an installed application.
The imports resolve. The tool executes. No exception tells the developer that the trace is incomplete. A test that only checks the tool's return value misses the failure entirely.
I maintain AgentInspect. A public external evaluation of the older 6.29.1 release examined this boundary with the MCP SDK. It documented capture/runtime-identity and wrapper-compatibility problems. That repository is a historical reproduction, not a verdict on today's release.
For this article, I built a separate installed-package smoke test against agent-inspect@6.31.35, @agent-inspect/mcp@6.31.35, and MCP SDK 1.31.0. The question was narrower than “does the library work?”: does the published integration observe the calls made by a real SDK consumer?
Package topology can change runtime behavior
Imagine that a root package creates an asynchronous run context while an adapter consults another bundled copy of the context module. The application has an active run in one instance; the adapter sees none in the other.
A dependency tree can look deduplicated while the build output still contains duplicated runtime state. Listing installed versions is useful, but it does not prove that both imports share the same live context.
Another boundary is object behavior. SDK clients can expose prototype methods, getters, and methods that depend on the original receiver. A wrapper that merely spreads an instance into a new object may lose functionality. A proxy that forwards a method with the wrong receiver can also break private state access.
These are integration properties. Test them at the consumer boundary.
The server's execution counter is independent of the tracing adapter.
Use the real SDK without requiring a remote service
The companion examples install exact versions through a committed lockfile. They create a real MCP Client and Server connected with InMemoryTransport.createLinkedPair().
The transport is in-memory; the SDK classes are not mocks. The server exposes one synthetic echo tool and increments a counter whenever its tool handler runs.
The central consumer assertions are:
const wrapped = wrapMcpClient(client, { serverName: "fixture" });
assert.ok(wrapped instanceof Client);
await wrapped.ping();
await inspectRun("sdk-capture", async () => {
await wrapped.listTools();
const result = await wrapped.callTool({
name: "echo",
arguments: {},
});
assert.equal(result.content[0].text, "fixture-ok");
}, { traceDir, silent: true });
This is an excerpt; sdk-smoke-shared.cjs contains the server setup, trace readback, and finally cleanup. The complete harness then asserts:
assert.equal(calls, 1);
assert.equal(starts.length, 2);
assert.ok(starts.some(row => row.name === "mcp:tools/list"));
assert.ok(starts.some(row => row.name === "mcp:echo"));
Two captured steps are expected because the fixture lists tools and calls one tool. The independent handler count confirms one actual tool execution.
Without that comparison, “the trace contains one span” could pass while another executed call disappeared.
Exercise both module systems explicitly
The test launches two separate consumers: one using ESM imports and another using CommonJS require. Each uses the public package entry points.
On the Linux environment used for the original article test, Node 24.22.1, both passed:
| Consumer | Server tool calls | Captured list/call steps | SDK ping |
|---|---|---|---|
| ESM | 1 | 2 | Pass |
| CommonJS | 1 | 2 | Pass |
During final editorial verification, I installed the same lockfile and reran the complete nine-test harness on macOS arm64 with Node 22.22.3. The ESM and CommonJS SDK consumers passed there as well, with the same one-call/two-captured-step result. That adds a second bounded environment; it does not turn two passing environments into a universal compatibility claim.
The test also checks the original result and closes the wrapped client and server. It does not establish that every SDK method, transport, authentication path, or operating system is compatible. Native Windows, HTTP and stdio transports, OAuth, reconnect behavior, and the full SDK surface remain outside this fixture.
That last sentence is part of the result, not a disclaimer to hide below it.
Use Docker to bound the reproduction
The examples include a small Dockerfile:
FROM node:24-bookworm-slim
WORKDIR /work
COPY package.json package-lock.json ./
RUN npm ci --ignore-scripts --no-audit --no-fund
COPY *.mjs *.cjs ./
CMD ["npm", "test"]
Build while dependency downloads are available, then run the synthetic suite without external networking:
docker build -t agent-evidence-probes ./examples
docker run --rm --network none agent-evidence-probes
Docker's none network driver leaves only loopback networking. That is useful here because the SDK transport is in-memory and the tests need no provider credentials. A blocked network makes accidental external dependencies easier to detect.
The Node tests were executed for this article; the Docker commands were reviewed but not executed because this environment had no Docker engine. Before publishing a container-specific result, run them yourself. For repeatable CI, record an approved immutable image digest; a major-version tag can move.
Make the release matrix reflect real support claims
Linux-in-Docker is not a substitute for native operating-system testing. The added macOS rerun improves the matrix, but it does not cover native Windows. Nor do two passing Node environments validate every version in a peer-dependency range.
Add cells based on the support policy: module system, operating system, Node version, SDK version, and relevant transport. Keep unsupported or untested cells visible rather than coloring an entire platform green from one smoke test.
A published contributor report can extend the evidence, but label its exact environment and release. Don’t silently combine different versions into one universal compatibility claim.
Let external reproductions improve the test boundary
The useful lesson from a third-party integration report is often not just the bug. It is the missing test shape: public imports, real SDK objects, independently counted calls, and persisted evidence inspected after execution.
Keep that shape in the release process. A clean monorepo suite is valuable, but the user installs a package, not your test workspace.
Implementation references
- Repository's packed MCP SDK evidence script
- MCP client wrapper
- Companion:
examples/sdk-smoke.mjs,sdk-smoke.cjs,sdk-smoke-shared.cjs, andDockerfile.

Top comments (14)
The npm package test gap is real. In agent-inspect@6.31.35, the monorepo's internal vitest suite passes, but
npm pack && npm install -gfollowed by the same fixture shows the file-writer serializer dropserror.codeon the manualinspectRun()path — a field the instance-basedcreateInspector()+fileWriter()path retains. The difference is visible in the schema version: manual path writes schema0.1, instance path writes schema1.0. Running the probe suite against the installed tarball catches this; running only against the monorepo source does not.@prascli Thanks for the precise reproduction. I haven’t verified the packed 6.31.35 behavior yet, so I won’t call it fixed or dismiss it. The manual
inspectRun()versuscreateInspector()schema difference is exactly the installed-package boundary this article argues for. I’ll reproduce both paths from the tarball and add a regression if confirmed."Passes its internal tests while capturing nothing in an installed application" is such a common trap. Testing the packed tarball in a clean project is the only test that matches what users actually install. Good write up.
@gautamtalksdev Exactly. The useful assertion is the combination of an independent SDK call counter and persisted trace readback; a green tool result alone can hide a missing span. I’m keeping the matrix explicit about which package, Node, module-system, and transport cells were actually exercised.
The independent server counter makes missing spans visible. A further case I’d test is two concurrent runs with distinct run IDs and distinct echo values: both server calls should happen once, and each persisted trace should contain only its own run’s calls. That checks context isolation, not just total span count—a wrapper could capture both calls but attach one to the wrong run. Does the current fixture exercise overlapping runs?
@innokentyb Good catch. The fixture shown here has one
inspectRun, so it does not establish overlapping-run isolation. Two distinct run IDs and echo values, followed by per-trace assertions, would catch misattribution even when the total span count looks right. That is a valuable next matrix cell.This one hit a nerve. I once shipped something where the monorepo tests were all green and the installed package silently did nothing, because two copies of the same context module were living side by side and neither one complained. The independent server counter is the part I'd copy, honestly, because "the trace has a span" proves nothing if you never counted the real calls. Do you run this consumer test on every release, or only when the adapter itself changes?
@aheadkit That failure mode is exactly why the handler counter sits outside the adapter. This article shows an installed-package consumer test, but I don’t want to imply it currently runs on every release. It belongs in a publish gate, since bundling can change even when the adapter source does not.
the independent server counter is the strongest assertion here. i'd add a negative fixture that intentionally loads a second bundled run-context singleton: callTool still returns fixture-ok and the handler count stays at 1, while one of the two expected spans disappears. that would prove the test catches silent capture loss, not just a healthy package. do you also run a clean npm pack -> install-from-tarball smoke test before publishing?
@ademisler The example installs the published 6.31.35 packages through a lockfile; that is different from saying a clean
npm packtarball test is already a prepublish gate on every release. Your deliberately duplicated run-context singleton is a strong negative control because the tool can still succeed while capture drops out. Thanks for sharpening that distinction.Saving this as my release checklist:
Thanks for writing it up so clearly, Raju! 🧪
@kate_astrid Thanks for turning it into a checklist. I would keep trace readback and the independent server count side by side, so the test catches silent missing capture. If Docker becomes a CI claim, pin the image digest as well as the package lockfile.
Testing both ESM and CommonJS is a smart move.
@parasraju Yes—ESM and CommonJS can resolve different build outputs even when the source tests are green. Exercising both through the public package entry points is a small check with a lot of value.