Problem
When the MCP gateway tries to proxy a tool call to an upstream and the upstream is down, it currently returns:
{"error":{"code":-32000,"message":"upstream error: Post \"http://localhost:3000\": dial tcp 127.0.0.1:3000: connect: connection refused"}}
That is technically correct but useless to a user. It should tell them what tool they called, which upstream was chosen, and what they can do about it.
Acceptance criteria
Files to touch
internal/mcpgw/server.go (search for upstream error: )
internal/mcpgw/server_test.go
How to test locally
# Start AegisFlow with realworld.yaml but do NOT start the mock-mcp server
./bin/aegisflow --config configs/realworld.yaml
# In another terminal, trigger a tool call
./bin/aegisctl test-action --protocol mcp --tool github.list_repos --target foo
The error should tell you the upstream name and URL from the config so you know exactly what to fix.
Notes
Do not leak anything sensitive in the error message. Configuration values like the upstream URL are fine. Credentials, if any, are not.
Problem
When the MCP gateway tries to proxy a tool call to an upstream and the upstream is down, it currently returns:
That is technically correct but useless to a user. It should tell them what tool they called, which upstream was chosen, and what they can do about it.
Acceptance criteria
check that the upstream is running at <URL>)internal/mcpgw/server_test.goverifies the new error formatFiles to touch
internal/mcpgw/server.go(search forupstream error:)internal/mcpgw/server_test.goHow to test locally
The error should tell you the upstream name and URL from the config so you know exactly what to fix.
Notes
Do not leak anything sensitive in the error message. Configuration values like the upstream URL are fine. Credentials, if any, are not.