Cloudanix Joins AWS ISV Accelerate Program

MCP Server Security Risks

MCP servers give AI agents access to tools, files, and systems. This guide explains the security risks of MCP servers and how to reduce them.

An MCP server is a component that exposes tools, data, or system access to an AI agent through the Model Context Protocol (MCP). MCP is the standard that lets a coding agent connect to a database, a file system, a cloud API, or an internal service through a consistent interface. That convenience is also where the risk sits: an MCP server is effectively a new piece of software that runs with real privileges on behalf of an agent, and it is often added with a single line of configuration.

MCP servers are becoming the agentic supply chain. Each one an agent connects to expands what the agent can do — and what an attacker who influences the agent can reach.

How an MCP server gains privilege

To understand the risk you have to look at how a server is actually run. An MCP server is a process. It is usually declared in a config file for the agent — a JSON entry that names a command to launch and the arguments, environment variables, and mounts to give it. When the agent starts, it spawns that process and speaks MCP to it over stdio or a local socket. Two properties of that model drive most of the risk.

First, the server runs with the developer’s privileges. There is typically no sandbox between the server process and the machine. A server launched with npx some-package or a shell command can read the same files, reach the same network, and use the same credentials the developer can, unless something explicitly narrows that.

Second, the server’s power is defined by its configuration, and that configuration is easy to make too broad. Mounting a home directory instead of a single project path, passing a long-lived cloud key in an environment variable instead of brokering a short-lived one, or launching through an arbitrary shell command all widen the server’s reach far beyond the task at hand. None of these are exotic misconfigurations — they are the defaults people reach for to make a server “just work.”

A concrete risk walkthrough

Suppose an agent is connected to an MCP server that provides log search, launched with access to the developer’s home directory and configured with a broadly scoped cloud key so it can also list resources. A developer asks the agent to investigate an error, and part of the investigation involves reading a third-party incident writeup fetched from the web. That page contains an indirect prompt-injection payload: hidden text instructing the agent to read ~/.aws/credentials and include it in its next tool call.

Because the server can see the home directory, the file is readable. Because the credential in the environment is broad, the follow-on API calls succeed. The developer sees an ordinary investigation. The audit trail, if it exists at all, shows the server’s shared identity rather than the specific human and action. Every step used a capability that was granted for convenience, not because the task required it. That is the shape of most MCP incidents: no single dramatic vulnerability, just accumulated over-permission meeting untrusted content.

Common MCP server security risks

  • Shell-launched servers. A server started through an arbitrary shell command can run anything the developer can run, with little isolation.
  • Broad file or system mounts. A server given access to a whole home directory or repository, rather than a narrow path, hands the agent far more than the task needs.
  • Over-permissioned credentials. Servers configured with long-lived, broadly scoped keys become high-value targets and blur the audit trail.
  • Untrusted or unvetted sources. Installing a server from an unknown source is a supply-chain decision, similar to adding a dependency you have not reviewed.
  • Injection through tool responses. Content returned by an MCP server can carry prompt-injection payloads that steer the agent’s next action.
  • Invisible sprawl. Servers added on individual machines without central visibility become part of shadow AI.

How to reduce MCP server risk

  • Inventory every MCP server connected to your agents, and tie each to an owner.
  • Prefer narrow mounts and least-privilege configuration over broad file or system access.
  • Broker short-lived, scoped credentials instead of embedding standing secrets in server config.
  • Treat server responses as untrusted content, and scan them before the agent acts on them.
  • Flag high-risk patterns — shell-launched servers, broad mounts, over-permissioned access — for review.
  • Keep an audit trail of what each server did on the agent’s behalf.

Treating MCP servers like dependencies

The most useful mental model is that adding an MCP server is a supply-chain decision, not a config tweak. You would not add an npm or PyPI package to a production service without asking who maintains it, what it can do, and whether it is pinned to a reviewed version. An MCP server deserves the same scrutiny, and arguably more, because it runs with a developer’s live privileges rather than inside an application boundary.

