@Provider() and registered at server or app scope. Resolution is hierarchical: tool → app → server.
Define a provider
Scopes
- GLOBAL (default): one instance per process/worker. Ideal for clients, pools, caches.
- SESSION: one instance per authenticated session. Use for per-user credentials or token-bound clients.
- REQUEST: one instance per inbound request. Use sparingly (e.g., per-request trace/state).
Register providers
Server-level providers (available to all apps):Using providers from tools/plugins
FrontMCP resolves providers for your executors and hooks. Keep your tool logic pure; read side-effects (DB, queues, secrets) via providers.- Prefer GLOBAL for shared clients.
- Use SESSION for user-bound clients (e.g., per-user API token).
- Reserve REQUEST for ephemeral state.
Provider injection/consumption follows your runtime’s DI rules. In general: register providers at the minimal scope
and let the framework resolve them for tools and hooks at execution time.

