Skip to content

[codex] Add MCP server card discovery endpoint#137

Merged
basit3407 merged 2 commits intomainfrom
codex/add-mcp-server-card
Apr 21, 2026
Merged

[codex] Add MCP server card discovery endpoint#137
basit3407 merged 2 commits intomainfrom
codex/add-mcp-server-card

Conversation

@basit3407
Copy link
Copy Markdown
Collaborator

What changed

  • publish an MCP Server Card at /.well-known/mcp/server-card.json
  • advertise the discovery document from the homepage response headers
  • add Cloudflare Pages CORS and cache headers for the discovery route
  • add test coverage for the card payload, curated onboarding resources, and discovery headers

Why

The docs host did not expose an MCP Server Card, so agent discovery checks could not find pre-connection metadata for the server.

Impact

Agents can now discover the docs host through a standard MCP Server Card and find the key machine-readable API and onboarding resources without crawling the full docs tree.

Validation

  • C:\Users\Basit\.cache\codex-runtimes\codex-primary-runtime\dependencies\node\bin\node.exe --test tests\api-demo-panel-ui.test.cjs tests\mcp-server-card.test.cjs tests\oauth-discovery-routes.test.cjs tests\prelive-docs-config.test.cjs tests\user-related-env-paths.test.cjs tests\user-related-env-ui.test.cjs
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 21, 2026

Deploying qf-api-docs with  Cloudflare Pages  Cloudflare Pages

Latest commit: f733d77
Status: ✅  Deploy successful!
Preview URL: https://272e2c63.qf-api-docs.pages.dev
Branch Preview URL: https://codex-add-mcp-server-card.qf-api-docs.pages.dev

View logs

@basit3407 basit3407 marked this pull request as ready for review April 21, 2026 06:03
@basit3407 basit3407 requested a review from Copilot April 21, 2026 06:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds MCP Server Card discovery support to the docs host so agents can fetch pre-connection metadata via a standard well-known URL and discover it from the homepage response headers.

Changes:

  • Publish an MCP Server Card at /.well-known/mcp/server-card.json.
  • Advertise the MCP Server Card from / via a Link header and configure Cloudflare Pages headers (CORS + caching) for the well-known route.
  • Add node:test coverage validating the card payload, curated onboarding resources, and the relevant _headers blocks.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
tests/mcp-server-card.test.cjs Adds regression tests for MCP server card content and Cloudflare Pages header configuration.
static/_headers Advertises the MCP server card via homepage Link header; adds CORS + cache headers for the server card route.
static/.well-known/mcp/server-card.json Adds the published MCP Server Card JSON document with API + onboarding resource entries.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@basit3407 basit3407 merged commit 9a109ab into main Apr 21, 2026
5 checks passed
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: f733d7711e

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

"documentationUrl": "https://api-docs.quran.foundation/",
"transport": {
"type": "streamable-http",
"endpoint": "/mcp"
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Point transport endpoint to a reachable MCP route

The server card now publishes transport.endpoint as /mcp, but this project does not define a Pages Function or static route for /mcp (the only function file is functions/_middleware.js), so clients that discover the card and try to connect will hit a non-existent endpoint instead of an MCP server. That makes the new discovery metadata functionally broken unless this path is actually served or replaced with the real MCP service URL.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants