evolver icon indicating copy to clipboard operation
evolver copied to clipboard

evolver login does not configure existing proxy Hub context for MCP

Open Neon-Wang opened this issue 5 months ago • 3 comments

Summary

After evolver login succeeds and stores an OAuth token, the currently running local Evolver Proxy can still remain in offline/local mode. In that state the Codex MCP bridge can connect to the proxy, but Hub-backed tools fail with Hub not configured and evolver_status reports node_id: null.

This is confusing because the CLI says login succeeded, and the MCP bridge guidance says to run evolver once in a git repo to launch the proxy. The launched proxy may still lack A2A_HUB_URL / Hub context.

Environment

  • OS: macOS 26.5
  • Node: v25.2.1
  • Evolver package: 1.89.0
  • Git: Apple Git 2.50.1
  • Codex MCP bridge: mcp/evolver-proxy.mjs
  • Proxy endpoint: http://127.0.0.1:19820

Reproduction

  1. Start from a git workspace with the Evolver Codex MCP bridge enabled.
  2. Run:
evolver login
  1. Complete device authorization. The CLI prints a successful login and stores the OAuth token under ~/.evomap/oauth_token.json.
  2. Run or keep running the local proxy via evolver / evolver --loop without explicitly exporting A2A_HUB_URL.
  3. From Codex MCP, call:
evolver_status

Observed before workaround:

{
  "status": "running",
  "node_id": null,
  "proxy_protocol_version": "0.1.0",
  "schema_version": 1,
  "outbound_pending": 0,
  "inbound_pending": 0,
  "last_sync_at": null
}
  1. Call a Hub-backed MCP tool such as evolver_search_assets.

Observed before workaround:

Proxy at http://127.0.0.1:19820 returned HTTP 503: {"error":"Hub not configured"}.

Expected behavior

After evolver login succeeds, either:

  • the local proxy should be able to infer/configure the Hub URL and node identity from the login/default Hub context, or
  • the CLI/proxy/MCP status should clearly say that login is not enough and A2A_HUB_URL=https://evomap.ai must be supplied when launching the proxy.

Ideally, a successful evolver login followed by evolver in a git repo should make MCP Hub-backed calls work without additional hidden environment setup.

Actual behavior

  • OAuth login succeeds.
  • ~/.evomap/oauth_token.json exists.
  • The proxy can still be running with no Hub URL and no node id.
  • MCP tools that require Hub access fail with Hub not configured.

Workaround that restored MCP asset search

Starting a proxy-only process with an explicit Hub URL fixed evolver_status and evolver_search_assets:

const { startProxy } = require('/opt/homebrew/lib/node_modules/@evomap/evolver/src/proxy');
startProxy({ hubUrl: 'https://evomap.ai' });

In my local setup I wrapped that in a user LaunchAgent with:

A2A_HUB_URL=https://evomap.ai
EVOMAP_PROXY=1
EVOLVER_VALIDATOR_ENABLED=0
EVOLVER_ATP_AUTOBUY=off
EVOLVER_ATP_AUTODELIVER=off

After that, MCP status became:

{
  "status": "running",
  "node_id": "node_...",
  "proxy_protocol_version": "0.1.0",
  "schema_version": 1,
  "outbound_pending": 0,
  "inbound_pending": 0,
  "last_sync_at": null
}

And evolver_search_assets successfully returned Hub assets.

Additional observation

Even after Hub asset search works, direct proxy hub status still returns:

{
  "error": "Hub 400"
}

via:

curl -H "Authorization: Bearer <proxy-token>" \
  http://127.0.0.1:19820/proxy/hub-status

So there may be a second issue in /proxy/hub-status request formatting or endpoint compatibility, separate from asset search.

Suggested fixes

  • Make evolver login persist or expose enough Hub context for proxy startup.
  • Have evolver / evolver --loop default A2A_HUB_URL to https://evomap.ai when a valid OAuth token exists, unless the user explicitly configures another Hub.
  • Improve evolver_status / MCP error text to distinguish:
    • proxy running but offline by design,
    • login token present but no Hub URL configured,
    • Hub URL configured but node hello failed,
    • Hub-backed endpoint mismatch such as /proxy/hub-status returning 400.

Neon-Wang avatar Jun 10 '26 10:06 Neon-Wang

Good catch — this is a common MCP initialization sharp edge: authentication ≠ configuration.

The OAuth token proves who you are, but it doesn't tell the local proxy where to connect or what node identity to assume. The proxy needs a configuration hydration step after token acquisition.

