Skip to main content

Class Definition

Properties

ScopeMetadata

ScopeMetadata is a union type:
  • AppScopeMetadata — Used for single-app scopes (created when splitByApp splits each app into its own scope). Contains a single apps: [AppType] entry plus the parent server config (info, auth, etc.).
  • MultiAppScopeMetadata — Used for multi-app scopes (the default). Contains apps: AppType[] with all registered apps.
Both include an 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 (when jobs.enabled is set on the server).

workflows

Get the workflow registry (when jobs.enabled is set on the server).

channels

Get the channel registry (when channels.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:
  1. Providers
  2. Hooks
  3. Flows
  4. Transport Service
  5. Elicitation Store
  6. Auth Registry
  7. Apps Registry
  8. Plugins
  9. Tools Registry
  10. Tool UI Registry
  11. Resources Registry
  12. Prompts Registry
  13. Agents Registry
  14. Skills Registry + Session Manager
  15. Notification Service
  16. Additional Flows

FrontMcpInstance

Server bootstrap

ToolRegistry

Tool registry

ResourceRegistry

Resource registry

SkillRegistry

Skill registry