Kommander exposes MCP tools only after the runtime has a server config or an enabled customer-data connector. The model receives OpenAI-compatible function definitions, but execution always stays on the Kommander server.

Configuration Sources

SourceScopeUse it for
Environment variablesGlobal fallbackDevelopment, single-tenant deployments, or shared Google Calendar credentials (Microsoft 365 has no env-only fallback).
chatbot_settings.mcpServersUser or assistant settingsPer-user OAuth-backed tools such as a connected Google Calendar or Microsoft 365 calendar.
Customer-data connectionsOrganizationOpenAPI-backed customer account, order, ticket, CRM, or subscription lookups.

Settings-backed MCP servers take priority. When a user has at least one settings config, environment configs are not merged in.

Calendar Environment Config

.env.local

The environment fallback creates a server config equivalent to:

Calendar MCP server config

For user-connected calendar OAuth, store the same shape in chatbot_settings.mcpServers with encrypted credentials resolved before runtime. config.provider selects the implementation: google_calendar (the default for legacy entries without a provider) or microsoft_calendar.

Microsoft 365 calendar MCP server config

Microsoft rotates refresh tokens on every refresh; Kommander writes the newest token back to this entry automatically. Optional tenantId pins token refresh to one Entra tenant, and onlineMeetings: false disables Teams links on created events.

OpenAI Tool Shape

Kommander converts each MCPToolDefinition into this function-call shape before calling the model:

OpenAI tool definition

Model responses use the provider’s tool-call format. Kommander parses the JSON arguments, strips caller-controlled identity fields, verifies the tool was offered in the current request, then routes execution through the registry.

Model-emitted tool call

Customer-Data Connector Config

Use OpenAPI connectors for end-user-owned data. Keep operations read-only unless a workflow has a separate confirmation and authorization path.

OpenAPI customer-data connector

Identity injection rules bind upstream request parameters to verified identity values instead of model arguments.

Identity injection rule

Runtime Flow

Usage Checklist

  • Register server factories before resolving user tools.
  • Keep server type values stable because configs use them for factory lookup.
  • Use unique tool names across built-in servers and customer-data connectors.
  • Include organizationId when loading customer-data tools so connector exposure stays tenant-scoped.
  • Pass conversationId and turnId to enforce budgets and produce useful audit correlation IDs.
  • Pass verifiedUser or identityVerification when customer-data tools can be exposed.
  • Keep KOMMANDER_MAX_TOOL_ROUNDS at the default of 3 unless a workflow needs more model-tool iterations.