@rsc-kit/mcp
Version:
An MCP server over what an rsc-kit build decided: the routes, why each one is static or not, and what it costs the browser.
42 lines (41 loc) • 2.11 kB
TypeScript
import type { BuildReport } from "./report.js";
/**
* Every answer says how old it is.
*
* The one way this server misleads is by being confidently stale: it reports
* the last build, and the file on disk may have changed since. Saying so on
* every answer is cheaper than being wrong once.
*/
export declare function asOf(builtAt: Date, now: number): string;
export declare function listRoutes(report: BuildReport, builtAt: Date, now: number): string;
export declare function explainRoute(report: BuildReport, url: string, builtAt: Date, now: number): string;
/**
* The routes that are not stored, and why.
*
* The question behind most of the others — someone asking "why is my site
* slow" wants this list, not the whole table. Routes that are fine are left
* out entirely rather than listed and dismissed.
*/
export declare function whatIsDynamic(report: BuildReport, builtAt: Date, now: number): string;
/** The heaviest routes, for the question that follows the size column. */
export declare function heaviestRoutes(report: BuildReport, builtAt: Date, now: number, top?: number): string;
/**
* The actions, and the one fact about each that nothing else states: whether
* anything checks who calls it. A bare "use server" export runs with no
* middleware; an agent adding a delete button needs to know that before it
* trusts the id it was handed.
*/
/**
* Server files still importing cache from React. React's dedupes only inside
* a component render; in a guard, an action or an api route it calls straight
* through, silently - the helper runs twice and nothing says so but this.
*/
export declare function reactCacheLines(report: BuildReport): string[];
/**
* Server files importing a client library. Legal for a server component; a
* file with no "use client" that only wraps client components (a shadcn ui/
* file that lost its directive) wants the directive back, so the library's
* internals stop running on the server.
*/
export declare function clientImportLines(report: BuildReport): string[];
export declare function actionLines(report: BuildReport): string[];