MCP Server Framework - v1.1.2
    Preparing search index...

    Interface ResourceStaticDefinition

    Static resource definition - for fixed URI resources.

    Use this for resources with a fixed URI that don't require parameters. For dynamic URIs with parameters, use ResourceTemplateDefinition.

    const configResource = defineResource({
    name: 'app-config',
    description: 'Application configuration',
    uri: 'myapp://config/main',
    mimeType: 'application/json',
    read: async () => JSON.stringify({ version: '1.0.0' }),
    });
    interface ResourceStaticDefinition {
        description: string;
        mimeType?: string;
        name: string;
        read: (ctx?: ResourceContext) => Promise<ResourceReadReturn>;
        requiredScopes?: readonly string[];
        uri: string;
    }

    Hierarchy (View Summary)

    Index

    Properties

    description: string

    Human-readable description shown to LLM

    mimeType?: string

    MIME type of the content (optional)

    name: string

    Unique resource name for identification

    read: (ctx?: ResourceContext) => Promise<ResourceReadReturn>

    Content provider function.

    Type Declaration

      • (ctx?: ResourceContext): Promise<ResourceReadReturn>
      • Parameters

        • Optionalctx: ResourceContext

          Optional runtime context (sessionId, authInfo). Handlers that don't need per-request information can ignore this argument.

        Returns Promise<ResourceReadReturn>

        String content, Uint8Array for binary data, or a ResourceReadResult to override the MIME type per call.

    requiredScopes?: readonly string[]

    Scopes required to read this resource (RBAC).

    When set, the framework checks authInfo.scopes BEFORE the read handler executes. All listed scopes must be present (AND logic). If the check fails, a 403 Forbidden error is returned.

    Omit or set to undefined for resources accessible to any authenticated user.

    uri: string

    Resource URI (e.g., 'myapp://config/main')