-
Notifications
You must be signed in to change notification settings - Fork 1
Add agent discovery endpoints for MCP and API catalog #39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
456e5c6
Add well-known api-catalog, OpenAPI spec, and MCP server card
mattt 0f955e9
Add Link response headers to homepage
mattt c83d047
Declare Content Signals in robots.txt
mattt cf05ca9
Expose WebMCP tools on page load
mattt 8b98740
Fix WebMCP script TypeScript module augmentation
mattt File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| User-agent: * | ||
| Allow: / | ||
| Content-Signal: ai-train=no, search=yes, ai-input=no | ||
|
|
||
| Sitemap: https://sembr.org/sitemap-index.xml |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -92,5 +92,6 @@ const structuredData = { | |
| <main> | ||
| <slot /> | ||
| </main> | ||
| <script src="../scripts/webmcp.ts"></script> | ||
| </body> | ||
| </html> | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,222 @@ | ||
| export const SITE_ORIGIN = 'https://sembr.org'; | ||
|
|
||
| export const DISCOVERY_PATHS = { | ||
| apiCatalog: '/.well-known/api-catalog', | ||
| openApi: '/.well-known/openapi.json', | ||
| mcpServerCard: '/.well-known/mcp/server-card.json', | ||
| agentSkillsIndex: '/.well-known/agent-skills/index.json', | ||
| llmsTxt: '/llms.txt', | ||
| health: '/health', | ||
| sitemap: '/sitemap-index.xml', | ||
| } as const; | ||
|
|
||
| export function discoveryLinkHeader(): string { | ||
| return [ | ||
| `</${DISCOVERY_PATHS.sitemap.slice(1)}>; rel="sitemap"`, | ||
| `</${DISCOVERY_PATHS.apiCatalog.slice(1)}>; rel="api-catalog"`, | ||
| `</${DISCOVERY_PATHS.openApi.slice(1)}>; rel="service-desc"; type="application/vnd.oai.openapi+json"`, | ||
| `</${DISCOVERY_PATHS.llmsTxt.slice(1)}>; rel="describedby"; type="text/markdown"`, | ||
| `</${DISCOVERY_PATHS.mcpServerCard.slice(1)}>; rel="describedby"; type="application/json"`, | ||
| ].join(', '); | ||
| } | ||
|
|
||
| export function apiCatalogLinkset() { | ||
| const origin = SITE_ORIGIN; | ||
|
|
||
| return { | ||
| linkset: [ | ||
| { | ||
| anchor: `${origin}/`, | ||
| 'service-desc': [ | ||
| { | ||
| href: `${origin}${DISCOVERY_PATHS.openApi}`, | ||
| type: 'application/vnd.oai.openapi+json', | ||
| }, | ||
| ], | ||
| 'service-doc': [ | ||
| { | ||
| href: `${origin}${DISCOVERY_PATHS.llmsTxt}`, | ||
| type: 'text/markdown', | ||
| }, | ||
| { | ||
| href: `${origin}/`, | ||
| type: 'text/html', | ||
| }, | ||
| ], | ||
| status: [ | ||
| { | ||
| href: `${origin}${DISCOVERY_PATHS.health}`, | ||
| type: 'application/json', | ||
| }, | ||
| ], | ||
| }, | ||
| { | ||
| anchor: `${origin}/.well-known/agent-skills/`, | ||
| 'service-desc': [ | ||
| { | ||
| href: `${origin}${DISCOVERY_PATHS.openApi}#/paths/~1.well-known~1agent-skills~1index.json/get`, | ||
| type: 'application/vnd.oai.openapi+json', | ||
| }, | ||
| ], | ||
| 'service-doc': [ | ||
| { | ||
| href: `${origin}${DISCOVERY_PATHS.agentSkillsIndex}`, | ||
| type: 'application/json', | ||
| }, | ||
| ], | ||
| status: [ | ||
| { | ||
| href: `${origin}${DISCOVERY_PATHS.health}`, | ||
| type: 'application/json', | ||
| }, | ||
| ], | ||
| }, | ||
| ], | ||
| }; | ||
| } | ||
|
|
||
| export function openApiDocument() { | ||
| const origin = SITE_ORIGIN; | ||
|
|
||
| return { | ||
| openapi: '3.1.0', | ||
| info: { | ||
| title: 'SemBr.org Content API', | ||
| version: '1.0.0', | ||
| description: | ||
| 'Machine-readable access to the Semantic Line Breaks specification and published agent skills.', | ||
| }, | ||
| servers: [{ url: origin }], | ||
| paths: { | ||
| '/': { | ||
| get: { | ||
| summary: 'SemBr specification', | ||
| description: | ||
| 'Returns the SemBr specification. Use Accept: text/markdown for the source document or Accept: text/html for the rendered page.', | ||
| parameters: [ | ||
| { | ||
| name: 'Accept', | ||
| in: 'header', | ||
| schema: { | ||
| type: 'string', | ||
| enum: ['text/markdown', 'text/html'], | ||
| }, | ||
| }, | ||
| ], | ||
| responses: { | ||
| '200': { | ||
| description: 'SemBr specification document', | ||
| content: { | ||
| 'text/markdown': {}, | ||
| 'text/html': {}, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| '/llms.txt': { | ||
| get: { | ||
| summary: 'SemBr specification (llms.txt)', | ||
| description: 'Returns the SemBr specification as Markdown.', | ||
| responses: { | ||
| '200': { | ||
| description: 'SemBr specification', | ||
| content: { | ||
| 'text/markdown': {}, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| '/.well-known/agent-skills/index.json': { | ||
| get: { | ||
| summary: 'Agent skills index', | ||
| description: 'Lists SemBr agent skills available for discovery.', | ||
| responses: { | ||
| '200': { | ||
| description: 'Agent skills discovery document', | ||
| content: { | ||
| 'application/json': {}, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| '/.well-known/agent-skills/{name}/SKILL.md': { | ||
| get: { | ||
| summary: 'Agent skill document', | ||
| parameters: [ | ||
| { | ||
| name: 'name', | ||
| in: 'path', | ||
| required: true, | ||
| schema: { type: 'string' }, | ||
| }, | ||
| ], | ||
| responses: { | ||
| '200': { | ||
| description: 'Agent skill Markdown document', | ||
| content: { | ||
| 'text/markdown': {}, | ||
| }, | ||
| }, | ||
| '404': { | ||
| description: 'Skill not found', | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| '/health': { | ||
| get: { | ||
| summary: 'Service health', | ||
| responses: { | ||
| '200': { | ||
| description: 'Health status', | ||
| content: { | ||
| 'application/json': {}, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }, | ||
| }; | ||
| } | ||
|
|
||
| export function mcpServerCard() { | ||
| return { | ||
| protocolVersion: '2025-11-25', | ||
| serverInfo: { | ||
| name: 'sembr.org', | ||
| version: '0.0.1', | ||
| description: | ||
| 'Semantic Line Breaks specification, llms.txt, and published agent skills exposed via WebMCP on the homepage.', | ||
| }, | ||
| transport: { | ||
| type: 'webmcp', | ||
| endpoint: `${SITE_ORIGIN}/`, | ||
| }, | ||
| capabilities: { | ||
| tools: true, | ||
| resources: false, | ||
| prompts: false, | ||
| }, | ||
| authentication: { | ||
| required: false, | ||
| }, | ||
| tools: [ | ||
| { | ||
| name: 'get_specification', | ||
| description: 'Fetch the SemBr specification as Markdown from /llms.txt.', | ||
| }, | ||
| { | ||
| name: 'list_agent_skills', | ||
| description: 'List published SemBr agent skills from the well-known index.', | ||
| }, | ||
| { | ||
| name: 'get_agent_skill', | ||
| description: 'Fetch a specific SemBr agent skill by name.', | ||
| }, | ||
| ], | ||
| }; | ||
| } | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| import type { APIRoute } from 'astro'; | ||
|
|
||
| export const prerender = true; | ||
|
|
||
| export const GET: APIRoute = () => | ||
| new Response(JSON.stringify({ status: 'ok' }) + '\n', { | ||
| headers: { | ||
| 'Content-Type': 'application/json; charset=utf-8', | ||
| 'Cache-Control': 'no-cache', | ||
| }, | ||
| }); |
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
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.