Skip to content

feat(cli)!: return MCP list result envelopes in JSON mode - #472

Draft
DivyamTalwar wants to merge 1 commit into
apify:mainfrom
DivyamTalwar:fix/json-list-envelope-183-20261023
Draft

DivyamTalwar wants to merge 1 commit into
apify:mainfrom
DivyamTalwar:fix/json-list-envelope-183-20261023

Conversation

@DivyamTalwar

@DivyamTalwar DivyamTalwar commented Oct 22, 2026 •

Copy link
Copy Markdown

Summary

Fixes #183. JSON list commands return complete MCP result envelopes, preserving all pages instead of returning only item arrays or first-page metadata.

  • tools-list, prompts-list, and resources-list now return { tools: [...] }, { prompts: [...] }, and { resources: [...] }. tasks-list retains its existing { tasks: [...] } shape without double wrapping.
  • Concatenate item arrays, shallow-merge unknown top-level fields and individual _meta keys in page order (later values win), and omit the consumed nextCursor.
  • Observe validated individual pages through the pinned SDK's public request boundary before typed aggregation discards metadata. Retain typed SDK cache ownership, capability checks, output validation, and tool-header filtering/mirroring. Keep per-walk metadata isolated under concurrency and retain full envelopes in the outer tools cache.
  • Preserve human-readable output. Update built-in help/schema links, the generated reference, agent skill, changelog, examples, and test consumers.

Breaking change / release decision

This is intentionally a draft pending a maintainer decision on releasing the array-to-object JSON migration. Existing jq consumers change .[] to .tools[], .prompts[], or .resources[]; tasks keep their current envelope. No dependency or lockfile changes are included.

The requested later-values-win policy explicitly includes ttlMs and cacheScope and therefore affects freshness when servers emit conflicting page hints. This policy is documented and tested rather than silently retaining first-page values.

Validation

Revalidated on native macOS/Node 25.2.1 against 38c9fcb5aef05740944d9b154758ad03f8fab8a3 on 23 October 2026:

  • Full unit suite: 1,402 passed across all 60 test files, no failures or skips.
  • Selected real-server legacy MCP 2025-11-25 E2E suites: 5 passed, 0 failed, 0 skipped (json-schema, prompts, resources, pagination, async-tasks).
  • Selected real-server modern MCP 2026-07-28 E2E suites: 5 passed, 0 failed, 0 skipped (json-schema, prompts, resources, pagination, tasks-extension).
  • Project test:conformance command: rebuilt successfully, then official client initialization scenario 1/1 passed, no failures or warnings.
  • Previously completed focused SDK/CLI tests: 214 passed; help suite: 27 passed. Generated reference, lint/format and diff checks passed. These overlap the full suite and are not additive coverage totals.

The earlier sandbox socket-denial and missing-conformance-tool limitations are superseded by these actual native runs. An initial rerun with an explicit MCPC_HOME_DIR caused three default-path expectation failures; the canonical rerun used a disposable HOME without that override and all 1,402 passed. No test assertions were removed or skipped. The E2E runs used isolated test homes and local fixture servers, not user OAuth profiles.

These are local executed checks, not upstream CI authorization or approval. Other E2E scenarios and runtime/platform combinations are outside this selected native run.

Remaining gates

  • Complete the full native unit suite and affected legacy/modern E2E selections.
  • Run the project's client-conformance initialization scenario.
  • Agree the breaking-change release/versioning strategy before marking ready.
  • Obtain normal maintainer review and authorization/results for upstream CI.

Recorded VHS media is not regenerated; the source scripting commands are updated. No release or upstream merge is performed by this PR.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make list commands MCP spec complaint in JSON mode

2 participants