feat: add custom endpoint domain support for HCSO/on-premise deployments#139
Open
filhocf wants to merge 6 commits intoHuaweiCloudDeveloper:mainfrom
Open
feat: add custom endpoint domain support for HCSO/on-premise deployments#139filhocf wants to merge 6 commits intoHuaweiCloudDeveloper:mainfrom
filhocf wants to merge 6 commits intoHuaweiCloudDeveloper:mainfrom
Conversation
- Add HUAWEI_ENDPOINT_DOMAIN env var to override myhuaweicloud.com domain - Add endpoint_domain field to MCPConfig (config.yaml + env var) - Modify create_api_client to replace domain when endpoint_domain is set - Pass endpoint_domain from config through server to API client This enables usage with Huawei Cloud Stack Online (HCSO) and other on-premise deployments where API endpoints use a different domain. Closes HuaweiCloudDeveloper#137
…oint) - HUAWEI_ENDPOINT_PREFIX: inject suffix into service name (e.g. '-prevnet') roma.region.domain → roma-prevnet.region.domain - HUAWEI_PROJECT_ID: required for HCSO on-premise authentication - HUAWEI_IAM_ENDPOINT: custom IAM endpoint for on-premise deployments Uses BasicCredentials.with_iam_endpoint() for HCSO IAM All new parameters supported via env vars and config.yaml.
- Bump version to 0.3.1 - Add HCSO/on-premise to description and keywords - Fix license to Apache-2.0 (matching repo LICENSE) - Add project URLs (fork + upstream) - Add Python 3.11-3.13 classifiers - Add co-author
- New TenantConfig dataclass for per-tenant credentials - HUAWEI_TENANTS_FILE env var points to JSON with tenant configs - 'tenant' parameter injected into all tools when multi-tenant active - call_tool resolves credentials from tenant > default_tenant > config - Backward compatible: without HUAWEI_TENANTS_FILE, behavior unchanged - tenants.example.json with sicar/mgi template - .gitignore: docs/, uv.lock, tenants.json
…weiCloudDeveloper#142) - New UnifiedMCPServer class loads multiple OpenAPI specs in one process - HUAWEI_SERVICES env var: comma-separated service codes (e.g. ecs,vpc,cce) - Tools prefixed with service code (ecs_ListServers, vpc_ListVpcs) - Compatible with multi-tenant (HUAWEI_TENANTS_FILE) - Graceful handling of invalid OpenAPI JSONs (skip with warning) - New entry point: mcp-server-unified - Fix: CCE OpenAPI JSON trailing comma
- readonly (default): exposes only read operations (List, Show, Get, Count, Check, Search, Query, Describe) - full: exposes all operations including Create, Delete, Update - Reduces tool count from ~886 to ~396 in readonly mode - Safer for exploration, reduces LLM context overhead
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for custom endpoint domains, enabling the MCP server to work with Huawei Cloud Stack Online (HCSO) and other on-premise deployments where the default
myhuaweicloud.comdomain is not reachable.Closes #137
Problem
The current implementation hardcodes endpoints to
*.myhuaweicloud.com. In HCSO on-premise environments, API endpoints use a different domain (e.g.,*.hcso.customer-domain.com), making the MCP server unusable.Changes
assets/utils/variable.pyHUAWEI_ENDPOINT_DOMAINenvironment variable constantassets/utils/model.pyendpoint_domain: Optional[str]field toMCPConfigdataclassassets/utils/hwc_tools.pycreate_api_client()to acceptendpoint_domainparameterendpoint_domainis set, replacesmyhuaweicloud.comwith the custom domain\".\" in endpointinstead of\"com\" in endpoint)HUAWEI_ENDPOINT_DOMAINto env variable mapping inload_config()assets/utils/server.pyself.config.endpoint_domaintocreate_api_client()in the tool handlerUsage
Via environment variable (recommended)
Via config.yaml
MCP client configuration (Kiro/Cursor/Cline)
{ \"mcpServers\": { \"huawei-ecs\": { \"command\": \"uv\", \"args\": [\"run\", \"--directory\", \"/path/to/mcp-server\", \"mcp-server-ecs\", \"-t\", \"stdio\"], \"env\": { \"HUAWEI_ACCESS_KEY\": \"...\", \"HUAWEI_SECRET_KEY\": \"...\", \"HUAWEI_ENDPOINT_DOMAIN\": \"hcso.customer-domain.com\" } } } }Backward Compatibility
endpoint_domainis not set, behavior is identical to before.