/** * The SUPPLIER MCP server — how a supplier's own AI assistant answers one * TracePass data request. * * A TracePass customer asks a supplier for product data (a component's CAS * numbers, a certificate, a recycled-content figure). The supplier gets an * email with a link. Instead of filling the web form, they can connect their * assistant to `https://ai.tracepass.eu/supplier/mcp/`, and the * assistant reads what is asked, finds the answers in the supplier's own * documents, and submits them with evidence. * * A separate server from `createMcpServer`, on purpose: * - Different principal. The credential is the request's own token, which * authorises ONE request, not a TracePass account. There is no OAuth: a * supplier has no account to log in to. * - Different surface. Five small tools, none of the customer tools, and it * is not part of the `eu.tracepass/tracepass` registry listing. * * It follows the same rule as the main server: tools call the platform over * HTTP (`/api/supplier/v1/*`), which owns filtering, merging, review and rate * limits. Nothing here decides what a supplier may write. */ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { z } from "zod"; import { TracePassClient } from "./api-client.js"; import { type ToolResult } from "./result.js"; import type { ToolAnnotations } from "./tools.js"; export declare const SUPPLIER_SERVER_INFO: { readonly name: "tracepass-supplier"; readonly version: "1.19.1"; }; export interface CreateSupplierMcpServerConfig { baseUrl: string; /** The platform's PUBLIC origin, for commands the supplier's own machine * runs (get_upload_command). `baseUrl` is internal when hosted. */ publicBaseUrl?: string; /** The supplier request token, from the connection URL or the Bearer header. * Empty when the client connected without one: discovery still works, and * every tool explains how to connect. */ token: string; } /** * Match a supplier MCP path. Returns the token from the path ("" when it must * come from the header), or null when the path is not a supplier path. */ export declare function matchSupplierPath(pathname: string): { pathToken: string; } | null; /** * Supplier-facing wording for the platform's answers. The customer server's * `apiResult` talks about API keys and plans; a supplier has neither. */ export declare function supplierResult(res: { status: number; ok: boolean; body: unknown; }): ToolResult; interface SupplierTool { name: string; title: string; description: string; inputSchema: z.ZodRawShape; annotations: ToolAnnotations; handler: (args: Record) => Promise; } export declare function buildSupplierTools(client: TracePassClient, hasToken: boolean, upload?: { token: string; publicBaseUrl: string; }): SupplierTool[]; /** Build the supplier `McpServer`. The caller connects it to a transport. */ export declare function createSupplierMcpServer(config: CreateSupplierMcpServerConfig): McpServer; export {}; //# sourceMappingURL=supplier-server.d.ts.map