diff --git a/Cargo.lock b/Cargo.lock index e83e90d..61f1cb1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1949,7 +1949,7 @@ dependencies = [ [[package]] name = "secrets-mcp" -version = "0.1.4" +version = "0.1.5" dependencies = [ "anyhow", "askama", diff --git a/crates/secrets-mcp/Cargo.toml b/crates/secrets-mcp/Cargo.toml index e903ec5..c776749 100644 --- a/crates/secrets-mcp/Cargo.toml +++ b/crates/secrets-mcp/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "secrets-mcp" -version = "0.1.4" +version = "0.1.5" edition.workspace = true [[bin]] diff --git a/crates/secrets-mcp/templates/dashboard.html b/crates/secrets-mcp/templates/dashboard.html index 04be739..c6e50d6 100644 --- a/crates/secrets-mcp/templates/dashboard.html +++ b/crates/secrets-mcp/templates/dashboard.html @@ -535,12 +535,14 @@ function buildOpencodeEntry(apiKey, encKey) { }; } +/** Full OpenCode config: MCP servers live under top-level `mcp`. */ function buildOpencodeConfigText(apiKey, encKey) { - return JSON.stringify({ secrets: buildOpencodeEntry(apiKey, encKey) }, null, 2); + return JSON.stringify({ mcp: { secrets: buildOpencodeEntry(apiKey, encKey) } }, null, 2); } +/** Strip outer `{` `}` so user can paste `secrets` under an existing `mcp` object. */ function buildOpencodeMergeSnippet(apiKey, encKey) { - const wrapped = buildOpencodeConfigText(apiKey, encKey); + const wrapped = JSON.stringify({ secrets: buildOpencodeEntry(apiKey, encKey) }, null, 2); const lines = wrapped.split('\n'); return lines.length < 3 ? wrapped : lines.slice(1, -1).join('\n'); }