[codex] Add MCP HTTP transport#10
Draft
hookdump wants to merge 13 commits into
Draft
Conversation
The Data API returns error bodies as plain text, but the client only read a JSON `message` field, so every validation/authorization failure showed as a generic "Churnkey API error <status>". Relay the server message verbatim and add clearer 403/404 fallbacks. Contract/doc alignment with the dashboard: - list_blueprints: document the new hasUnpublishedChanges flag and that status is a coarse subset of the dashboard badges (not a 1:1 mirror) - get_blueprint: document the step/offer/survey-choice guid response shape - list_segments: document audience filter rules, priority, enabled, and that A/B variant segments appear as separate entries - update_blueprint_draft: brandImage validation now mirrors the server (path ends in png/jpg/jpeg/gif/webp, or images.churnkey.co); reject empty-string step/choice guids instead of silently treating as absent - dsr_delete: document the deleted/reasonForRejection outcome - README: scope the live/test mode note (sessions + DSR only; config is shared and recoveries are not mode-partitioned); drop the phantom invoiceMonth breakdown from the changelog Tests: add client error-handling cases and brandImage validation cases; add scripts/smoke.mjs for end-to-end checks against a local churnkey-api. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
New tools so an agent can edit a flow without resending the whole steps array: - update_blueprint_offer: change an offer's type + functional config (discount/pause/trial/redirect/plan-change), addressable on an offer step, a survey choice, or a structured follow-up option via guids. - edit_survey_structure: add/remove/reorder survey choices and configure a choice's follow-up (freeform / structured / freeform-structured / none). - add_blueprint_step / remove_blueprint_step: add a step at a canonical place (server builds the base step) or remove one by stepGuid. - update_blueprint_step gained survey behavior (randomize, followupRequired, minLength) and freeform/confirm config. - set_segment_enabled and update_segment_filter for segment config. Draft blueprint edits are draft-only and not confirm-gated (publish is the live gate; destructive ones carry destructiveHint). Segment edits act on live config so they require a confirm literal. Adds routing/validation tests and an observed reversible write round-trip to scripts/smoke.mjs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9a67918 to
03da3d7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@churnkey/mcpwhile keeping stdio as the default/mcp, configurable host/port/path, host allow-listing, and opt-in CORSAuthorization: Bearerfor future hosted/OAuth-adjacent auth workmcp.churnkey.codocs/root and/mcpprotocol endpoint splitOAuth foundation
This does not implement OAuth yet. The HTTP request auth boundary is isolated in
loadHttpRequestConfig(), so the future OAuth task can swap bearer-token validation/resource metadata into that layer without changing MCP tool registration.Validation
pnpm exec biome check packages/mcp/src/config.ts packages/mcp/src/http.ts packages/mcp/src/bin.ts packages/mcp/src/index.ts packages/mcp/tests/config.test.tspnpm --filter @churnkey/mcp typecheckpnpm --filter @churnkey/mcp testpnpm --filter @churnkey/mcp buildhttp://127.0.0.1:3341/mcpand listed 19 toolspnpm typecheckandpnpm testpassed