@suluk/mcp - v0.1.2
    Preparing search index...

    Interface McpOptions

    @suluk/mcp — project ONE OpenAPI v4 document into a Model Context Protocol server. The same contract that drives the API, SDK, docs, admin, and panel now drives an agent-callable surface: every operation becomes an MCP tool (read-only by default; mutations opt-in via include:"all"), served over the Streamable-HTTP JSON-RPC transport as a Hono-mountable app. No hand-written tool schemas, no config drift — the contract is the single source. Pure projection (toolsFrom) + pure protocol (handleRpc) are independently testable; mcpApp wires transport. CANDIDATE tooling — NOT official OAS.

    interface McpOptions {
        document:
            | OpenAPIv4Document
            | ((c: Context) => OpenAPIv4Document | Promise<OpenAPIv4Document>);
        basePath?: string;
        name?: string;
        version?: string;
        instructions?: string;
        authorize?: (c: Context) => boolean | Promise<boolean>;
        exec?: (
            c: Context,
            op: McpOp,
            args: Record<string, unknown>,
        ) => Promise<unknown>;
        cors?: boolean;
        resident?:
            | string[]
            | ((c: Context) => string[] | Promise<string[] | undefined> | undefined);
        include?: "read" | "all";
        hide?: string[];
        only?: string[];
        includeDeprecated?: boolean;
    }

    Hierarchy (View Summary)

    Index

    Properties

    document:
        | OpenAPIv4Document
        | ((c: Context) => OpenAPIv4Document | Promise<OpenAPIv4Document>)

    The v4 document — a value, or a per-request function (e.g. return projectDocument(doc, roleOf(c))).

    basePath?: string
    name?: string

    Advertised server identity.

    version?: string
    instructions?: string

    Free-text guidance surfaced to the model on initialize.

    authorize?: (c: Context) => boolean | Promise<boolean>

    Gate the whole endpoint — return true to allow. Default: open (read-only catalog browsing).

    exec?: (
        c: Context,
        op: McpOp,
        args: Record<string, unknown>,
    ) => Promise<unknown>

    Override how a tool call is executed (default: same-origin fetch via originExec).

    cors?: boolean

    Send permissive CORS so browser-based MCP clients can reach a public read-only server (default: true).

    resident?:
        | string[]
        | ((c: Context) => string[] | Promise<string[] | undefined> | undefined)

    TIER-TRIM serving (C027): the names of the RESIDENT tools (a value or a per-request resolver). When provided, tools/list serves only these + a discover_tools meta-tool, withholding the cold-tail from the default surface (revealed on demand) — the real, lossless context reduction the agent layer promises. Derive these from an agent's route tiers, e.g. @suluk/agents residentToolNames(doc, agentName). Absent ⇒ the full surface is served.

    include?: "read" | "all"

    "read" (default) exposes only GET/HEAD operations; "all" also exposes mutations.

    hide?: string[]

    Operation names to omit.

    only?: string[]

    If set, expose ONLY these operation names (after hide).

    includeDeprecated?: boolean

    Include deprecated operations (default: skip them).