Skip to content

Release/1.2.0 - #18

Merged
ObjectIsAdvantag merged 2 commits into
mainfrom
release/1.2.0
Jul 30, 2026
Merged

ObjectIsAdvantag merged 2 commits into
mainfrom
release/1.2.0

Conversation

@ObjectIsAdvantag

Copy link
Copy Markdown
Collaborator

Added

  • structuredContent in tools/call responses when outputSchema is declared.
    Per MCP spec 2025-06-18, when a tool declares an outputSchema the mock now
    populates structuredContent with the resolved JSON payload alongside the
    backward-compatible content text block. This applies to all three data
    sources: file overrides (--data), example selection, and Faker generation.
    Hosts and clients that consume the typed structuredContent path now receive
    data from the mock; text-only consumers are unaffected (no breaking change).

    Example response shape for a tool with outputSchema:

    {
      "content": [{ "type": "text", "text": "{\"sessionId\":\"mock-sessionId-001\",\"state\":\"active\",…}" }],
      "structuredContent": { "sessionId": "mock-sessionId-001", "state": "active", "totalQuestions": 42, "currentQuestion": 0 }
    }
  • outputSchema-driven Faker generation.
    When a tool declares an outputSchema and no override or example is
    available, the Faker generator now produces data shaped by that schema
    (respecting types, enums, formats, and minimum/maximum constraints)
    rather than the generic success envelope. This gives a correct first-run
    experience for any tool with a declared output contract — no --data
    directory and no recording required.

  • Optional debug validation of structuredContent against outputSchema.
    When --debug is set, the mock validates the resolved payload against the
    tool's outputSchema using Ajv and logs a warning to stderr if the data does
    not conform. This catches drift between authored fixtures and the declared
    output contract at design time without affecting normal operation.

  • New test fixture tests/fixtures/mcpdesc/structured-output-server.mcpdesc.json:
    a dedicated mcpdesc with three tools (create-session, get-status,
    list-results) covering object outputSchema, no outputSchema, and array
    outputSchema respectively — used by the new integration suite.

  • 7 new integration tests in
    tests/integration/structured-content.test.ts covering the Faker path and
    the --data override path for structuredContent emission and backward
    compatibility.

Fixed

  • Replay matching for resources/read is now URI-aware. Recorded entries
    are keyed by concrete resource URI (resources/read:<uri>), enabling
    deterministic per-resource content replay (including template instances).
  • Matched replay errors are surfaced for resources/read. A recorded
    error response is replayed as an error for the matching resource read,
    consistent with tools/call behavior.

Changed

  • Replay authoring docs updated for method-specific matching rules.
    docs/authoring-replay-datasets.md now documents resources/read URI-aware
    keys, method-specific argument extraction, and the structuredContent field
    in hand-authored replay responses.

- key resources/read replay entries by concrete URI

- preserve replay compatibility for non-resource methods

- add integration coverage for distinct URIs, template instances, and replayed errors

- update README, replay authoring docs, and changelog

Signed-off-by: Steve Sfartz <stsfartz@cisco.com>
feat: structuredContent in tools/call responses when outputSchema is declared

- tools/call now emits structuredContent alongside the backward-compatible
  content text block whenever the tool declares an outputSchema (MCP spec
  2025-06-18). All three data sources are covered: file overrides (--data),
  example selection, and Faker generation.
- FakerGenerator.generate() uses outputSchema to produce schema-shaped data
  (types, enums, formats, min/max) when declared, replacing the generic
  success envelope for tools with an output contract.
- New public FakerGenerator.generateFromSchema() method for recursive
  JSON Schema → mock value generation.
- Optional --debug validation of structuredContent against outputSchema via
  Ajv; warns on mismatch without affecting normal operation.
- New test fixture: structured-output-server.mcpdesc.json
- 7 new integration tests in structured-content.test.ts (Faker + override paths)
- Updated docs: README, manual-mocks, authoring-replay-datasets, building-mocks

Also promotes the [Unreleased] resources/read URI-aware replay fixes from
v1.1.x into the 1.2.0 release entry.

Fixes #13

Signed-off-by: Steve Sfartz <stsfartz@cisco.com>
@ObjectIsAdvantag
ObjectIsAdvantag merged commit 3d9a8e6 into main Jul 30, 2026
5 checks passed
@ObjectIsAdvantag
ObjectIsAdvantag deleted the release/1.2.0 branch July 30, 2026 08:50
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.

1 participant