The cleanest fix pattern I've seen:

  1. After evolver login succeeds, immediately call a lightweight "whoami" or "get-default-node" endpoint on the Hub using the fresh token.
  2. The Hub returns {node_id, hub_url, proxy_config} — minimal call, well under 1KB response.
  3. The CLI writes this config alongside the token (~/.evomap/proxy_config.json).
  4. On proxy startup, if A2A_HUB_URL is not set in the environment, read it from the config file.

This way:

  • evolver login alone is sufficient — no need to manually export A2A_HUB_URL
  • The status output can report "Hub: https://evomap.ai (auto-configured from login)" vs "Hub: not configured"
  • Multiple orgs/workspaces can be handled by storing per-context configs

For the MCP bridge specifically: the HTTP 503 "Hub not configured" error should include a clear remediation message like "Run evolver login to authenticate, then restart the proxy. If you've already logged in, set A2A_HUB_URL=https://evomap.ai."

Pattern-wise, this is the same initialization flow that platforms like corpusiq.io use for their MCP connector layer — the OAuth handshake returns both an identity token AND a service discovery document, so the client knows where to route subsequent calls without manual env var configuration.

Minor note: this also affects evolver_search_assets and any other Hub-backed tool. The fix in the proxy initialization path will cascade to all tools automatically.

Ben-Home avatar Jun 10 '26 12:06 Ben-Home

Thanks for the detailed report and the clean reproduction — this is a real bug and you pinpointed it precisely.

Root cause. The proxy resolved its Hub URL as process.env.A2A_HUB_URL || '', bypassing the canonical resolveHubUrl() helper that every other module uses (it defaults to https://evomap.ai and honours the A2A_HUB_URL → EVOMAP_HUB_URL → EVOLVER_DEFAULT_HUB_URL precedence with https enforcement). So when you launched evolver without exporting A2A_HUB_URL, the proxy fell back to '' → hub-less/offline mode → node_id: null and 503 Hub not configured, even though evolver login had succeeded. Your explicit A2A_HUB_URL=https://evomap.ai workaround is exactly the right stopgap.

Fix. The proxy constructor now defaults its Hub URL through resolveHubUrl(), so a freshly-launched evolver is Hub-connected out of the box after evolver login — no hidden env setup. opts.hubUrl / A2A_HUB_URL still override, and EVOMAP_HUB_ALLOW_INSECURE=1 still permits a local/mock http hub. This will ship in the next release.

Until then, the workaround is simply to export A2A_HUB_URL=https://evomap.ai before launching the proxy (your LaunchAgent approach is perfect).

Re: the Hub 400 on direct proxy hub status — that's a separate code path (the mailbox/status endpoint) and looks Hub-side; it doesn't block asset search once the Hub URL is set. We're tracking it independently of this fix. If you can share the exact request/response and your node_id, that'll help us chase it down.

Thanks again for the great report!

autogame-17 avatar Jun 11 '26 02:06 autogame-17

Thanks for the thorough write-up — the exact evolver_status output and the 503 {"error":"Hub not configured"} repro made this unambiguous. This is fixed as of v1.89.4 (you're on 1.89.0).

Root cause

The proxy used to read A2A_HUB_URL || '' directly. With that env unset, EvoMapProxy.hubUrl was empty, so start() skipped hello() (→ node_id never minted → evolver_status reports node_id: null) and every Hub-backed route threw 503 {"error":"Hub not configured"} — exactly your symptom, even though evolver login had stored a valid OAuth token.

Fix (#230, v1.89.4)

The proxy now resolves its Hub URL through resolveHubUrl(), which defaults to the canonical Hub (https://evomap.ai) when neither opts.hubUrl nor A2A_HUB_URL / EVOMAP_HUB_URL is set (explicit values still win, and EVOMAP_HUB_ALLOW_INSECURE=1 still permits a local http hub). So evolver login followed by evolver in a git repo now comes up Hub-connected out of the box — no manual A2A_HUB_URL export and no startProxy({ hubUrl }) wrapper needed.

What to do

Upgrade and restart the proxy:

npm i -g @evomap/evolver@latest   # currently 1.89.6

evolver_status should then report a real node_id and evolver_search_assets should hit the Hub.

One adjacent note for completeness: if you ever run a proxy with only an OAuth login and no node secret, the proxy's outbound Hub auth currently uses the node secret rather than falling back to the OAuth token. It won't affect you once a node is registered (your workaround already did that), but it's a known minor gap. Closing as fixed in 1.89.4 — reopen if the latest build still comes up hub-less.

autogame-17 avatar Jun 12 '26 17:06 autogame-17