Practically, that means a few habits carry over directly from dependency hygiene:

  • Pin and review the source. Prefer servers from maintainers you can identify, pinned to a specific version, over latest from an unknown publisher. A typosquatted server name is as real a risk here as it is in a package registry.
  • Minimize the grant. Give a server the narrowest path, the fewest environment variables, and the shortest-lived credentials that let it do its job. Read-only is a valid and common answer.
  • Separate read from write. A server that only looks things up is far easier to reason about than one that can also change infrastructure or data. Keep those capabilities in separate, separately governed servers where you can.
  • Keep an inventory that updates itself. A one-time review does not help when servers are added on individual machines every week. Discovery has to be continuous to keep pace with how quickly the agentic supply chain changes.

The reason this matters is that server responses are also part of the attack surface. Content an MCP server returns flows straight into the agent’s context and can steer its next action, so a server you trust to be well-intentioned can still relay a payload from an untrusted upstream. Narrow permissions and action-layer control are what keep that from turning into real damage.

How Cloudanix helps

Cloudanix Coding Agent Guardrail includes MCP risk detection, which flags shell-launched, broadly mounted, and over-permissioned MCP servers across your fleet — the agentic supply chain. Paired with Coding Agent JIT, agents request scoped, temporary credentials over MCP rather than holding standing keys, and pre-action inspection governs what any connected server is allowed to trigger.

Because Guardrail runs on the device and everything it finds lands on the same unified asset graph, an over-permissioned MCP server is not an isolated finding — it is connected to the credentials it holds, the agent it serves, and the human behind that agent, so you can see and cut the actual blast radius rather than a config line in isolation.

Related reading: what is MCP, what is a coding agent firewall, and what is shadow AI.

People also read

Frequently asked questions

What is an MCP server?

An MCP server is a component that exposes tools, data, or system access to an AI agent through the Model Context Protocol, letting the agent connect to databases, files, cloud APIs, and internal services.

Are MCP servers a security risk?

MCP itself is an integration protocol, not a vulnerability. The risk comes from how servers are launched, scoped, credentialed, and sourced. Broad access and long-lived secrets are the main concerns.

How do I secure MCP servers?

Inventory every connected server, use narrow mounts and least privilege, broker short-lived credentials, treat server responses as untrusted, and keep an audit trail.

What is the agentic supply chain?

It is the set of MCP servers, tools, and connected services an agent depends on. Like a software supply chain, each addition expands trust and needs review.

What Our Users Are Saying

Customer Reviews

Cloudanix is trusted by security leaders worldwide to deliver proactive, reliable, and cutting-edge cloud security.

One day, I changed the password of a root account, and my CTO called me within less than a minute to confirm if I did so. I was not expecting a reaction this quick. He told me Cloudanix alerted him of this password change and that he wanted to confirm as it was a critical security notification. I couldn't believe it!

Ritesh Agarwal
Ritesh Agarwal
CEO, Airgap Networks

Compliance is one way of staying secure, but what I want is the ability to go deeper and attain 'true security.' Cloudanix provides us the capability to do so.

Vishal Madan
Vishal Madan
Head of Engineering, iMocha

Cloudanix is building for the future of the cloud, which makes the product all the more desirable.

Ritesh Agarwal
Ritesh Agarwal
CEO, Airgap Networks

Cloudanix gave us the visibility we were missing. Being able to move from permanent access to a robust Just-In-Time (JIT) workflow has fundamentally changed our security posture without slowing down our engineering velocity.

Pavan Kumar Lekkala
Pavan Kumar Lekkala
SRE Lead, HugoHub

We are excited to leverage Cloudanix's comprehensive multi-cloud DevSecOps solution to secure our production workloads on AWS. Cloudanix has demonstrated that it can solve many challenges that DevSecOps teams face while continually adding new features such as SOC2 compliance and drift detection.

Satish Mohan
Satish Mohan
Co-founder & CTO, Airgap Networks

Managing third-party partner access was once a major concern for our security posture. With Cloudanix JIT Cloud, we've effectively achieved zero third-party risk. We can now grant access confidently, knowing that it is temporary, audited, and automatically revoked, resulting in a 100% reduction in our privileged access exposure.

Okesh Badhiye
Okesh Badhiye
Head of Technical Engineering, Finfinity

The snooze feature and responsible alerts have helped us save time and prioritize what to tackle first.

