mcp-server icon indicating copy to clipboard operation
mcp-server copied to clipboard

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

Open vadbosh opened this issue 6 months ago • 0 comments

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.

vadbosh avatar May 03 '26 14:05 vadbosh