Skip to content

feat(mcp): serve OpenAI's domain verification token from the hosted server (SHIP-745) - #97

Open
daniellle wants to merge 1 commit into
mainfrom
feature/ship-745-openai-domain-verification
Open

daniellle wants to merge 1 commit into
mainfrom
feature/ship-745-openai-domain-verification

Conversation

@daniellle

Copy link
Copy Markdown
Contributor

SHIP-745, part 2. OpenAI's plugin directory verifies a remote MCP server's domain: it issues a token in its portal and fetches it from https://<mcp host>/.well-known/openai-apps-challenge. That path is a 404 on mcp.shipyard.build today. Part 1, the ChatGPT OAuth client in core, is shipyardbuild/shipyard#4166.

Changes

  • hosted.Config.OpenAIDomainChallenge, from SHIPYARD_MCP_OPENAI_DOMAIN_CHALLENGE.
    • Set: GET /.well-known/openai-apps-challenge answers with exactly the token, as text/plain, with no bearer token needed.
    • Unset: the path stays a 404.
    • Other methods get a 405. The MCP endpoint still requires a token.
  • Validation: a token with a space, line break or control character is refused at startup. OpenAI compares the body exactly, so a pasted newline would otherwise fail verification without saying why.
  • Chart: mcp.openaiDomainChallenge (empty by default) sets the env var only when given.
  • make mcp-host.install.*: MCP_HOST_OPENAI_DOMAIN_CHALLENGE=<token>, checked to be one token. helm upgrade doesn't reuse values, so the docs say to pass it on every release after verification.
  • docs/mcp.md: a deploy step for it.

The token isn't a secret: OpenAI reads it from the public URL.

Testing

  • go test ./pkg/mcp/... ./commands/... passes. New tests:
    • TestOpenAIDomainChallenge: a 404 when unset; the exact body and text/plain when set; POST is refused; /mcp still returns 401; tokens with a space, newline, tab or NUL are refused
    • TestHostConfigFromEnvOpenAIDomainChallenge
  • scripts/chart-test.sh passes, with two new checks: no env var by default, and the token reaches the server when set.
  • The install target's token check accepts an empty value and refuses bad token and x;rm.

Rollout

Nothing changes until OpenAI issues the token, which needs the StackGen OpenAI organization (SHIP-745). Then: release with the token, and click Verify Domain in the portal.

🤖 Generated with Claude Code

…erver (SHIP-745)

OpenAI's plugin directory verifies a remote MCP server's domain by
fetching a token it issues from /.well-known/openai-apps-challenge.

- SHIPYARD_MCP_OPENAI_DOMAIN_CHALLENGE (chart: mcp.openaiDomainChallenge,
  install: MCP_HOST_OPENAI_DOMAIN_CHALLENGE). Set, the server answers GET
  on that path with exactly the token as plain text, without a bearer
  token; unset, the path is a 404.
- A token with a space, line break or control character is refused at
  startup, since OpenAI compares the body exactly.
- docs/mcp.md: the deploy step, and that every later release must pass
  the token too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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