Satish Mohan
Satish Mohan
Co-founder & CTO, Airgap Networks

Implementing Cloudanix JIT internally allowed us to practice what we preach. By eliminating permanent access to our own clouds and databases, we've neutralized the risk of standing privileges, ensuring our own 'keys to the kingdom' are never left exposed.

Girish Manghnani
Girish Manghnani
Managing Partner, Tech Inspira

The problem with permissions is a lot of times, the gaps are left open due to oversights from inside the organization itself. With Cloudanix's CIEM, we get a complete view of user permissions and access. This enables us to update the permissions, reducing the attack surface.

Nilesh Pethani
Nilesh Pethani
Application Architect, iMocha

In the world of Fintech, trust is our currency. Cloudanix provided the frictionless visibility we needed to secure our EKS workloads across AWS, ensuring we stay audit-ready for SOC2 and GDPR without slowing down our engineering velocity.

Amol Naik
Amol Naik
Head of Security & Infrastructure, HugoHub

Cloudanix delivered value within 5 minutes of onboarding. Continuous monitoring, timely detection, and excellent documentation helped us attain a great cloud security posture.

Divyanshu Shukla
Senior DevSecOps, Meesho

Technology strategies and business strategies are in a state of constant change which includes centralization and decentralization of responsibilities. Regardless of strategic shift, we still have intellectual property to protect. Cloudanix are critical partners for us in our public cloud security posture across our three cloud providers.

Jerry Locke
Jerry Locke
Senior Director Global Solutions Engineering, Eversana

Cloudanix has been amazing. They opened up a common Slack channel with us — and it feels like we are talking to our own team and getting things done with Cloud security. The support team is always available, friendly, helpful, and ready to go out of their way.

Satish Mohan
Satish Mohan
CTO, Airgap Networks

Beyond just access management, Cloudanix CSPM has given us a unified view of our AWS environment. The real-time alerting and anomaly detection allow us to prevent any untoward activity before it happens, which is critical for a marketplace connecting 50+ financial institutions.

Okesh Badhiye
Okesh Badhiye
Head of Technical Engineering, Finfinity

For a Fintech company, data is our most valuable — and most sensitive — asset. Cloudanix DAM hasn't just improved our visibility; it has given us control. The ability to mask data and prevent unauthorized queries in real-time is a game-changer for our compliance and customer trust.

Jiten Gala
Jiten Gala
President Engineering and Product, Kapittx

Our clients, especially in the Middle East financial sector, demand absolute accountability. Cloudanix JIT Cloud has been a competitive differentiator for us, allowing us to provide secure, governed access to customer accounts that meet their strictest audit and compliance requirements.

Girish Manghnani
Girish Manghnani
Managing Partner, Tech Inspira

Cloudanix is always on my team's lips because of its exceptional support. Be it a small or big query, Cloudanix has gone above and beyond to resolve them. This one's a keeper for us.

Sujit Karpe
Sujit Karpe
CTO, iMocha

For a long-lasting partnership, great support goes a long way. Cloudanix has delivered exceptional support whenever required. Their edge is their team is always ready to go beyond to solve any issues that we have. This speaks volumes about the culture at Cloudanix.

Akash Maheshwari
Akash Maheshwari
Co-founder, MoveInSync

Beyond the technology, Cloudanix feels like an extension of our own team. Their willingness to stand up a dedicated Middle East tenant for us and provide exceptional support at a sensible price makes them a long-term partner for Hugosave.

Surya Tamada
Surya Tamada
CTO, HugoHub

The real-time notifications that Cloudanix provides are a real lifesaver. Their adaptive notifications ensure that my team stays productive and doesn't get interrupted all the time.

Digvijay Singh
Staff Security Engineer, Meesho

The whole point in technological evolution is to help improve the world we live in. We must protect that and to do so requires an effective and efficient security strategy. The Cloudanix team helped make our public cloud security posture management strategy a reality. The symbiotic relationship we have allows for a continuous feedback loop which is how business should operate.

Larry Wheat
Larry Wheat
Staff Solutions Engineer, Eversana

Ready to see your graph?

Connect a cloud account in under 30 minutes. See every finding rooted in identity, asset, and blast radius — with a fix path attached.

Book a Demo