One entryMerged PR· StuMason/coolify-mcp· TypeScript
PR #272 merged: fix: honor key filter on env_vars list so reveal exposes only the requested variable
additions
+74
deletions
-5
files changed
2
Fixes #271
Problem
The env_vars tool schema accepts key on every action, but the list branches ignored it and always returned the full env list. Combined with reveal: true, a caller asking "what is FLAG set to?" received every secret on the resource (API keys, DB passwords, private keys) in plaintext into the MCP client context.
Fix
action=listnow filters the response to the requestedkeyacross all three resources (application / service / database). Filtering happens in the tool handler after the client fetch, so it applies to both masked and revealed projections.- Tool description documents the
key+revealpattern ("always combine reveal with key so only the requested value is exposed"). - Behaviour without
keyis unchanged (full list, masked by default).
Tests
Three new cases in mcp-server.test.ts:
list+keyreturns only the matching variable (application)list+key+reveal— response contains the requested value and does not contain the other variable's plaintext (service)listwithoutkeystill returns all variables (database)
npm test — 420 passed, npm run lint — 0 errors, prettier clean.
🤖 Generated with Claude Code