Add agent discovery endpoints for MCP and API catalog - #39
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
sembr-org | 8b98740 | Jun 01 2026, 12:09 PM |
There was a problem hiding this comment.
Pull request overview
This PR adds machine-readable discovery metadata to sembr.org so agents and agent-capable browsers can programmatically find the site’s API surfaces (API catalog, OpenAPI, MCP server card) and related resources.
Changes:
- Adds well-known discovery endpoints for an API catalog (
/.well-known/api-catalog), OpenAPI (/.well-known/openapi.json), and MCP server card (/.well-known/mcp/server-card.json). - Centralizes discovery metadata generation in
src/lib/discovery.tsand attaches RFC 8288Linkheaders on the homepage. - Adds a WebMCP client script to expose read-only tools via
navigator.modelContext, plus robots.txt “Content-Signal” hints and a/healthendpoint.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/wellknown/openapi.ts | Serves the generated OpenAPI document at /.well-known/openapi.json. |
| src/wellknown/mcp-server-card.ts | Serves the generated MCP server card JSON (with CORS) at /.well-known/mcp/server-card.json. |
| src/wellknown/api-catalog.ts | Serves the generated RFC 9727 linkset JSON at /.well-known/api-catalog. |
| src/scripts/webmcp.ts | Registers WebMCP tools in compatible browsers to fetch spec and agent skills documents. |
| src/pages/index.astro | Adds RFC 8288 Link headers to both the HTML and Markdown variants of the homepage. |
| src/pages/health.ts | Adds a simple prerendered JSON health endpoint at /health. |
| src/lib/discovery.ts | Centralizes discovery paths and generates Link header, API catalog linkset, OpenAPI document, and MCP server card. |
| src/layouts/Layout.astro | Includes the WebMCP script on rendered pages. |
| public/robots.txt | Adds a Content-Signal directive alongside the sitemap reference. |
| astro.config.mjs | Injects the new well-known routes into Astro’s routing via the existing integration. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
This PR makes sembr.org easier for agents to discover programmatically. It adds RFC 8288 Link headers on the homepage, Content Signals in robots.txt, an RFC 9727 API catalog at
/.well-known/api-catalog, an OpenAPI spec at/.well-known/openapi.json, and an MCP Server Card at/.well-known/mcp/server-card.json.Discovery metadata is centralized in
src/lib/discovery.tsso Link headers, the API catalog, OpenAPI document, and server card stay in sync. WebMCP tools on the homepage expose the specification and published agent skills to browsers that support navigator.modelContext.