A one-of-a-kind resume builder that keeps your privacy in mind. Completely secure, customizable, portable, open-source and free forever. Try it out today!
TypeScript agent-skillsaidsh-pluginhacktoberfestjavascriptmcp-serverreactresume-builderself-hostedtypescript
fix(server): publish an agent resource catalog and 404 unknown well-known paths
Amruth Pillai8bfba484642c
diff --git a/apps/server/src/http/app.test.ts b/apps/server/src/http/app.test.tsindex 4f41950bd..4cf7bdfcd 100644--- a/apps/server/src/http/app.test.ts+++ b/apps/server/src/http/app.test.ts@@ -20,6 +20,7 @@ const mocks = vi.hoisted(() => ({handleOAuthProtectedResource: vi.fn(),handleOpenIdConfiguration: vi.fn(),handleWellKnownFallback: vi.fn(),+ handleAgentCatalog: vi.fn(),handleRobots: vi.fn(),handleSitemap: vi.fn(),handleLlms: vi.fn(),@@ -58,6 +59,7 @@ vi.mock("../openapi/metadata", () => ({handleOAuthProtectedResource: mocks.handleOAuthProtectedResource,handleOpenIdConfiguration: mocks.handleOpenIdConfiguration,handleWellKnownFallback: mocks.handleWellKnownFallback,+ handleAgentCatalog: mocks.handleAgentCatalog,}));vi.mock("../static/uploads", () => ({@@ -114,6 +116,7 @@ beforeEach(() => {mocks.handleOAuthProtectedResource.mockReturnValue(new Response("oauth-protected-resource"));mocks.handleOpenIdConfiguration.mockReturnValue(new Response("openid-configuration"));mocks.handleWellKnownFallback.mockReturnValue(new Response("well-known"));+ mocks.handleAgentCatalog.mockImplementation(() => new Response("agent-catalog"));mocks.handleRobots.mockReturnValue(new Response("robots"));mocks.handleSitemap.mockReturnValue(new Response("sitemap"));mocks.handleLlms.mockReturnValue(new Response("llms"));@@ -214,6 +217,8 @@ describe("createApp", () => {["/.well-known/integrations.json", "integrations"],["/.well-known/api-catalog", "api-catalog"],["/.well-known/mcp/server-card.json", "server-card"],+ ["/.well-known/ard.json", "agent-catalog"],+ ["/.well-known/ai-catalog.json", "agent-catalog"],])("routes discovery document %s before the well-known fallback", async (path, body) => {const { createApp } = await import("./app");diff --git a/apps/server/src/http/app.ts b/apps/server/src/http/app.tsindex 3007cc705..3524e72bd 100644--- a/apps/server/src/http/app.ts+++ b/apps/server/src/http/app.ts@@ -12,6 +12,7 @@ import { prepareMcpDiscovery } from "@reactive-resume/mcp";import { handleMcp } from "../mcp/handler";import { handleOpenApi, handleOpenApiDocument } from "../openapi/handler";import {+ handleAgentCatalog,handleApiCatalog,handleIntegrations,handleMcpServerCard,@@ -148,6 +149,7 @@ export function createApp(options: AppOptions = {}) {app.get("/.well-known/agent-skills/index.json", () => handleAgentSkillsIndex());app.get("/.well-known/agent-skills/:filename", (c) => handleAgentSkillArchive(c.req.param("filename")));app.get("/.well-known/mcp/server-card.json", () => handleMcpServerCard());+ app.on("GET", ["/.well-known/ard.json", "/.well-known/ai-catalog.json"], () => handleAgentCatalog());app.get("/.well-known/oauth-authorization-server/*", (c) => handleOAuthAuthorizationServer(c.req.raw));app.get("/.well-known/openid-configuration", (c) => handleOpenIdConfiguration(c.req.raw));app.get("/.well-known/oauth-protected-resource/*", () => handleOAuthProtectedResource());diff --git a/apps/server/src/openapi/metadata.test.ts b/apps/server/src/openapi/metadata.test.tsindex 4306b44df..89a11b947 100644--- a/apps/server/src/openapi/metadata.test.ts+++ b/apps/server/src/openapi/metadata.test.ts@@ -95,3 +95,27 @@ describe("handleApiCatalog", () => {expect(catalog.linkset[0]["service-desc"][0].href).toBe("https://rxresu.me/openapi.json");});});++describe("handleAgentCatalog", () => {+ it("serves an Agentic Resource Discovery catalog that points agents at the MCP server card", async () => {+ const { handleAgentCatalog } = await import("./metadata");++ const response = handleAgentCatalog();+ const catalog = await response.json();++ // The earlier ai-catalog format Lighthouse validates: a closed root, a domain-anchored URN, and exactly one of+ // `url` or `data`. Two to five representative queries keep the entry free of conformance warnings.+ expect(Object.keys(catalog).toSorted()).toEqual(["entries", "host", "specVersion"]);+ expect(catalog.specVersion).toBe("1.0");+ expect(catalog.entries).toHaveLength(1);+ const [entry] = catalog.entries;+ expect(entry).toMatchObject({+ identifier: "urn:air:rxresu.me:mcp:reactive-resume",+ type: "application/mcp-server-card+json",+ url: "https://rxresu.me/.well-known/mcp/server-card.json",+ });+ expect(entry).not.toHaveProperty("data");+ expect(entry.representativeQueries.length).toBeGreaterThanOrEqual(2);+ expect(entry.representativeQueries.length).toBeLessThanOrEqual(5);+ });+});diff --git a/apps/server/src/openapi/metadata.ts b/apps/server/src/openapi/metadata.tsindex 1bc5497f6..8248c3d70 100644--- a/apps/server/src/openapi/metadata.ts+++ b/apps/server/src/openapi/metadata.ts@@ -24,8 +24,43 @@ export function handleOpenAiAppsChallenge() {});}+/** Nothing else is published under /.well-known, and a 404 says so; a 200 body would be parsed as the document asked for. */export function handleWellKnownFallback() {- return new Response("OK", { status: 200 });+ return new Response("Not Found", { status: 404, headers: { "Content-Type": "text/plain; charset=utf-8" } });+}++/**+ * Agentic Resource Discovery catalog (https://agenticresourcediscovery.org/spec/), so agent registries can find the MCP+ * server by what it does. Served at /.well-known/ard.json and at the spec's earlier path, /.well-known/ai-catalog.json,+ * which Lighthouse's agentic browsing audit reads; `specVersion` and `host` belong to that earlier format.+ */+export function handleAgentCatalog() {+ const baseUrl = appUrl();+ const catalog = {+ specVersion: "1.0",+ host: { displayName: "Reactive Resume", documentationUrl: DOCS_URL, logoUrl: `${baseUrl}/pwa-512x512.png` },+ entries: [+ {+ identifier: `urn:air:${new URL(baseUrl).hostname}:mcp:reactive-resume`,+ displayName: "Reactive Resume MCP server",+ type: "application/mcp-server-card+json",+ url: `${baseUrl}/.well-known/mcp/server-card.json`,+ description:+ "Reads and edits the user's resumes, cover letters and job applications in Reactive Resume, a free and open-source resume builder.",+ tags: ["resume", "cover letter", "job applications", "careers"],+ representativeQueries: [+ "update my resume with my new job",+ "tailor my resume to this job description",+ "write a cover letter for this application",+ "track the jobs I have applied to",+ ],+ },+ ],+ };++ return Response.json(catalog, {+ headers: { "Content-Type": "application/json", "Cache-Control": "public, max-age=3600" },+ });}export function handleMcpServerCard() {diff --git a/docs/guides/using-the-mcp-server.mdx b/docs/guides/using-the-mcp-server.mdxindex c02e48353..4e80b2d82 100644--- a/docs/guides/using-the-mcp-server.mdx+++ b/docs/guides/using-the-mcp-server.mdx@@ -292,7 +292,7 @@ Prompts are ready-made instructions your client can start from. Each takes a res| `resume://_meta/schema` | The resume data JSON Schema, listed in `resources/list` and also served at `/schema.json`. Clients use it to build valid patches; tool schemas point to it instead of repeating it, for resume data and for a cover letter's style. Tool results also summarize application timeline entries, posting sources and the account export; their full shapes are in `/api/openapi/spec.json`. || `resume://{id}` | One resume's full data as JSON. This is a resource template (`resources/templates/list`); find IDs with `list_resumes`. |-Your instance also publishes a server card at `/.well-known/mcp/server-card.json` that summarizes the tools, prompts and resources, for clients that discover servers without connecting.+Your instance also publishes a server card at `/.well-known/mcp/server-card.json` that summarizes the tools, prompts and resources, for clients that discover servers without connecting. An [Agentic Resource Discovery](https://agenticresourcediscovery.org/spec/) catalog at `/.well-known/ard.json` (also served at the older `/.well-known/ai-catalog.json`) points agent registries to that card.## How authentication works