Skip to content

Allow §§secret() placeholders in MCP server config#1068

Open
QuantFoundry wants to merge 1 commit intoagent0ai:mainfrom
QuantFoundry:fix/mcp-secret-placeholders
Open

Allow §§secret() placeholders in MCP server config#1068
QuantFoundry wants to merge 1 commit intoagent0ai:mainfrom
QuantFoundry:fix/mcp-secret-placeholders

Conversation

@QuantFoundry
Copy link

Problem

API keys for external MCP servers (e.g. Firecrawl, GitHub) must currently be hardcoded directly in the MCP config JSON in settings. Agent Zero's §§secret(KEY) placeholder system — used everywhere else in the codebase (prompts, tools, etc.) — was never wired up to MCP config parsing.

Fix

Resolve secret placeholders before passing the config string to MCPConfig.update(). One call, five lines.

Users can now store MCP API keys securely in secrets.env and reference them via §§secret(KEY) in the MCP config:

```json
"env": {
"FIRECRAWL_API_KEY": "§§secret(FIRECRAWL_API_KEY)"
}
```

Notes

  • Since MCP servers are configured globally (settings.json), resolving against the global usr/secrets.env via get_default_secrets_manager() is the correct scope
  • If per-project MCP server config is ever introduced, this should be updated to use get_secrets_manager() with the appropriate project context

Tested

Verified with Firecrawl MCP — secret resolves correctly at startup, all 8 tools load successfully, no API token errors.

API keys for external MCP servers (e.g. Firecrawl, GitHub) had to be
hardcoded directly in the MCP config JSON, since the §§secret(KEY)
placeholder system used everywhere else in Agent Zero was never wired
up to MCP config parsing.

Resolve secret placeholders before passing the config string to
MCPConfig.update() so users can store MCP API keys securely in
secrets.env and reference them as §§secret(KEY) in the MCP config:

    "env": {
        "FIRECRAWL_API_KEY": "§§secret(FIRECRAWL_API_KEY)"
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments