Skip to content

mcp-server-cce fails to start: invalid JSON (trailing comma in cce.json) #146

@vadbosh

Description

@vadbosh

Summary

The mcp-server-cce binary fails to start because its bundled OpenAPI spec
huaweicloud_services_server/mcp_server_cce/src/mcp_server_cce/config/cce.json
contains a trailing comma, which is not valid JSON.

Reproduction

git clone https://github.com/HuaweiCloudDeveloper/mcp-server.git
cd mcp-server
uv venv .venv && uv pip install -e . --python .venv/bin/python
.venv/bin/mcp-server-cce -t stdio </dev/null

Error

ERROR    服务器初始化失败: 无效的JSON格式:
         Expecting property name enclosed in double quotes:
         line 9 column 3 (char 200)
...
  File ".../assets/utils/hwc_tools.py", line 245, in load_openapi
    result = json.load(file)
json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes:
line 9 column 3 (char 200)

Root cause

huaweicloud_services_server/mcp_server_cce/src/mcp_server_cce/config/cce.json,
line 8:

{
  "openapi" : "3.0.0",
  "info" : {
    "description" : "CCE-集群升级",
    "title" : "CCE",
    "version" : "2025-06-13",
    "x-host_prefix": "cce",
    "x-host" : "cce.{region}.myhuaweicloud.com",   <-- trailing comma
  },
  ...

JSON does not allow trailing commas inside an object, so json.load() rejects
the file before any tool can be loaded. All other mcp-server-* binaries in
the repo start successfully — only CCE is affected.

Fix

Remove the trailing comma after "x-host" on line 8:

-    "x-host" : "cce.{region}.myhuaweicloud.com",
+    "x-host" : "cce.{region}.myhuaweicloud.com"
   },

After the fix mcp-server-cce starts cleanly and registers ~151 tools.

Environment

  • Repo HEAD: main (cloned 2026-05-03)
  • Python 3.12.8 (uv-managed)
  • Linux aarch64

Happy to open a PR if useful — it is a one-character change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions