Checked against the hosted endpoint only.
Fix: fix-4c3e4fe51af30f324347.
What the agent did
Start the edgeCore backend (README: `go run cmd/main.go`) and exercise its MCP Streamable-HTTP endpoint /api/mcp: initialize (protocol 2024-11-05 and 2025-11-25 both accepted), tools/list (34 tools), and a read-only tools/call get_system_info.
cd <host-path> && pwd && git status 2>&1 | head -5; git log --oneline -1 2>&1; ls -la; echo ---; cat README.md 2>/dev/null | head -300
cd <host-path> && cat README.en.md; echo ---MAKE; cat Makefile; echo ---; which go node npm goreleaser python3; go version 2>&1; node -v 2>&1; ls dist 2>&1; ls <host-path> 2>&1; echo $CDP_URL $<env-var>
cd <host-path> && head -5 go.mod; ls cmd; sudo -n true && echo SUDO_OK; (apt-cache policy golang-go 2>/dev/null | head -3); echo ---; sed -n 1,200p <host-path> | head -150
apt-cache policy golang-go | head -3; cat /etc/os-release | head -2; export NODE_USE_ENV_PROXY=1; (sudo apt-get update -qq >/dev/null 2>&1; apt-cache policy golang-go | head -3) ; env | grep -i proxy
cd /tmp && curl -fsSL -o go.tgz https://go.dev/dl/go1.26.4.linux-amd64.tar.gz; echo rc=$?; ls -la go.tgz 2>&1;
mkdir -p /tmp/goroot && cd /tmp && tar -xzf go.tgz -C /tmp/goroot && export PATH=/tmp/goroot/go/bin:$PATH && go version && cd <host-path> && export GOFLAGS=-mod=mod && export NODE_USE_ENV_PROXY=1 && go mod tidy 2>&1 | tail -20; echo rc=$?
cd /tmp && curl -fsSL -o src.tgz https://codeload.github.com/anviod/edgeCore/tar.gz/4737ea86faf5db6e71e812be4d15093b70bbe36d; echo rc=$?; mkdir -p /tmp/pinned && tar -xzf src.tgz -C /tmp/pinned --strip-components=1 && cd <host-path> && for f in go.mod go.sum; do cmp $f /tmp/pinned/$f && echo "$f same"; done; diff -rq /tmp/pinned <host-path> | head -20
export PATH=/tmp/goroot/go/bin:$PATH; cd <host-path> && CGO_ENABLED=0 go build -trimpath -o /tmp/edgecore-build/edgeCore ./cmd/ ; echo rc=$?; ls -la /tmp/edgecore-build/ 2>&1; ls docs | head -40; find docs -iname '*mcp*' | head; cat cmd/main.go | head -80
cd <host-path> && cat docs/guide/mcp-access-guide.md | head -200
export PATH=/tmp/goroot/go/bin:$PATH; export NODE_USE_ENV_PROXY=1; cd <host-path> && (nohup go run cmd/main.go > /tmp/edge-run.log 2>&1 &); sleep 40; tail -40 /tmp/edge-run.log; echo ---; (ss -ltnp 2>/dev/null | grep -E '8080|6060') ; ls conf data 2>&1
cd /tmp && curl -s -m 10 -i -X POST http://127.0.0.1:8080/api/mcp -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-11-25","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}'; echo; echo ---; curl -s -m 10 -i -X POST http://127.0.0.1:8080/api/mcp -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"t","version":"1"}}}'
cd <host-path> && grep -rn "X-MCP-API-Key\|MCP 认证失败\|mcp_api_key\|McpApiKey\|MCPAPIKey\|APIKey" internal --include=*.go | grep -v _test | head -30; echo ---; grep -rn "Unsupported protocol version\|2025-06-18" internal --include=*.go | head
cd <host-path> && sed -n 170,230p internal/server/ai_settings_handler.go; echo ---; grep -rn "api/mcp\|MCP 认证失败" internal --include=*.go | grep -v _test | head;
cd <host-path> && grep -rn "handleMcpActivate\|handleMcpGenerateKey\|handleMcpStatus\|ai/mcp\|mcp/" internal/server/server.go | head; echo ---; sed -n 2775,2800p internal/server/mcp_handler.go
cd /tmp && KEY=$(python3 -c 'import secrets;print(secrets.token_hex(32))'); umask 077; echo "$KEY" > /tmp/edgecore_mcp_key; curl -s -m 10 -X POST http://127.0.0.1:8080/api/mcp/activate -H 'Content-Type: application/json' -d "{\"full_access\":false,\"api_key\":\"<secret>\"}"; echo; curl -s -m 10 http://127.0.0.1:8080/api/mcp/status; echo
cd <host-path> && grep -rn "未携带token" internal --include=*.go | grep -v _test | head -3; grep -rn "install\|Install" internal/server/server.go | head -20
cd <host-path> && sed -n 40,100p internal/server/auth.go; echo ---; grep -n "func (s \*Server) startInstall" -A40 internal/server/*.go | head -70; echo; curl -s -m5 http://127.0.0.1:8080/api/install/status; echo
cd <host-path> && grep -n "type InstallConfig" -A25 internal/model/*.go | head -40; grep -rn "func (s \*Server) executeInstall" -A30 internal/server/install_handler.go | grep -in "user\|pass\|admin" | head
cd /tmp && PW=$(python3 -c 'import secrets;print(secrets.token_urlsafe(18))'); echo "$PW" > /tmp/edgecore_admin_pw; chmod 600 /tmp/edgecore_admin_pw; curl -s -m 10 -X POST http://127.0.0.1:8080/api/install/validate -H 'Content-Type: application/json' -d "{\"port\":8080,\"username\":\"smoke\",\"password\":\"<secret>\",\"storagePath\":\"<host-path>\",\"storageBackend\":\"bbolt\",\"gatewayName\":\"smoke\",\"gatewayLocation\":\"lab\",\"deviceSerial\":\"SMOKE-0001\"}"; echo; curl -s -m 10 -X POST http://127.0.0.1:8080/api/install/start -H 'Content-Type: application/json' -d "{\"port\":8080,\"username\":\"smoke\",\"password\":\"<secret>\",\"storagePath\":\"<host-path>\",\"storageBackend\":\"bbolt\",\"gatewayName\":\"smoke\",\"gatewayLocation\":\"lab\",\"deviceSerial\":\"SMOKE-0001\"}"; echo; sleep 8; curl -s -m5 http://127.0.0.1:8080/api/install/install-status; echo
cd <host-path> && grep -n "login\|Login" internal/server/server.go | head -5; cd /tmp && PW=$(cat /tmp/edgecore_admin_pw); for p in /api/login /api/auth/login; do curl -s -m 10 -X POST http://127.0.0.1:8080$p -H 'Content-Type: application/json' -d "{\"username\":\"smoke\",\"password\":\"<secret>\"}" | head -c 300; echo; done
pkill -f "cmd/main.go" ; pkill -f "/tmp/go-build.*main" ; sleep 3; ss -ltnp | grep -E ':8080|:6060' ; export PATH=/tmp/goroot/go/bin:$PATH; cd <host-path> && (nohup go run cmd/main.go > /tmp/edge-run2.log 2>&1 &); sleep 35; grep -c . /tmp/edge-run2.log; ss -ltnp | grep 8080; PW=$(cat /tmp/edgecore_admin_pw); curl -s -m 10 -X POST http://127.0.0.1:8080/api/auth/login -H 'Content-Type: application/json' -d "{\"username\":\"smoke\",\"password\":\"<secret>\"}" | head -c 400; echo
ps -eo pid,args | grep -E 'edgeCore|go-build|main' | grep -v grep | head; ss -ltnp | grep -E ':8080|:6060'; echo done
kill 6781; sleep 3; ss -ltnp | grep -E ':8080' ; export PATH=/tmp/goroot/go/bin:$PATH; cd <host-path> && (nohup go run cmd/main.go > /tmp/edge-run2.log 2>&1 &); sleep 35; ss -ltnp | grep 8080; PW=$(cat /tmp/edgecore_admin_pw); curl -s -m 10 -X POST http://127.0.0.1:8080/api/auth/login -H 'Content-Type: application/json' -d "{\"username\":\"smoke\",\"password\":\"<secret>\"}" | head -c 400; echo
cd <host-path> && grep -rn "func (s \*Server) handleLogin" -A25 internal/server/*.go | head -40; grep -n "用户不存在" -B8 internal/server/*.go | head -30
cd <host-path> && sed -n 353,380p internal/server/auth.go; grep -n "type LoginRequest" -A12 internal/server/auth.go; grep -rn "nonce" internal/server/server.go | head -3
cd /tmp && N=$(curl -s -m 10 http://127.0.0.1:8080/api/auth/nonce); echo "$N" | head -c 300; echo; NONCE=$(echo "$N" | python3 -I -c 'import json,sys;d=json.load(sys.stdin);print((d.get("data") or {}).get("nonce") or d.get("nonce") or "")'); PW=$(cat /tmp/edgecore_admin_pw); HASH=$(python3 -I -c 'import hashlib,sys;print(hashlib.sha256((sys.argv[1]+sys.argv[2]).encode()).hexdigest())' "$PW" "$NONCE"); curl -s -m 10 -X POST http://127.0.0.1:8080/api/auth/login -H 'Content-Type: application/json' -d "{\"loginFlag\":true,\"loginType\":\"local\",\"data\":{\"username\":\"smoke\",\"password\":\"<secret>\",\"nonce\":\"$NONCE\"}}" > /tmp/login.json; head -c 300 /tmp/login.json; echo
cd /tmp && TOK=$(python3 -I -c 'import json;print(json.load(open("/tmp/login.json"))["data"]["token"])'); KEY=$(cat /tmp/edgecore_mcp_key); curl -s -m 10 -X POST http://127.0.0.1:8080/api/mcp/activate -H "token: <secret>" -H 'Content-Type: application/json' -d "{\"full_access\":false,\"api_key\":\"<secret>\"}"; echo; curl -s -m 10 -H "token: <secret>" http://127.0.0.1:8080/api/mcp/status; echo; for v in 2025-11-25 2024-11-05; do curl -s -m 10 -i -X POST http://127.0.0.1:8080/api/mcp -H "Authorization: <secret>" -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream' -d "{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"initialize\",\"params\":{\"protocolVersion\":\"$v\",\"capabilities\":{},\"clientInfo\":{\"name\":\"smoke\",\"version\":\"1\"}}}" | head -c 600; echo; echo ---; done
cd /tmp && KEY=$(cat /tmp/edgecore_mcp_key); H=(-H "Authorization: <secret>" -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream'); curl -s -m 10 -D /tmp/h.txt -X POST http://127.0.0.1:8080/api/mcp "${H[@]}" -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"1"}}}' >/dev/null; SID=$(grep -i '^Mcp-Session-Id' /tmp/h.txt | awk '{print $2}' | tr -d '\r'); echo sid=$SID; curl -s -m 10 -X POST http://127.0.0.1:8080/api/mcp "${H[@]}" -H "Mcp-Session-Id: $SID" -d '{"jsonrpc":"2.0","method":"notifications/initialized"}' >/dev/null; curl -s -m 10 -X POST http://127.0.0.1:8080/api/mcp "${H[@]}" -H "Mcp-Session-Id: $SID" -d '{"jsonrpc":"2.0","id":2,"method":"tools/list"}' > /tmp/tools.json; python3 -I -c 'import json;d=json.load(open("/tmp/tools.json"));t=d["result"]["tools"];print(len(t));print([x["name"] for x in t][:40])'; curl -s -m 10 -X POST http://127.0.0.1:8080/api/mcp "${H[@]}" -H "Mcp-Session-Id: $SID" -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"edgeCore_get_system_info","arguments":{}}}' | head -c 500; echo
cd /tmp && KEY=$(cat /tmp/edgecore_mcp_key); H=(-H "Authorization: <secret>" -H 'Content-Type: application/json' -H 'Accept: application/json, text/event-stream'); curl -s -m 10 -D /tmp/h.txt -X POST http://127.0.0.1:8080/api/mcp "${H[@]}" -d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2024-11-05","capabilities":{},"clientInfo":{"name":"smoke","version":"1"}}}' >/dev/null; SID=$(grep -i '^Mcp-Session-Id' /tmp/h.txt | awk '{print $2}' | tr -d '\r'); curl -s -m 15 -X POST http://127.0.0.1:8080/api/mcp "${H[@]}" -H "Mcp-Session-Id: $SID" -d '{"jsonrpc":"2.0","id":3,"method":"tools/call","params":{"name":"get_system_info","arguments":{}}}' | head -c 600; echo; python3 -I -c 'import json;d=json.load(open("/tmp/tools.json"));print([x["name"] for x in d["result"]["tools"] if x["name"].startswith("ean")])'
cd <host-path> && ls -la .coldpass 2>&1; ps -eo pid,args | grep -E '/go-build.*main|exe/main' | grep -v grep; KEY=$(cat /tmp/edgecore_mcp_key); mkdir -p .coldpass && python3 -I - "$KEY" <<'EOF'
import json, sys
key = sys.argv[1]
probe = {
"kind": "mcp_http",
"argv": ["/tmp/goroot/go/bin/go", "run", "cmd/main.go"],
"cwd": "<host-path>",
"url": "http://127.0.0.1:8080/api/mcp",
"headers": {"Authorization": "<secret>" + key},
"env": {"PATH": "/tmp/goroot/go/bin:/usr/local/bin:/usr/bin:/bin", "HOME": "<host-path>", "GOFLAGS": "-mod=mod", "NODE_USE_ENV_PROXY": "1"}
}
with open("<host-path>", "w") as f:
json.dump(probe, f, indent=2)
EOF
cat .coldpass/probe.json | sed 's/"Bearer [0-9a-f]*"/"Bearer <redacted>"/'
kill 7644; sleep 3; ss -ltnp | grep -E ':8080|:6060' || echo "ports free"; cd <host-path> && python3 -I - <<'EOF'
import json
p = "<host-path>"
d = json.load(open(p))
d["env"].pop("GOFLAGS", None)
json.dump(d, open(p, "w"), indent=2)
EOF
<env-var>=<host-path> python3 -I <host-path> --validate; echo rc=$?
cd <host-path> && python3 -I - <<'EOF'
import json
report = {
"outcome": "working",
"operation": "Start the edgeCore backend (README: `go run cmd/main.go`) and exercise its MCP Streamable-HTTP endpoint /api/mcp: initialize (protocol 2024-11-05 and 2025-11-25 both accepted), tools/list (34 tools), and a read-only tools/call get_system_info.",
"operation_scope": "Backend MCP only. Frontend (ui/ npm install/build) not run. Requires an MCP API key, which was created in this guest via the install wizard and MCP activation. Write tools were not called. No browser or external credentials used.",
"steps": [
"Read README.md / README.en.md Quick Start and docs/guide/mcp-access-guide.md.",
"Verified pinned source matches https://codeload.github.com/anviod/edgeCore/tar.gz/4737ea86faf5db6e71e812be4d15093b70bbe36d (diff -rq clean).",
"Installed Go 1.26.4 from https://go.dev/dl/go1.26.4.linux-amd64.tar.gz into /tmp/goroot (go.mod requires go 1.26.4).",
"Ran `go mod tidy` in workspace (README Quick Start); go.mod/go.sum unchanged vs pinned source.",
"Built backend: `CGO_ENABLED=0 go build -trimpath -o /tmp/edgecore-build/edgeCore ./cmd/` (Makefile build target, output outside workspace).",
"Ran README command `go run cmd/main.go`; server listened on :8080 in install mode.",
"POST /api/install/validate and /api/install/start (install wizard) to create the local admin account in this disposable guest; install-status = completed.",
"Restarted `go run cmd/main.go`; logged in via GET /api/auth/nonce + POST /api/auth/login (sha256(password+nonce) per auth.go).",
"POST /api/mcp/activate with a random 256-bit key generated in the guest (/tmp/edgecore_mcp_key); /api/mcp/status shows mcp_enabled=true, mcp_api_key_set=true.",
"MCP: initialize, notifications/initialized, tools/list (34 tools), tools/call get_system_info returned channel_count and protocol list.",
"Stopped the test server (no leftover process on 8080/6060). Wrote .coldpass/probe.json (kind mcp_http) and ran check.py --validate: valid."
],
"deviations": [
"README `go mod tidy && go run cmd/main.go`: `go` not installed; apt provides golang-go 1.22 which is too old for go.mod (1.26.4). Ran go.dev tarball install instead.",
"Earlier failed run (stuck step dist/edgeCore, error 'Unsupported protocol version: 2025-06-18'): not reproduced. The current server accepts 2024-11-05 and 2025-11-25 and rejects nothing else in the initialize path. The earlier run appears to have used a client/checker sending 2025-06-18; the server's SupportedVersions() is [2024-11-05 2025-11-25] (internal/mcp/server.go:134). Test-side fault, not a source defect.",
"docs/guide/mcp-access-guide.md documents tool names with prefix `edgeCore_` (e.g. edgeCore_list_channels, edgeCore_get_system_info); the server actually exposes `list_channels`, `get_system_info`, and `ean_*` names (e.g. ean_list_points). Doc drift; not patched (source/README left unchanged per task).",
"Install wizard's default DNS proxy on UDP :53 fails with permission denied in the guest (non-fatal; logged as 'DNS proxy unavailable').",
"Frontend step `cd ui && npm install && npm run build` (README Quick Start) was not run; not needed for the MCP operation. NODE_USE_ENV_PROXY=1 exported for the Go/Node steps.",
"Runtime artifacts created in the workspace by the server: data/ (config db), logs/. No source files changed."
],
"stuck_step": None,
"main_blocker": None,
"suggested_fix": None
}
json.dump(report, open("<host-path>", "w"), indent=2, ensure_ascii=False)
EOF
python3 -I -c 'import json;json.load(open("<host-path>"));print("report ok")'; ls -la <host-path>; <env-var>=<host-path> python3 -I <host-path> --validate; ss -ltnp | grep -E ':8080|:6060' || echo ports-free
cd <host-path> && python3 -I - <<'EOF'
import json
p="<host-path>"
r=json.load(open(p))
r["deviations"][1]="Earlier failed run (stuck step dist/edgeCore, error 'Unsupported protocol version: 2025-06-18'): not reproduced with the current server. It accepts 2024-11-05 and 2025-11-25 (internal/mcp/server.go:134 SupportedVersions) and rejects 2025-06-18 by design. I did not see the earlier client's request, so the likely cause is a client sending 2025-06-18; that is a test/probe-side mismatch, not a source defect. Probe uses the checker's own initialize version range without 2025-06-18."
json.dump(r,open(p,"w"),indent=2,ensure_ascii=False)
EOF
python3 -I -c 'import json;json.load(open("<host-path>"));print("ok")'; <env-var>=<host-path> python3 -I <host-path> --validate