MCP Server Framework - v1.0.0
    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: () => Promise<string | Uint8Array<ArrayBufferLike>>;
        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: () => Promise<string | Uint8Array<ArrayBufferLike>>

    Content provider function.

    Type Declaration

      • (): Promise<string | Uint8Array<ArrayBufferLike>>
      • Returns Promise<string | Uint8Array<ArrayBufferLike>>

        String content or Uint8Array for binary data

    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')