Skip to content

Add agent discovery endpoints for MCP and API catalog - #39

Merged
mattt merged 5 commits into
mainfrom
mattt/agent-ready
Jun 1, 2026
Merged

Add agent discovery endpoints for MCP and API catalog#39
mattt merged 5 commits into
mainfrom
mattt/agent-ready

Conversation

@mattt

@mattt mattt commented Jun 1, 2026

Copy link
Copy Markdown
Member

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.ts so 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.

@mattt
mattt requested a review from Copilot June 1, 2026 12:12
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Updated (UTC)
✅ Deployment successful!
View logs
sembr-org 8b98740 Jun 01 2026, 12:09 PM

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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.ts and attaches RFC 8288 Link headers on the homepage.
  • Adds a WebMCP client script to expose read-only tools via navigator.modelContext, plus robots.txt “Content-Signal” hints and a /health endpoint.

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.

Comment thread src/lib/discovery.ts
@mattt
mattt merged commit 1e3cdea into main Jun 1, 2026
2 checks passed
@mattt
mattt deleted the mattt/agent-ready branch June 1, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants