Allow §§secret() placeholders in MCP server config#1068
Open
QuantFoundry wants to merge 1 commit intoagent0ai:mainfrom
Open
Allow §§secret() placeholders in MCP server config#1068QuantFoundry wants to merge 1 commit intoagent0ai:mainfrom
QuantFoundry wants to merge 1 commit intoagent0ai:mainfrom
Conversation
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)"
}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.envand reference them via§§secret(KEY)in the MCP config:```json
"env": {
"FIRECRAWL_API_KEY": "§§secret(FIRECRAWL_API_KEY)"
}
```
Notes
settings.json), resolving against the globalusr/secrets.envviaget_default_secrets_manager()is the correct scopeget_secrets_manager()with the appropriate project contextTested
Verified with Firecrawl MCP — secret resolves correctly at startup, all 8 tools load successfully, no API token errors.