import type { Resource } from '@modelcontextprotocol/sdk/types.js'; /** * Represents a federated resource with server information */ export interface FederatedResource extends Resource { serverAlias: string; fullUri: string; lastSeen?: Date; cached?: boolean; } /** * Registry for managing federated MCP resources across multiple servers * Provides namespacing, caching, and resource resolution */ export declare class ResourceRegistry { private resources; private serverResources; private uriToResourceMap; constructor(); /** * Register resources from a server * @param serverAlias The alias of the server * @param resources The resources to register */ register(serverAlias: string, resources: Resource[]): void; /** * Resolve a resource URI to server and resource information * @param uri The URI to resolve (can be full mcp:// or relative) * @returns The server alias and resource, or null if not found */ resolve(uri: string): { server: string; resource: FederatedResource; } | null; /** * Get all resources from a specific server * @param serverAlias The server alias * @returns Array of federated resources */ getServerResources(serverAlias: string): FederatedResource[]; /** * Get all resources across all servers * @returns Array of all federated resources */ getAllResources(): FederatedResource[]; /** * Resolve a glob pattern to matching resources * Supports * wildcard in both server and resource portions * @param pattern The glob pattern (e.g., 'mcp://storage/logs/*.log' or 'mcp://*/data.json') * @returns Array of matching server/resource pairs */ resolveGlob(pattern: string): Array<{ server: string; resource: FederatedResource; }>; /** * Search for resources by name or URI pattern * @param pattern The search pattern (supports * wildcard) * @returns Matching resources */ search(pattern: string): FederatedResource[]; /** * Mark a resource as cached * @param uri The resource URI */ markCached(uri: string): void; /** * Check if a resource is cached * @param uri The resource URI * @returns True if cached */ isCached(uri: string): boolean; /** * Clear resources for a specific server * @param serverAlias The server alias */ clearServer(serverAlias: string): void; /** * Clear all resources */ clearAll(): void; /** * Get statistics about the registry */ getStats(): { totalResources: number; totalServers: number; cachedResources: number; serverStats: Array<{ alias: string; resourceCount: number; }>; }; /** * Generate a unique key for a resource */ private getResourceKey; /** * Export registry data for persistence */ export(): { resources: Array<[string, FederatedResource]>; serverResources: Array<[string, string[]]>; }; /** * Import registry data from persistence */ import(data: { resources: Array<[string, FederatedResource]>; serverResources: Array<[string, string[]]>; }): void; } //# sourceMappingURL=ResourceRegistry.d.ts.map