mcporter/tests
LDMB123 2bf7a5eab2
Some checks failed
CI / build (${{ matrix.os }}) (macos-15) (push) Has been cancelled
CI / build (${{ matrix.os }}) (ubuntu-latest) (push) Has been cancelled
CI / build (${{ matrix.os }}) (windows-latest) (push) Has been cancelled
pages / Deploy docs (push) Has been cancelled
fix(replay): rewrite response ids during replay (#192)
* feat(record): capture MCP call streams to NDJSON and replay deterministically

mcporter record <session> wraps the runtime transport and appends every
JSON-RPC request, response, and notification to a per-session NDJSON file
under ~/.mcporter/recordings/. mcporter replay <session> reconstructs an
in-memory transport from the recording and matches requests by method +
deep-equal params, returning the recorded response without contacting
the live server.

Use cases:
- Reproduce MCP-backed agent bugs offline (no live Linear quota, no
  Vercel API rate limits)
- Build test fixtures from real call sequences
- Share a session for a postmortem without sharing credentials

The format is plain JSON-RPC over NDJSON with a small _meta field
(direction, server, timestamp). No proprietary blob. Env-var passthrough
(MCPORTER_RECORD=<name>, MCPORTER_REPLAY=<name>) lets the existing
runtime constructor wrap any transport when set.

* fix(replay): attach cause to wrapped errors to satisfy preserve-caught-error lint

* fix(replay): rewrite response ids during replay

* fix(replay): harden record replay modes

Clear conflicting record/replay env vars when spawning wrapped commands, force those commands off the daemon fast path, truncate each recording file at session start, and fail replay close when recorded requests remain unused.

* fix(cli): preserve wrapped command flags

Stop global flag extraction at -- so record/replay wrappers do not consume child command flags, and drop the release-owned changelog entry from the PR diff.

* fix(replay): propagate cleanup failures through cli

Ensure replay-mode transport close failures escape normal runtime and CLI cleanup after best-effort shutdown has completed. Add runtime and CLI regressions for partial recordings that leave requests unreplayed.

* fix: harden record replay runtime paths

* test: align replay fixtures with windows home

---------

Co-authored-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
Co-authored-by: Peter Steinberger <steipete@gmail.com>
2026-05-31 08:52:02 +01:00
..
fixtures feat: support refreshable bearer stdio auth 2026-05-14 18:29:43 +01:00
helpers refactor: split call and runtime helpers 2026-03-29 09:36:35 +09:00
live fix: preserve call error exit behavior 2026-05-04 05:05:06 +01:00
adhoc-server.test.ts feat: support ad-hoc HTTP headers 2026-05-04 05:49:25 +01:00
build-bun.test.ts fix: embed bun binary version 2026-03-29 11:10:44 +09:00
call-arguments.test.ts fix: restore call long-flag arguments 2026-05-04 05:11:27 +01:00
chrome-devtools-compat.test.ts fix: patch chrome-devtools auto-connect hang 2026-05-14 12:51:16 +01:00
cli-auth-help.test.ts docs: document headless OAuth auth flow 2026-05-12 23:59:45 -03:00
cli-auth-retry.test.ts refactor: satisfy oxlint rules 2026-04-18 19:33:14 +01:00
cli-auth.test.ts fix: preserve headless auth stdout 2026-05-14 16:47:03 +01:00
cli-call-args.test.ts feat(call): infer stdio commands and single-tool servers 2025-11-10 18:43:04 +00:00
cli-call-errors.test.ts refactor: satisfy oxlint rules 2026-04-18 19:33:14 +01:00
cli-call-execution.test.ts fix: use cached auth for daemon OAuth calls 2026-05-20 17:09:14 +01:00
cli-call-help.test.ts Handle help tokens for call/auth/list 2025-11-25 22:33:09 +01:00
cli-command-inference.test.ts Add hidden aliases and README artwork 2025-11-26 00:32:36 +01:00
cli-config-command.test.ts Merge pull request #171 from feniix/feat/headless-oauth-no-browser 2026-05-14 16:48:57 +01:00
cli-config-fallback.test.ts Fix daemon implicit config handling and docs 2025-11-28 07:33:44 +01:00
cli-config-routing.test.ts feat(config): tighten config cli ux 2025-11-08 13:36:40 +00:00
cli-daemon-fast-path.test.ts fix(replay): rewrite response ids during replay (#192) 2026-05-31 08:52:02 +01:00
cli-ephemeral-flags.test.ts feat: support ad-hoc HTTP headers 2026-05-04 05:49:25 +01:00
cli-flag-utils.test.ts fix(replay): rewrite response ids during replay (#192) 2026-05-31 08:52:02 +01:00
cli-force-exit-behavior.integration.test.ts test: prebuild dist before vitest 2026-05-09 12:30:11 +01:00
cli-generate-artifacts.test.ts Add Bun bundler option for CLI generation 2025-11-07 17:12:42 +00:00
cli-generate-cli.integration.test.ts test: prebuild dist before vitest 2026-05-09 12:30:11 +01:00
cli-generate-runner.test.ts fix: harden generated cli bundles 2026-05-14 19:22:37 +01:00
cli-global-flags.test.ts Fix global help and version flags 2025-11-07 14:57:58 +00:00
cli-help-shortcuts.test.ts fix: harden live mcp cli paths 2026-05-09 12:23:33 +01:00
cli-image-output.test.ts refactor: streamline call parsing/output pipeline 2026-03-02 22:58:07 +00:00
cli-inspect-command.test.ts Add unit tests for CLI helpers 2025-11-07 04:33:21 +00:00
cli-list-classification.test.ts perf: keep list non-interactive 2026-05-09 12:04:25 +01:00
cli-list-flags.test.ts feat: add list health check flags (#183) 2026-05-20 20:55:21 +01:00
cli-list-formatting.test.ts feat: add compact list signatures 2026-05-04 06:52:34 +01:00
cli-list-help.test.ts feat: add compact list signatures 2026-05-04 06:52:34 +01:00
cli-list-json.test.ts feat: add list health check flags (#183) 2026-05-20 20:55:21 +01:00
cli-list-stdio-logs.test.ts feat: add resource read command 2026-05-04 07:50:26 +01:00
cli-list-verbose-e2e.test.ts Release 0.6.2 2025-11-18 10:13:34 +01:00
cli-oauth-timeout-flag.test.ts feat: add resource read command 2026-05-04 07:50:26 +01:00
cli-output-utils.test.ts fix: harden concurrent config writes 2026-05-14 16:32:37 +01:00
cli-regenerate.test.ts refactor: satisfy oxlint rules 2026-04-18 19:33:14 +01:00
cli-resource-command.test.ts fix: harden live mcp cli paths 2026-05-09 12:23:33 +01:00
cli-serve-command.test.ts fix: cover serve daemon edge cases 2026-05-13 20:32:33 -04:00
cli-serve-runtime.test.ts feat: add mcporter serve bridge 2026-05-13 20:26:12 -04:00
cli-version.test.ts Fix version reporting without package.json 2025-11-07 15:39:22 +00:00
config-add-dry-run.test.ts test(config): add modular config tests and helpers 2025-11-17 13:00:20 +01:00
config-add-flags.test.ts feat: support static oauth clients 2026-05-04 08:03:13 +01:00
config-add-imports.test.ts fix: preserve config imports defaults 2025-12-30 01:25:04 +01:00
config-add-persist.test.ts test(config): add modular config tests and helpers 2025-11-17 13:00:20 +01:00
config-add-scope-behavior.test.ts fix: honor xdg directories 2026-05-04 08:14:31 +01:00
config-add-scope.test.ts fix: honor xdg directories 2026-05-04 08:14:31 +01:00
config-add-sse.test.ts test(config): add modular config tests and helpers 2025-11-17 13:00:20 +01:00
config-command-string.test.ts fix: preserve spaced stdio paths 2026-05-06 22:49:36 +01:00
config-doctor.test.ts chore: fix lint and tests 2025-12-03 17:20:09 +00:00
config-get-json.test.ts test(config): add modular config tests and helpers 2025-11-17 13:00:20 +01:00
config-import-dedupe.test.ts test(config): add modular config tests and helpers 2025-11-17 13:00:20 +01:00
config-import-paths.test.ts fix: stabilize windows ci 2025-11-10 16:13:27 +00:00
config-import.test.ts fix: harden concurrent config writes 2026-05-14 16:32:37 +01:00
config-imports-unit.test.ts test: strengthen claude import coverage 2025-11-22 01:59:49 +01:00
config-imports.test.ts feat: support refreshable bearer stdio auth 2026-05-14 18:29:43 +01:00
config-layered.test.ts fix: fall back to legacy config after empty xdg home (#185) 2026-05-21 22:15:13 +01:00
config-list-text-footer.test.ts test(config): add modular config tests and helpers 2025-11-17 13:00:20 +01:00
config-list.test.ts test(config): add modular config tests and helpers 2025-11-17 13:00:20 +01:00
config-missing.test.ts fix: finalize jsonc config support coverage (#42) (thanks @aryasaatvik) 2026-03-03 00:26:13 +00:00
config-normalize.test.ts fix: support daemon idle timeout config 2026-05-20 17:34:42 +01:00
config-remove.test.ts test(config): add modular config tests and helpers 2025-11-17 13:00:20 +01:00
config-render.test.ts feat: support refreshable bearer stdio auth 2026-05-14 18:29:43 +01:00
config-resolution.test.ts fix: fall back to legacy config after empty xdg home (#185) 2026-05-21 22:15:13 +01:00
config-schema-file.test.ts feat: add per-server tool filtering 2026-04-18 21:52:18 +01:00
config-shared.test.ts test(config): add modular config tests and helpers 2025-11-17 13:00:20 +01:00
config-sources.test.ts feat(list): show verbose config sources 2025-11-17 08:16:26 +01:00
daemon-cli-command.test.ts Fix daemon implicit config handling and docs 2025-11-28 07:33:44 +01:00
daemon-client-config-stale.test.ts fix: reconcile daemon lifecycle starts 2026-05-28 16:45:31 +01:00
daemon-client-lifecycle.test.ts fix: reconcile daemon lifecycle starts 2026-05-28 16:45:31 +01:00
daemon-client-timeout.test.ts fix: reconcile daemon lifecycle starts 2026-05-28 16:45:31 +01:00
daemon-client.test.ts fix: reconcile daemon lifecycle starts 2026-05-28 16:45:31 +01:00
daemon-host.test.ts fix(daemon): keep stdio list requests warm 2026-05-29 05:18:32 +01:00
daemon-launch.test.ts fix: start bun daemon children through nohup 2026-05-04 07:32:27 +01:00
daemon-request-utils.test.ts fix: support daemon idle timeout config 2026-05-20 17:34:42 +01:00
daemon.integration.test.ts fix(daemon): keep stdio list requests warm 2026-05-29 05:18:32 +01:00
emit-ts.test.ts fix: handle CLI generation edge cases 2026-05-04 05:05:12 +01:00
ephemeral-target.test.ts fix(runner): harden summary+sleep handling 2025-11-14 22:17:39 +01:00
error-classifier.test.ts fix: detect auth errors from error.code property (StreamableHTTPError/SseError) 2026-03-28 19:21:23 +00:00
fs-json.test.ts fix: harden concurrent config writes 2026-05-14 16:32:37 +01:00
generate-cli-helpers.test.ts fix: improve generated cli raw and array parsing 2026-05-04 05:55:18 +01:00
generate-cli.test.ts fix: make generated cli bundles deterministic 2026-05-20 16:53:37 +01:00
generate-definition.test.ts Document inline command shorthand 2025-11-07 15:08:44 +00:00
generator-flag-parser.test.ts Add emit-ts improvements and shared CLI infrastructure 2025-11-07 01:16:14 +00:00
index-api.test.ts Polish CLI argument parsing and clean lint warnings 2025-11-05 22:39:37 +00:00
keep-alive-runtime.test.ts fix: use cached auth for daemon OAuth calls 2026-05-20 17:09:14 +01:00
lifecycle.test.ts Release 0.5.8 2025-11-15 07:17:20 +01:00
list-detail-helpers.test.ts test: satisfy lint for list helpers 2025-11-08 01:07:57 +00:00
list-format.test.ts fix(generate-cli): stabilize http command inference 2025-11-18 05:32:45 +00:00
list-inline-stdio.test.ts feat: add resource read command 2026-05-04 07:50:26 +01:00
list-output.test.ts feat: add compact list signatures 2026-05-04 06:52:34 +01:00
node-http-fetch.test.ts fix: add HTTP fetch compatibility mode 2026-05-14 17:31:36 +01:00
oauth-callback.test.ts feat: add OAuth no-browser session support 2026-05-12 23:59:34 -03:00
oauth-open-external.test.ts fix: quote Windows OAuth URLs (#136) 2026-04-18 20:03:37 +01:00
oauth-persistence.test.ts fix: harden OAuth vault recovery (#190) 2026-05-26 15:47:31 +01:00
oauth-session.test.ts feat: add OAuth no-browser session support 2026-05-12 23:59:34 -03:00
paths.test.ts fix: fall back to legacy config after empty xdg home (#185) 2026-05-21 22:15:13 +01:00
record-replay-cli-close.test.ts fix(replay): rewrite response ids during replay (#192) 2026-05-31 08:52:02 +01:00
record-replay-cli.test.ts fix(replay): rewrite response ids during replay (#192) 2026-05-31 08:52:02 +01:00
record-replay.test.ts fix(replay): rewrite response ids during replay (#192) 2026-05-31 08:52:02 +01:00
result-utils.test.ts fix: harden concurrent config writes 2026-05-14 16:32:37 +01:00
runtime-call-timeout.test.ts test: ensure call timeout is forwarded to MCP client 2025-11-17 10:21:01 +01:00
runtime-compose.test.ts fix: use cached auth for daemon OAuth calls 2026-05-20 17:09:14 +01:00
runtime-error-reset.test.ts chore: format keep-alive patch 2025-11-11 13:50:33 +00:00
runtime-header-utils.test.ts Test runtime header materialization 2025-11-07 04:24:29 +00:00
runtime-integration.test.ts feat: add resource read command 2026-05-04 07:50:26 +01:00
runtime-oauth-connect.test.ts fix: preserve valid cached OAuth tokens 2026-05-20 17:21:05 +01:00
runtime-oauth-detection.test.ts feat: support refreshable bearer stdio auth 2026-05-14 18:29:43 +01:00
runtime-oauth-timeout.test.ts refactor(cli): split generate-cli runner 2025-11-17 19:15:28 +01:00
runtime-oauth-utils.test.ts fix: extend oauth browser timeout 2026-05-08 03:56:38 +01:00
runtime-process-utils.test.ts fix: escalate stuck stdio shutdowns 2026-04-18 20:07:40 +01:00
runtime-transport.test.ts feat: support refreshable bearer stdio auth 2026-05-14 18:29:43 +01:00
runtime-utils.test.ts refactor(cli): split generate-cli runner 2025-11-17 19:15:28 +01:00
runtime.test.ts fix: resolve config env placeholders 2026-05-09 13:14:09 +01:00
schema-cache.test.ts test: make xdg path assertions portable 2026-05-04 08:17:42 +01:00
sdk-patches.test.ts fix: escalate stuck stdio shutdowns 2026-04-18 20:07:40 +01:00
serve.test.ts fix: use cached auth for daemon OAuth calls 2026-05-20 17:09:14 +01:00
server-proxy.test.ts Align Biome config with Sweetistics and fix lint issues 2025-11-05 20:49:49 +00:00
stdio-servers.integration.test.ts test: prebuild dist before vitest 2026-05-09 12:30:11 +01:00
template-cwd.test.ts fix: anchor generated cli stdio cwd 2026-05-04 05:16:43 +01:00
tool-cache.test.ts perf: keep list non-interactive 2026-05-09 12:04:25 +01:00
tool-filters.test.ts feat: add per-server tool filtering 2026-04-18 21:52:18 +01:00
vault-command.test.ts feat: add headless OAuth vault seeding 2026-05-09 14:55:44 +01:00
version-consistency.test.ts chore(version): derive runtime version from package.json 2025-11-17 08:16:30 +01:00