Repository navigation
Description
Problem
Standalone mecated reads EXA_API_KEY from the server process environment. Operators cannot configure that key through Mecatl's existing auth.yaml credential file, unlike other API keys.
Embedded mecatui also has a credential-wiring bug: exporting EXA_API_KEY before launching mecatui does not populate the embedded server's app.Config.ExaAPIKey, so it still selects anonymous Exa.
The anonymous Exa backend can be intermittently unavailable or rate-limited, making a paid key useful, but requiring a separate environment-based setup is inconsistent with the existing credential workflow.
Requested change
Support storing the Exa API key in auth.yaml alongside other API keys, and fix embedded mecatui to resolve and pass search credentials through the same path as standalone servers. Keep secret values out of settings.yaml, project configuration, logs, diagnostics, and generated references.
Expected behavior
- The built-in Exa search backend can authenticate using an Exa key from the configured API-key credential file, including the conventional
auth.yamllocation. - Embedded mecatui and standalone/server deployments use the same credential-resolution path.
- Regression-test the actual embedded startup path: an injected environment key reaches the constructed Exa provider and its request without exposing the key. A helper-only resolver test is insufficient.
- Diagnose the selected search backend and authenticated/anonymous mode through non-secret metadata; never print the key or secret-bearing request URL.
- Existing
EXA_API_KEYbehavior remains compatible; document and test precedence when both environment and file credentials exist. - No configured key preserves anonymous Exa behavior.
- A malformed/unreadable explicitly configured credential source follows the existing credential-store failure policy rather than silently downgrading to anonymous search.
- Offline tests cover file credential loading, precedence, anonymous fallback, and secret-safe reporting without network calls or operator-state access.
- Update the web-search configuration documentation and existing credential-management guidance as appropriate.
Current implementation
cmd/mecated/main.go:1992 reads EXA_API_KEY; internal/app/build.go selects and constructs the search provider. There is currently no Exa entry in the shared API-key file resolution path.
Embedded mecatui reproduction and source evidence
- Export
EXA_API_KEYin the launching shell (do not include its value in issue reports). - Launch a fresh mecatui with its embedded server.
- Invoke
WebSearch; it still receives Exa's free-MCP rate-limit response.
Observed with client/server build v0.0.47-10-g024ba883a, embedded server implementation mecatui.
The diagnostic report confirms embedded mode but does not expose search backend/authentication mode.
At that revision, embeddedConfig does not populate ExaAPIKey from the environment, and the shared search factory constructs Exa using only cfg.ExaAPIKey.
That leaves embedded mecatui anonymous even when the process inherits the key.
This request is for built-in Exa credentials, not the separately proposed Parallel Search backend in #2141.
Activity
[-]Support Exa WebSearch API keys in auth.yaml[/-][+]Support Exa keys in auth.yaml and fix embedded mecatui credential wiring[/+]