Class Definition
Properties
| Property | Type | Description |
|---|---|---|
id | string | Unique scope identifier |
logger | FrontMcpLogger | Scope-specific logger |
entryPath | string | HTTP entry path |
routeBase | string | Route prefix |
ready | Promise<void> | Initialization promise |
metadata | ScopeMetadata | Configuration metadata |
ScopeMetadata
ScopeMetadata is a union type:
AppScopeMetadata— Used for single-app scopes (created whensplitByAppsplits each app into its own scope). Contains a singleapps: [AppType]entry plus the parent server config (info, auth, etc.).MultiAppScopeMetadata— Used for multi-app scopes (the default). Containsapps: AppType[]with all registered apps.
id field (unique scope identifier) and the full server configuration from @FrontMcp(). Defined in libs/sdk/src/common/metadata/front-mcp.metadata.ts.
Registry Accessors
tools
Get the tool registry.resources
Get the resource registry.prompts
Get the prompt registry.agents
Get the agent registry.skills
Get the skill registry.providers
Get the provider registry.auth
Get the primary auth provider.authProviders
Get the auth registry.apps
Get the app registry.hooks
Get the hook registry.plugins
Get the plugin registry (if configured).jobs
Get the job registry (whenjobs.enabled is set on the server).
workflows
Get the workflow registry (whenjobs.enabled is set on the server).
channels
Get the channel registry (whenchannels.enabled is set on the server).
Service Accessors
notifications
Get the notification service.elicitationStore
Get the elicitation store (if configured).eventStore
Get the event store (if configured).tasks
Get the task registry for MCP 2025-11-25 background tasks (if enabled).taskStore
Get the persistent task record store (if tasks are enabled).channelNotifications
Get the channel notification service (if channels are enabled).channelEventBus
Get the in-process channel event bus (if channels are enabled).skillSession
Get the skill session manager (if skills exist).toolUI
Get the tool UI registry.Flow Execution
runFlow(name, input, deps?)
Execute a named flow.runFlowForOutput(name, input, deps?)
Execute a flow and assert output exists.registryFlows(…flows)
Register additional flows.Accessing Scope
In Tools/Resources/Agents
From FrontMcpInstance
From DirectClient
The scope is internal to DirectClient, accessed through its methods:Usage Examples
Introspection
Event Handling
Skill Sessions
SkillSessionManager runs inside an AsyncLocalStorage context — call runWithSession(sessionId, fn) first, then query session state from inside fn:
Initialization Sequence
The Scope initializes in this order:- Providers
- Hooks
- Flows
- Transport Service
- Elicitation Store
- Auth Registry
- Apps Registry
- Plugins
- Tools Registry
- Tool UI Registry
- Resources Registry
- Prompts Registry
- Agents Registry
- Skills Registry + Session Manager
- Notification Service
- Additional Flows
Related
FrontMcpInstance
Server bootstrap
ToolRegistry
Tool registry
ResourceRegistry
Resource registry
SkillRegistry
Skill registry