@node-in-layers/mcp-server
    Preparing search index...

    Interface McpServerConfig

    Top-level configuration for the @node-in-layers/mcp-server package. Placed under the McpNamespace key inside the system config.

    const config: McpServerConfig = {
    [McpNamespace]: {
    version: '1.0.0',
    stateful: false,
    server: {
    connection: { type: 'http', url: 'http://localhost:3000' },
    },
    },
    }
    interface McpServerConfig {
        "@node-in-layers/mcp-server": {
            hiddenPaths?: string[];
            hideComponents?: {
                allModels?: boolean;
                domains?: string[];
                paths?: readonly string[];
            };
            logging?: {
                requestLogGetData?: (req: Request) => Record<string, any>;
                requestLogLevel?: LogLevelNames;
                responseLogGetData?: (req: Request) => Record<string, any>;
                responseLogLevel?: LogLevelNames;
            };
            server: {
                connection: | Without<
                    Readonly<{ type: "cli" }>,
                    Readonly<
                        {
                            headers?: Readonly<Record<string, string>>;
                            retry?: Readonly<{ attempts: number; backoff: number }>;
                            timeout?: number;
                            type: "http";
                            url: string;
                        },
                    >,
                > & Readonly<
                    {
                        headers?: Readonly<Record<string, string>>;
                        retry?: Readonly<{ attempts: number; backoff: number }>;
                        timeout?: number;
                        type: "http";
                        url: string;
                    },
                >
                | Without<
                    Readonly<
                        {
                            headers?: Readonly<Record<string, string>>;
                            retry?: Readonly<{ attempts: number; backoff: number }>;
                            timeout?: number;
                            type: "http";
                            url: string;
                        },
                    >,
                    Readonly<{ type: "cli" }>,
                > & Readonly<{ type: "cli" }>;
            };
            startHere?: {
                description?: string;
                examplesOfUse?: readonly Readonly<
                    {
                        description?: string;
                        details?: string;
                        example?: string;
                        name: string;
                        tags?: string[];
                        value?: string;
                    },
                >[];
                hideDefaultSystemEntries?: boolean;
                includeDomains?: boolean;
                includeFeatures?: boolean;
                name?: string;
            };
            stateful?: boolean;
            systemDescription?: { description?: string; version?: string };
            version?: string;
        };
    }
    Index

    Properties

    "@node-in-layers/mcp-server": {
        hiddenPaths?: string[];
        hideComponents?: {
            allModels?: boolean;
            domains?: string[];
            paths?: readonly string[];
        };
        logging?: {
            requestLogGetData?: (req: Request) => Record<string, any>;
            requestLogLevel?: LogLevelNames;
            responseLogGetData?: (req: Request) => Record<string, any>;
            responseLogLevel?: LogLevelNames;
        };
        server: {
            connection: | Without<
                Readonly<{ type: "cli" }>,
                Readonly<
                    {
                        headers?: Readonly<Record<string, string>>;
                        retry?: Readonly<{ attempts: number; backoff: number }>;
                        timeout?: number;
                        type: "http";
                        url: string;
                    },
                >,
            > & Readonly<
                {
                    headers?: Readonly<Record<string, string>>;
                    retry?: Readonly<{ attempts: number; backoff: number }>;
                    timeout?: number;
                    type: "http";
                    url: string;
                },
            >
            | Without<
                Readonly<
                    {
                        headers?: Readonly<Record<string, string>>;
                        retry?: Readonly<{ attempts: number; backoff: number }>;
                        timeout?: number;
                        type: "http";
                        url: string;
                    },
                >,
                Readonly<{ type: "cli" }>,
            > & Readonly<{ type: "cli" }>;
        };
        startHere?: {
            description?: string;
            examplesOfUse?: readonly Readonly<
                {
                    description?: string;
                    details?: string;
                    example?: string;
                    name: string;
                    tags?: string[];
                    value?: string;
                },
            >[];
            hideDefaultSystemEntries?: boolean;
            includeDomains?: boolean;
            includeFeatures?: boolean;
            name?: string;
        };
        stateful?: boolean;
        systemDescription?: { description?: string; version?: string };
        version?: string;
    }

    Type Declaration

    • OptionalhiddenPaths?: string[]

      Use hideComponents instead. Dot-path strings of tools/domains to suppress.

    • OptionalhideComponents?: { allModels?: boolean; domains?: string[]; paths?: readonly string[] }

      Fine-grained control over which tools are exposed to AI clients. All suppressed items are completely omitted — they will not appear in tool listings or START_HERE output.

      Dot-path format for paths:

      • 'myDomain' — hides the entire domain and all its features/models.
      • 'myDomain.myFeature' — hides one specific feature.
      • 'myDomain.cruds' — hides all model CRUD tools for a domain.
      • 'myDomain.cruds.MyModel' — hides CRUD tools for one specific model.
      • OptionalallModels?: boolean

        When true, suppresses ALL model CRUD tools across every domain.

      • Optionaldomains?: string[]

        Domain names to hide entirely (domain will not appear in list_domains).

      • Optionalpaths?: readonly string[]

        Dot-path strings identifying individual tools, features, or model CRUD groups to suppress.

    • Optionallogging?: {
          requestLogGetData?: (req: Request) => Record<string, any>;
          requestLogLevel?: LogLevelNames;
          responseLogGetData?: (req: Request) => Record<string, any>;
          responseLogLevel?: LogLevelNames;
      }

      Logging configuration for inbound tool calls and their responses. All logging uses the Node-in-Layers logger already present in the context.

      • OptionalrequestLogGetData?: (req: Request) => Record<string, any>

        Optional callback that extracts additional structured fields to merge into the request log entry. Return a plain object of key/value pairs.

      • OptionalrequestLogLevel?: LogLevelNames

        Log level used when logging the incoming tool request. Defaults to 'info'. One of the LogLevelNames string literals from @node-in-layers/core (e.g. 'info', 'warn', 'error', 'debug').

      • OptionalresponseLogGetData?: (req: Request) => Record<string, any>

        Optional callback that extracts additional structured fields to merge into the response log entry. Return a plain object of key/value pairs.

      • OptionalresponseLogLevel?: LogLevelNames

        Log level used when logging the tool response. Defaults to 'info'. One of the LogLevelNames string literals from @node-in-layers/core (e.g. 'info', 'warn', 'error', 'debug').

    • server: {
          connection:
              | Without<
                  Readonly<{ type: "cli" }>,
                  Readonly<
                      {
                          headers?: Readonly<Record<string, string>>;
                          retry?: Readonly<{ attempts: number; backoff: number }>;
                          timeout?: number;
                          type: "http";
                          url: string;
                      },
                  >,
              > & Readonly<
                  {
                      headers?: Readonly<Record<string, string>>;
                      retry?: Readonly<{ attempts: number; backoff: number }>;
                      timeout?: number;
                      type: "http";
                      url: string;
                  },
              >
              | Without<
                  Readonly<
                      {
                          headers?: Readonly<Record<string, string>>;
                          retry?: Readonly<{ attempts: number; backoff: number }>;
                          timeout?: number;
                          type: "http";
                          url: string;
                      },
                  >,
                  Readonly<{ type: "cli" }>,
              > & Readonly<{ type: "cli" }>;
      }

      Transport configuration. Must specify a connection that selects either CLI (stdio) or HTTP transport.

      • connection:
            | Without<
                Readonly<{ type: "cli" }>,
                Readonly<
                    {
                        headers?: Readonly<Record<string, string>>;
                        retry?: Readonly<{ attempts: number; backoff: number }>;
                        timeout?: number;
                        type: "http";
                        url: string;
                    },
                >,
            > & Readonly<
                {
                    headers?: Readonly<Record<string, string>>;
                    retry?: Readonly<{ attempts: number; backoff: number }>;
                    timeout?: number;
                    type: "http";
                    url: string;
                },
            >
            | Without<
                Readonly<
                    {
                        headers?: Readonly<Record<string, string>>;
                        retry?: Readonly<{ attempts: number; backoff: number }>;
                        timeout?: number;
                        type: "http";
                        url: string;
                    },
                >,
                Readonly<{ type: "cli" }>,
            > & Readonly<{ type: "cli" }>

        Transport connection — either { type: 'cli' } or { type: 'http', url: '...', ... }.

    • OptionalstartHere?: {
          description?: string;
          examplesOfUse?: readonly Readonly<
              {
                  description?: string;
                  details?: string;
                  example?: string;
                  name: string;
                  tags?: string[];
                  value?: string;
              },
          >[];
          hideDefaultSystemEntries?: boolean;
          includeDomains?: boolean;
          includeFeatures?: boolean;
          name?: string;
      }

      Configuration for the built-in START_HERE tool. This tool is always registered and is the recommended first call for any AI client — it returns a system overview that helps the client navigate the available domains, features, and models.

      • Optionaldescription?: string

        Override the tool description shown to the AI client.

      • OptionalexamplesOfUse?: readonly Readonly<
            {
                description?: string;
                details?: string;
                example?: string;
                name: string;
                tags?: string[];
                value?: string;
            },
        >[]

        Optional worked examples of end-to-end usage flows to include in the START_HERE response. Prefer JSON object examples with minimal prose.

      • OptionalhideDefaultSystemEntries?: boolean

        When true, suppresses the built-in Node-in-Layers navigation documentation from the response. Generally not recommended unless you are providing a completely custom system description.

      • OptionalincludeDomains?: boolean

        When true, the response includes the domain list (equivalent to calling list_domains first).

      • OptionalincludeFeatures?: boolean

        When true, the response includes the full feature list per domain (equivalent to calling list_features for every domain). Implies includeDomains: true.

      • Optionalname?: string

        Override the tool name. Default: 'START_HERE'.

    • Optionalstateful?: boolean

      When true the HTTP transport manages persistent sessions (one McpServer instance per session). When false (the default) each HTTP request spins up a fresh server instance (stateless mode).

      Stateful mode is required when you need server-sent events or long-lived session state. Stateless mode is simpler and works well for most REST-style AI tool calls.

    • OptionalsystemDescription?: { description?: string; version?: string }

      Static metadata injected into the START_HERE response.

      • Optionaldescription?: string

        Human-readable description of the system shown to the AI client.

      • Optionalversion?: string

        System version string shown to the AI client.

    • Optionalversion?: string

      Semver string reported by the MCP server during the initialize handshake. Defaults to '1.0.0' if omitted.