Files
openclaw/src/plugins/registry-empty.ts
Ayaan Zaidi 834561ad67 feat(mcp): resolve MCP server connections per trusted requester
Plugins can register api.registerMcpServerConnectionResolver({serverName,
resolve}) to bind an MCP server's transport (url/headers) to the trusted
sender of each message. Server identity stays static; only the connection
is per-requester. Runtimes are cached per (sessionId, channel, accountId,
senderId); runs without a trusted requester fail closed (cron, subagent,
heartbeat). Resolved credentials never enter fingerprints or logs. Static
servers keep the existing session-scoped lifecycle byte-for-byte.

Enables per-user hosted MCP sessions (e.g. per-user OAuth email/calendar)
in multi-sender channels like Slack.

Refs #106229
2026-07-14 17:09:53 +05:30

61 lines
1.6 KiB
TypeScript

// Provides the empty plugin registry used before discovery completes.
import type { PluginRegistry } from "./registry-types.js";
export function createEmptyPluginRegistry(): PluginRegistry {
return {
plugins: [],
tools: [],
hooks: [],
typedHooks: [],
channels: [],
channelSetups: [],
providers: [],
modelCatalogProviders: [],
sessionCatalogs: [],
cliBackends: [],
textTransforms: [],
embeddingProviders: [],
speechProviders: [],
realtimeTranscriptionProviders: [],
realtimeVoiceProviders: [],
mediaUnderstandingProviders: [],
transcriptSourceProviders: [],
imageGenerationProviders: [],
videoGenerationProviders: [],
musicGenerationProviders: [],
webFetchProviders: [],
webSearchProviders: [],
workerProviders: new Map(),
migrationProviders: [],
codexAppServerExtensionFactories: [],
agentToolResultMiddlewares: [],
memoryEmbeddingProviders: [],
agentHarnesses: [],
gatewayHandlers: {},
gatewayMethodDescriptors: [],
coreGatewayMethodNames: [],
httpRoutes: [],
hostedMediaResolvers: [],
mcpServerConnectionResolvers: [],
cliRegistrars: [],
reloads: [],
nodeHostCommands: [],
nodeInvokePolicies: [],
securityAuditCollectors: [],
services: [],
gatewayDiscoveryServices: [],
commands: [],
interactiveHandlers: [],
sessionExtensions: [],
trustedToolPolicies: [],
toolMetadata: [],
controlUiDescriptors: [],
runtimeLifecycles: [],
agentEventSubscriptions: [],
sessionSchedulerJobs: [],
sessionActions: [],
conversationBindingResolvedHandlers: [],
diagnostics: [],
};
}