3 MCP server failure modes that bit us in production, and how we ship around them
The article discusses three critical failure modes encountered when using MCP servers in production, particularly within AI agent systems handling customer codebases and environments. These issues include built-in tools bypassing sandboxed file access, environment variable leaks, and tool shadowing that compromise security and isolation. The author shares real-world fixes implemented in their SaaS platform to mitigate these risks and ensure safer, more predictable agent behavior.
- ▪Built-in tools like Read and Bash can shadow custom MCP tools, allowing agents to bypass sandboxed file access unless explicitly disabled.
- ▪Environment variables from the parent process can leak into MCP child processes, potentially exposing sensitive data in prompts.
- ▪The author's solution involves explicitly disallowing built-in tools and reinforcing access rules in system prompts to maintain strict boundaries.
- ▪Their production setup uses scoped MCP servers for file access, browser automation, and repository navigation while preventing privilege escalation.
- ▪Failure modes emerged only after deployment to real customer environments, highlighting gaps not covered by specifications.
Opening excerpt (first ~120 words) tap to expand
try { if(localStorage) { let currentUser = localStorage.getItem('current_user'); if (currentUser) { currentUser = JSON.parse(currentUser); if (currentUser.id === 3902826) { document.getElementById('article-show-container').classList.add('current-user-is-article-author'); } } } } catch (e) { console.error(e); } Takayuki Kawazoe Posted on May 2 3 MCP server failure modes that bit us in production, and how we ship around them #mcp #claude #python #devops MCP feels easy until it isn't. The first time you wire up a stdio server and call a tool from a Claude Agent SDK loop, the whole thing fits on a slide. Then you put it in front of customer codebases, customer GitHub credentials, customer build containers, and the sharp edges show up in places the spec is silent on.
…
Excerpt limited to ~120 words for fair-use compliance. The full article is at DEV Community.