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
| Source | Scope | Use it for |
|---|---|---|
| Environment variables | Global fallback | Development, single-tenant deployments, or shared Google Calendar credentials (Microsoft 365 has no env-only fallback). |
chatbot_settings.mcpServers | User or assistant settings | Per-user OAuth-backed tools such as a connected Google Calendar or Microsoft 365 calendar. |
| Customer-data connections | Organization | OpenAPI-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
The environment fallback creates a server config equivalent to:
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 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:
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.
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.
Identity injection rules bind upstream request parameters to verified identity values instead of model arguments.
Runtime Flow
Usage Checklist
- Register server factories before resolving user tools.
- Keep server
typevalues stable because configs use them for factory lookup. - Use unique tool names across built-in servers and customer-data connectors.
- Include
organizationIdwhen loading customer-data tools so connector exposure stays tenant-scoped. - Pass
conversationIdandturnIdto enforce budgets and produce useful audit correlation IDs. - Pass
verifiedUseroridentityVerificationwhen customer-data tools can be exposed. - Keep
KOMMANDER_MAX_TOOL_ROUNDSat the default of3unless a workflow needs more model-tool iterations.