Skip to content

feat: unified server mode — single process for multiple services#145

Open
filhocf wants to merge 4 commits intoHuaweiCloudDeveloper:mainfrom
filhocf:feat/unified-server
Open

feat: unified server mode — single process for multiple services#145
filhocf wants to merge 4 commits intoHuaweiCloudDeveloper:mainfrom
filhocf:feat/unified-server

Conversation

@filhocf
Copy link
Copy Markdown

@filhocf filhocf commented Apr 16, 2026

Closes #142

Summary

Adds a unified server mode where a single process loads multiple Huawei Cloud service OpenAPI specs, drastically reducing resource usage.

Motivation

Approach Processes RAM Startup
Current (1 per service) 13+ ~2GB+ Slow
Unified 1 ~200MB Fast

Usage

export HUAWEI_SERVICES="ecs,vpc,cce,elb,nat,evs,iam"
mcp-server-unified -t stdio

Changes

  • assets/utils/unified_server.py: New UnifiedMCPServer class
    • Loads multiple OpenAPI specs based on HUAWEI_SERVICES env var
    • Prefixes tool names with service code (ecs_ListServers, vpc_ListVpcs)
    • Routes call_tool to correct OpenAPI spec based on prefix
    • Compatible with multi-tenant (feat: multi-tenant support via HUAWEI_TENANTS_FILE #141)
    • Graceful handling of invalid OpenAPI JSONs (skip with warning)
  • New entry point: mcp-server-unified
  • Fix: CCE OpenAPI JSON trailing comma

Backward Compatibility

Existing per-service entry points (mcp-server-ecs, etc.) are unchanged. The unified server is an additional option.

Testing

Tested with 10 services (ecs, vpc, cce, elb, nat, evs, iam, dns, lts, ces): 898 tools loaded in a single process.

filhocf and others added 4 commits March 26, 2026 09:50
- 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
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: unified server mode — single process serving multiple services

1 participant