feat: multi-tenant support via HUAWEI_TENANTS_FILE
Problem
Currently, the MCP server supports only a single set of credentials (AK/SK) configured via environment variables. In enterprise environments with multiple Huawei Cloud tenants (e.g., different departments or clients sharing the same HCSO on-premise), operators need to run separate MCP server instances per tenant, which is resource-intensive.
Proposed Solution
Add HUAWEI_TENANTS_FILE env var pointing to a JSON file that defines multiple tenants with their own credentials and endpoint configurations. Each tool call accepts an optional tenant parameter.
Tenants file format
{
"default": "tenant-a",
"tenants": {
"tenant-a": {
"ak": "...", "sk": "...", "project_id": "...",
"endpoint_domain": "hcso.example.com",
"endpoint_prefix": "-internal",
"iam_endpoint": "https://iam-pub.region.hcso.example.com",
"region": "region-1"
},
"tenant-b": { "ak": "...", "sk": "...", "project_id": "..." }
}
}
Behavior
HUAWEI_TENANTS_FILEset →tenantparameter injected into all tools- No
tenantin call → usesdefaulttenant from JSON - No
HUAWEI_TENANTS_FILE→ behavior unchanged (backward compatible) - Per-tenant fields override global config; unset fields fall back to defaults
Use Case
Managing resources across multiple Huawei Cloud tenants from a single MCP server instance, particularly useful for HCSO on-premise deployments serving multiple government agencies.
Related to #137 (custom endpoint domain support).
Implementation available at: https://github.com/filhocf/hcso-mcp-server/commit/3b93dfa