---
title: "MCP Security: A Developer’s Guide"
description: "MCP servers expand what AI agents can do but introduce risks across four categories: misconfigurations and weak defaults, malicious or compromised servers, secret leakage, and prompt injection or tool poisoning."
url: "https://swe.quest/articles/mcp-security-a-developer-s-guide-ee8f7d25fd64b2f2"
canonical: "https://www.docker.com/blog/mcp-security-explained/"
source: "Docker"
published: "2025-09-16"
difficulty: "easy"
kind: "How-to"
reading_minutes: 8
tags: ["ai-agents","security","supply-chain-security","containers"]
---

# MCP Security: A Developer’s Guide

A post on [Docker](https://swe.quest/sources/docker.md), published 2025-09-16, 8 min read, How-to. Original: [https://www.docker.com/blog/mcp-security-explained/](https://www.docker.com/blog/mcp-security-explained/)

## Summary

MCP servers expand what AI agents can do but introduce risks across four categories: misconfigurations and weak defaults, malicious or compromised servers, secret leakage, and prompt injection or tool poisoning. One cited analysis found command injection flaws in 43% of MCP servers examined. Static AppSec tools miss these risks because agent behavior is non-deterministic and models can treat tool descriptions as instructions. The recommended guardrails are to containerize each server with resource and egress limits, route calls through a policy gateway that verifies signatures, enforces allowlists, redacts secrets, runs pre- and post-call interceptors and logs every call, and pin vetted servers by digest. Docker positions its MCP Gateway and MCP Catalog & Toolkit as the implementation.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [AI agents](https://swe.quest/tags/ai-agents.md) (AI & ML)
- [Security](https://swe.quest/tags/security.md) (Security)
- [Supply chain security](https://swe.quest/tags/supply-chain-security.md) (Security)
- [Containers](https://swe.quest/tags/containers.md) (Infrastructure)

## Prerequisites

- Model Context Protocol basics
- Docker containers ([easy posts on Containers](https://swe.quest/tags/containers.md?difficulty=easy))

## Keywords

Model Context Protocol, Docker MCP Gateway, Docker MCP Catalog, MCP Toolkit, CVE-2025-6514, CVE-2025-49596

## Related posts

- [MCP Horror Stories: The Security Issues Threatening AI Infrastructure](https://swe.quest/articles/mcp-horror-stories-the-security-issues-threatening-ai-infrastructure-11571cbab816ae96.md): Docker · 2025-07-31 · Medium · 10 min read · AI agents, Security, Supply chain security, Containers, Sandboxing & isolation
  MCP servers expose AI agents to six recurring vulnerability classes: OAuth discovery flaws (e.g. CVE-2025-6514 in mcp-remote), command injection (reported in 43% of analyzed servers), unrestricted network fetches (33%), file path leakage (22%), tool poisoning (5.5%) and plaintext secret exposure.
- [Securing Model Context Protocol: Safer Agentic AI with Containers](https://swe.quest/articles/securing-model-context-protocol-safer-agentic-ai-with-containers-f3a8a077a2aa77b5.md): Docker · 2025-05-06 · Easy · 9 min read · AI agents, Sandboxing & isolation, Supply chain security, Containers
  Running MCP servers via npx on the host with plaintext environment-variable secrets leaves agentic tooling exposed to supply-chain tampering, credential leakage, and attacks such as rug pulls, tool shadowing, and tool poisoning.
- [Docker MCP Gateway: Open Source, Secure Infrastructure for Agentic AI](https://swe.quest/articles/docker-mcp-gateway-open-source-secure-infrastructure-for-agentic-ai-8fe8cf36e09a039e.md): Docker · 2025-07-09 · Medium · 3 min read · AI agents, Containers, Security, Open source
  Docker's MCP Gateway, now open source, is a single enforcement point between AI agents and the MCP servers they call, aggregating multiple containerized servers behind one interface and integrating with Docker Compose.
- [5 Best Practices for Building, Testing, and Packaging MCP Servers](https://swe.quest/articles/5-best-practices-for-building-testing-and-packaging-mcp-servers-156585fac07369be.md): Docker · 2025-07-03 · Medium · 7 min read · AI agents, Containers, API design, Testing
  MCP servers work best when designed around the agent as the real caller: keep a small "tool budget" by grouping endpoints into use-case tools and prompts instead of one tool per API endpoint, and return error messages that tell the agent what to fix (e.g., an invalid API\_TOKEN configuration) rather than human-facing denials.
- [Dynamic MCPs with Docker: Stop Hardcoding Your Agents’ World](https://swe.quest/articles/dynamic-mcps-with-docker-stop-hardcoding-your-agents-world-a530a7120388ea63.md): Docker · 2025-11-06 · Medium · 11 min read · AI agents, LLMs, Sandboxing & isolation, Containers, Developer tools
  Docker MCP Gateway now exposes primordial tools (mcp-find, mcp-add) that let agents search a curated catalog of 270+ MCP servers, add them to the live session, and trigger OAuth or elicitation flows, instead of hand-editing JSON config and restarting.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
