Your AI Agent Just Leaked Your API Keys: Fixing MCP's Secrets Problem
If you're building with Model Context Protocol (MCP), you've probably hit this wall: your AI agent needs access to databases, APIs, and cloud services — but how do you pass secrets to MCP servers without hardcoding them in config files? Most MCP setups today look like this: { "mcpServers" : { "database" : { "command" : "npx" , "args" : [ "-y" , "@my/mcp-server" ], "env" : { "DB_PASSWORD" : "super-secret-password-in-plaintext" } } } } That plaintext password sits in a JSON file on disk. It gets committed to git repos. It shows up in process environment listings. It's a security nightmare that gets worse as you add more MCP servers. The Scale of the Problem A typical MCP setup might connect to 5-10 servers: a database, a code search tool, a deployment service, cloud APIs, etc. Each one needs credentials. Multiply that across a team, and you have secrets scattered everywhere — config files, environment variables, shell history, CI/CD configs. In traditional software, we solved this with t
Continue reading on Dev.to JavaScript
Opens in a new tab



