Skip to main content

Overview

Methods

get()

Get a DEFAULT-scoped (singleton) provider.
Example:

getScoped()

Get a provider from given views (for session/request scoped providers).
Example:

resolve()

Lightweight synchronous resolver for app-scoped DI.
Example:

resolveBootstrapDep()

Resolve a dependency usable during bootstrap phase. Async because it may walk the parent registry hierarchy and instantiate global providers.

getProviders()

Get all provider entries.

buildViews()

Build provider views for different scopes. Async — instantiates context-scoped providers per request.
Example:

addRegistry()

Add a registry by type.

getRegistries()

Get registries by type.

getHooksRegistry()

Get the hooks registry.

getScopeRegistry()

Get the scope registry.

mergeFromRegistry()

Merge providers from another registry.

getProviderInfo()

Get exported provider definitions.

injectProvider()

Inject a provider value directly.
Example:

addDynamicProviders()

Add providers dynamically at runtime. Async — instantiates global-scoped providers immediately.

Session Management

cleanupSession()

Clean up a specific session’s provider cache.

cleanupExpiredSessions()

Clean up expired sessions from cache.

startSessionCleanup()

Start background session cleanup timer.

stopSessionCleanup()

Stop background session cleanup timer.

getSessionCacheStats()

Get session cache statistics.

isSessionCacheEnabled()

Check if session caching is enabled.

dispose()

Dispose registry and clean up all resources.

Server/Scope Access

getActiveScope()

Get the active scope.

getActiveServer()

Get the active server.

Provider Scopes

FrontMCP supports multiple provider scopes:
In distributed/serverless mode, SESSION is normalized to CONTEXT to avoid stale instances.

Provider Views

Provider views represent the hierarchy of available providers:

Indexes

Session Caching

The registry implements LRU eviction and TTL-based session caching:

Provider Definition

Providers are defined with:
Example: