[codex] Add MCP server card discovery endpoint#137
Conversation
Deploying qf-api-docs with
|
| 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 |
There was a problem hiding this comment.
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 aLinkheader 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
_headersblocks.
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.
There was a problem hiding this comment.
💡 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" |
There was a problem hiding this comment.
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 👍 / 👎.
What changed
/.well-known/mcp/server-card.jsonWhy
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