ampless 1.0.0-beta.61 → 1.0.0-beta.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +18 -0
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -1669,6 +1669,24 @@ interface AiConfig {
|
|
|
1669
1669
|
* abuse protection.
|
|
1670
1670
|
*/
|
|
1671
1671
|
publicMcp?: boolean;
|
|
1672
|
+
/**
|
|
1673
|
+
* **Experimental.** Publish MCP discovery metadata so AI clients can
|
|
1674
|
+
* find the public endpoint without being handed its URL: a well-known
|
|
1675
|
+
* catalog at `/.well-known/mcp/catalog.json` and a Server Card at
|
|
1676
|
+
* `/api/mcp/server-card`. Requires `publicMcp: true` (discovery only
|
|
1677
|
+
* advertises the same `/api/mcp` endpoint) and an `http(s)` `site.url`
|
|
1678
|
+
* to resolve the absolute URLs it advertises — when either is missing
|
|
1679
|
+
* the discovery routes 404.
|
|
1680
|
+
*
|
|
1681
|
+
* **Default: false.** This tracks the prototype
|
|
1682
|
+
* `modelcontextprotocol/experimental-ext-server-card` spec (SEP-2127 —
|
|
1683
|
+
* still open / unmerged), whose schema and paths may change to follow
|
|
1684
|
+
* upstream, so it is isolated behind this opt-in flag. When enabled,
|
|
1685
|
+
* the `/api/mcp` `initialize` response's `serverInfo` also switches to
|
|
1686
|
+
* a site-derived reverse-DNS name + version so it matches the Server
|
|
1687
|
+
* Card (default OFF sites keep the static `ampless-mcp` serverInfo).
|
|
1688
|
+
*/
|
|
1689
|
+
mcpDiscovery?: boolean;
|
|
1672
1690
|
}
|
|
1673
1691
|
type Role = 'reader' | 'editor' | 'admin';
|
|
1674
1692
|
interface AuthContext {
|
package/dist/index.js
CHANGED
|
@@ -251,7 +251,7 @@ function resolvePublicMcpEndpoint(publicMcp, siteUrl) {
|
|
|
251
251
|
try {
|
|
252
252
|
const parsed = new URL(siteUrl);
|
|
253
253
|
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") return null;
|
|
254
|
-
return new URL("/api/mcp", parsed).toString();
|
|
254
|
+
return new URL("/api/mcp", parsed.origin).toString();
|
|
255
255
|
} catch {
|
|
256
256
|
return null;
|
|
257
257
|
}
|