Skip to content

Export WAI application; turn golden fixtures into an API-agnostic conformance corpus - #24

Merged
drshade merged 1 commit into
mainfrom
wai-and-conformance
Aug 1, 2026
Merged

Export WAI application; turn golden fixtures into an API-agnostic conformance corpus#24
drshade merged 1 commit into
mainfrom
wai-and-conformance

Conversation

@drshade

@drshade drshade commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Implements the two actionable ideas from the dpella/mcp merge discussion (#9), without taking any position on the merge itself.

Export the WAI application

mcpApplication :: HttpConfig -> McpServerInfo -> McpServerHandlers -> Wai.Application is now exported from MCP.Server.Transport.Http and re-exported from MCP.Server — dpwiz's literal suggestion. The MCP endpoint can be mounted inside an existing WAI stack (own Warp settings, TLS, middleware, larger routers); httpPort/httpHost are documented as ignored when embedding, everything else (endpoint path check, Origin validation, bearer auth, subscriptions/listen streaming) applies unchanged. README gains an embedding section.

Conformance corpus

The golden wire fixtures are restructured from inline Haskell strings into an on-disk, self-describing corpus: each case under test/golden/ is a .request.json/.response.json pair, enumerated by manifest.json (which also records the reference-server variant and notification support per case), with the reference server fully documented in test/golden/README.md. Nothing in the corpus refers to Haskell — any MCP implementation reproducing the reference server can replay requests and diff responses, which is the neutral 'shared ground' the issue thread was circling.

The response fixtures are byte-for-byte unchangedgit mv renames only (the v0.2.0 legacy anchor is preserved). The GoldenWire runner is now manifest-driven (runIO + data files); GOLDEN_ACCEPT=1 semantics unchanged (create-only, responses only).

Verification

  • 151 test examples pass (same 24 golden cases, now read from disk)
  • cabal check clean; cabal sdist packs the full corpus (requests, responses, manifest, corpus README) via extra-source-files, so the suite still runs from the sdist
  • Version bumped to 0.2.1.0 (new exports = PVP minor); CHANGELOG entry added

🤖 Generated with Claude Code

…rpus

Two ideas from the dpella/mcp discussion (issue #9):

- mcpApplication is exported (and re-exported from MCP.Server) so the MCP
  endpoint can be embedded into an existing WAI stack instead of
  transportRunHttp running its own Warp server.
- The golden wire fixtures become a self-describing, API-agnostic
  conformance corpus: request/response pairs on disk enumerated by
  manifest.json, with the reference server documented in
  test/golden/README.md so other MCP implementations can consume it.
  Response fixtures are unchanged (renamed only); the runner is now
  manifest-driven.

Version 0.2.1.0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@drshade
drshade merged commit 6efd5d0 into main Aug 1, 2026
10 checks passed
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