Skip to content

fix(server): add success envelope to /v1/extract responses so MCP extract tools validate#323

Merged
us merged 2 commits into
mainfrom
fix/mcp-extract-success-envelope
Jul 18, 2026
Merged

fix(server): add success envelope to /v1/extract responses so MCP extract tools validate#323
us merged 2 commits into
mainfrom
fix/mcp-extract-success-envelope

Conversation

@us

@us us commented Jul 18, 2026

Copy link
Copy Markdown
Owner

The stdio and CLI MCP proxies forward the raw /v1/extract REST body verbatim as structuredContent, which strict clients validate against each tool's advertised outputSchema. ExtractStartResponse and ExtractStatusResponse omitted the success field that the crw_extract / crw_check_extract_status / crw_cancel_extract schemas require, so every extract call over those transports failed client-side validation with data must have required property 'success'.

success is already carried by every other /v1 response (scrape, search, map, crawl); the async extract lifecycle was the only one missing it. The in-server /mcp path compensated by injecting it manually, which is why only the proxied transports broke.

Changes:

  • ExtractStartResponse.success = true; ExtractStatusResponse.success = (status != failed), set in the one canonical serialize_extract_status.
  • Drop the now-redundant extract_status_value success-injection helper in the in-server MCP handler; the start handler serializes ExtractStartResponse for a single source of truth.
  • Add success to OpenAPI ExtractAccepted / ExtractStatus (both 3.1 and 3.0 specs, crate + docs copies kept byte-identical for the drift check).
  • Regression test: the raw GET /v1/extract/{id} body validates against the advertised crw_check_extract_status schema across all five statuses; the contract test now asserts success is present and required on both surfaces instead of stripping it.

/v2/extract (Firecrawl-compat) is untouched.

ref #318

us added 2 commits July 18, 2026 21:55
The stdio/CLI MCP proxies forward the raw /v1/extract REST body verbatim
as structuredContent, which strict clients validate against each tool's
advertised outputSchema. ExtractStartResponse and ExtractStatusResponse
omitted the success field the crw_extract / crw_check_extract_status /
crw_cancel_extract schemas require (and that every other /v1 response
carries), so every extract call over those transports failed with
"data must have required property 'success'".

Set success on both structs at the single canonical serializer
(start = true, status = status != failed), drop the now-redundant
in-server success-injection helper, and add success to the OpenAPI
ExtractAccepted / ExtractStatus components (3.1 + 3.0, crate + docs
copies kept byte-identical). Regression test validates the raw
GET /v1/extract/{id} body against the advertised schema across all
statuses. /v2/extract is untouched.

ref #318
The docs-guards CI keeps docs/agent-onboarding/SKILL.md and
mcp/crw-mcp/skills/SKILL.md byte-identical; update the mirror copy's
crw_extract return example to match.

ref #318
@us
us merged commit d974d2a into main Jul 18, 2026
11 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators Jul 18, 2026
@us
us deleted the fix/mcp-extract-success-envelope branch July 18, 2026 19:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant