mcp-use TypeScript API
    Preparing search index...

    Interface FromOpenAPIOptions

    Options for MCPServer.fromOpenAPI.

    interface FromOpenAPIOptions {
        auth?: OpenAPIAuth;
        baseUrl?: string;
        exclude?: OpenAPIExcludeRule[];
        fetch?: {
            (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
            (input: string | Request | URL, init?: RequestInit): Promise<Response>;
        };
        headers?: Record<string, string>;
        name?: string;
        spec: OpenAPIDocument;
        tags?: string[];
        version?: string;
    }
    Index

    Static bearer or custom-header authentication for upstream requests.

    baseUrl?: string

    Upstream base URL, overriding the first spec.servers entry.

    exclude?: OpenAPIExcludeRule[]

    Rules for excluding operations after tag filtering.

    fetch?: {
        (input: URL | RequestInfo, init?: RequestInit): Promise<Response>;
        (input: string | Request | URL, init?: RequestInit): Promise<Response>;
    }

    Fetch implementation used for upstream calls. Defaults to globalThis.fetch.

    Type Declaration

      • (input: URL | RequestInfo, init?: RequestInit): Promise<Response>
      • Parameters

        • input: URL | RequestInfo
        • Optionalinit: RequestInit

        Returns Promise<Response>

      • (input: string | Request | URL, init?: RequestInit): Promise<Response>
      • Parameters

        • input: string | Request | URL
        • Optionalinit: RequestInit

        Returns Promise<Response>

    headers?: Record<string, string>

    Static headers merged into every upstream request.

    name?: string

    MCP server name, overriding spec.info.title.

    Parsed, bundled OpenAPI document.

    tags?: string[]

    Include only operations having at least one of these tags.

    version?: string

    MCP server version, overriding spec.info.version and the "1.0.0" fallback.