Files
ipal-kit/dist/modules/mcp/createMcpRoute.d.ts
T

37 lines
1.4 KiB
TypeScript

import type { BasePayload } from 'payload';
import type { ContentOption } from '../content/index.js';
import type { I18nConfig } from '../i18n/index.js';
type CreateMcpRouteArgs = {
/** Absolute origin for building result URLs. */
baseUrl?: string;
/** Pages collection. Default 'pages'. */
collection?: string;
config: I18nConfig;
/** Archive-backed collections (same as the plugin option) for get_page. */
content?: ContentOption;
getCachedPayload: () => Promise<BasePayload>;
/** Max messages in one JSON-RPC batch. Default 10. */
maxBatch?: number;
/**
* Per-IP limit on JSON-RPC messages (a batch counts every message) (in memory, per instance). Default { max: 60, windowMs: 60_000 }.
* `false` = off (a limiter in front, e.g. Cloudflare WAF rate limiting).
*/
rateLimit?: {
max?: number;
windowMs?: number;
} | false;
/** Server name advertised in `initialize`. Default 'ipal-site'. */
serverName?: string;
/** Server version advertised in `initialize`. Default '1.0.0'. */
serverVersion?: string;
/** SiteSettings slug. Default 'site-settings'. */
settingsSlug?: string;
/** Field holding a richer AI summary (buildSummaryField) to prefer in search results. */
summaryField?: string;
};
export declare function createMcpRoute(args: CreateMcpRouteArgs): {
GET: () => Promise<Response>;
POST: (req: Request) => Promise<Response>;
};
export {};