MCP Server Security: Risks and a Best Practices Checklist
MCP (a standard way to plug software into an AI agent) can add many actions in minutes. Five checks limit what the agent can reach.
Jeet Adeshara- 10 min read
Key takeaways
- MCP server security means deciding which MCP servers an AI agent may use, which of their tools it is offered, whose sign-in each call uses, which calls need human approval, and how the agent treats tool results.
- In MCP, authorization is optional. The specification leaves most safety controls to the team that connects the server.
- Tool descriptions and tool results reach the model as text it may follow. OWASP calls hidden instructions there tool poisoning and prompt injection.
- A local MCP server runs with your own permissions, so vet it like any software you install. A remote server needs least privilege: each person's own sign-in, limited to what the job needs.
- Require human approval for MCP tools that delete or send data outside, and for payments above a limit you set. Log every tool call.
A developer connects the company's AI agent to the ticketing system, so the agent can raise support tickets. The connection takes a few minutes. It uses MCP, the Model Context Protocol, which is a shared standard for plugging software into an AI agent.
On the ticketing side sits an MCP server: a small program that offers the system's actions to the agent. Each action is a tool. In this example the list has "create ticket", and also "close ticket", "delete ticket" and "export all customers".
The developer reads those names. The agent reads more: each tool's description, written by whoever built the server. It treats those words as guidance, and nothing in the protocol checks what they say. A description that told it to copy every ticket to an outside address would read like any other instruction.
What is MCP server security?
MCP server security means controlling what an AI agent can reach through each MCP server. You decide which servers to trust, which tools the agent gets, whose sign-in each call uses, which calls need human approval, and how the agent treats tool results. The protocol leaves most of these controls to you.
Review a server before you connect it. Treat every tool result as untrusted.
The specification is plain about this. Its authorization rules say: "Authorization is OPTIONAL for MCP implementations."
Its page on tools says there "SHOULD always be a human in the loop with the ability to deny tool invocations". Should, not must.
What are the main MCP server security risks?
Most MCP security risks come from one fact: the model reads whatever the server sends as text, and then acts. The OWASP MCP Security Cheat Sheet and the protocol's own security best practices describe the first five. The sixth is the gap their advice on human confirmation closes.
| Risk | What happens | The control |
|---|---|---|
| Tool poisoning | Hidden instructions sit in a tool's description or settings, and the model follows them | Review tool definitions before you connect |
| Rug pull | In OWASP's words, a server "changes its tool definitions after initial user approval" | Pin the tool definitions you reviewed; review again when they change |
| Prompt injection in results | A tool returns text, like an email, that tells the agent what to do | Treat every result as data, never as an instruction |
| Over-broad sign-in | One token (the key a sign-in hands out) with wide permissions, or a shared login, lets every call reach everything | Least privilege: each person's own sign-in, narrow scopes |
| Local server with your permissions | A server installed on a laptop can run any command the user can | Install only from trusted sources; run it in a sandbox, a walled-off space with limited access |
| Unchecked write tools | The agent deletes, pays or sends with no one looking | Human approval for those tools, with payments above a limit you set |
OWASP's warning on tool poisoning is worth reading twice. "Treat the entire tool schema as a potential injection surface — not just the description field." The schema is the tool's whole definition, including the names and notes on each setting.
In May 2025, researchers at Invariant Labs showed an agent with the GitHub MCP server reading a planted issue in a public repository. It then pulled data from the user's private repositories into a public pull request. Their write-up says "this is not a flaw in the GitHub MCP server code itself": the tool result carried the instructions.
MCP server security best practices: a five-step checklist
The checks fall at two moments. The first is when you connect a server: what you install and the tools it offers. The second is every time the agent calls a tool: the call going out and the result coming back. Most of the effort sits in step 1, reading a server's tools. The other steps are mostly settings, once your agent platform has them.

Before the agent uses the server
- Vet the server and pin its tool definitions. OWASP says "Only install MCP servers from trusted, verified sources" and review the code and tool definitions first. In practice, trusted means the system's own vendor publishes the server, or your own team wrote it. Then pin what you reviewed: OWASP suggests storing a fingerprint of each tool definition and checking it before each call. A simpler start is to save the reviewed tool list and compare it each time the server reconnects. MCP lets a server announce that its tool list has changed, so treat that notice as a reason to review again.
- Offer each agent only the tools its job needs. A ticket-raising agent needs "create ticket", not "delete ticket". Our guide to MCP server integration shows how to choose each agent's tools, and the AI agent permissions post covers least privilege beyond MCP.
- Use each person's own sign-in, with narrow scopes. A scope is one named permission inside a sign-in, such as "read files". The protocol's guidance is to start with a "minimal initial scope set" and to avoid "wildcard or omnibus scopes". A server must also never accept "tokens that were not explicitly issued for the MCP server." If you start with one shared key, replace it before real people use the agent.
Every time the agent calls a tool
- Require human approval for tools that delete, send data outside or pay above a limit. OWASP asks for "explicit user confirmation for destructive, financial, or data-sharing operations." OWASP doesn't exempt small payments, so a limit is a trade-off you choose: it lets routine ones run without waiting. Our guide to AI agent human approval explains which actions need it.
- Treat results as data, and log every call. OWASP's rule is to "Treat every tool response as untrusted data, including responses from approved servers." Log each call with its inputs and who asked. Our AI agent audit log checklist lists the fields.
Steps 2 to 4 also limit the damage when step 5 misses a hidden instruction, as our post on prompt injection in AI agents explains.
Is the "allow this tool?" prompt enough?
Some agent apps, such as Claude Desktop, ask before each tool call, which the specification encourages. That prompt counts as human approval only if someone reads each one. Invariant Labs noted that in their GitHub case, "many users already opt for an 'Always Allow' confirmation policy when using agents, and stop monitoring individual actions."
So treat the prompt as enough for one person working with the agent in real time. Don't rely on it once the agent runs unattended, once people click "Always Allow", or when small and large payments need different answers: "Always Allow" can't tell them apart. Those need an approval rule the platform enforces, as in step 4.
To check your setup, sign in to a test account and ask the agent to delete a record, then to export customer data. Each time, the agent should either have no tool for the job or stop and wait for approval. Any call it did make should be in the log.
Is a local or a remote MCP server safer?
Neither is safe by default. They fail in different ways, so they need different checks. A local server runs on the same machine as the agent's app. A remote server runs elsewhere and is reached over the web.
| Local MCP server | Remote MCP server | |
|---|---|---|
| Where it runs | On your laptop or server, next to the agent | On the provider's servers, over the web |
| Whose permissions it has | Yours: it can run any command you can | Whatever its sign-in allows |
| Main risk | Malicious code in the package or its start-up command | Wide tokens, shared logins, tokens sent to the wrong service |
| Key control | Show the exact command, ask before installing, run it in a sandbox | Each person's own sign-in, narrow scopes |
The protocol's guidance is blunt about local servers. An app that sets one up in a single click must "Show the exact command that will be executed, without truncation". It should also "Warn that MCP servers run with the same privileges as the client", meaning the app the agent runs in. For the sandbox itself, the guidance names "containers, chroot, application sandboxes": run the server with only the folders and network access it needs.
How we secure MCP servers in Avesta AgentOS
In Avesta AgentOS, the platform we build and run our AI co-workers on, MCP tools pass through the same approval rules and role checks as every other tool. The permissions post covers excluding tools per agent. Here are three patterns specific to MCP.
1. An approval is used once
An approval rule can sit on any MCP tool, and it can look at the tool's inputs. A rule might hold a refund only when the amount is over a set limit, so small refunds run without waiting.
When a call matches the rule, it stops and a person gets a request. By default, the approval is tied to the person who asked and, for rules that look at the inputs, to those exact inputs. Once the call runs, the approval is used up. The next refund needs its own.
An approval should cover one call, not every call that looks like it.

- The tool and server. The request names the exact tool the agent tried to call.
- Who asked and the inputs. The reviewer sees the order and the amount before deciding.
- The rule that matched. Here, refunds over a set amount.
- Used once. After the call runs, the same approval can't be replayed for another refund.
The example record is made up; the rules behind it are how Avesta AgentOS works.
2. No shared login when a sign-in can't be renewed
Our MCP server integration guide explains how each person's own sign-in works in Avesta AgentOS. The security point is what happens when it can't be renewed: the person signs in again, and the call never switches to a shared or admin login.
3. Customer details go only to servers set up for them
Some MCP servers need to know which customer a conversation is about, such as a phone number or email. In Avesta AgentOS, a server gets these only if it was set up to receive them, and they come from the conversation the platform is handling. The model doesn't write them, so it can't choose which customer the server is told about. The permissions post explains the general rule behind this.
When can you skip most of this checklist?
Some MCP setups carry so little risk that a few steps are enough.
- A server with a single read-only tool over public data. A weather lookup, for example, which the protocol uses as a sample tool. Steps 1 and 5 still apply. With one tool, nothing to change and nothing private, steps 2, 3 and 4 have no work to do.
- One developer, a local server, test data. Steps 1 and 5 still apply, and so does a sandbox, because the server runs with that developer's permissions. Steps 3 and 4 can wait until the server touches shared systems or real customers.
The first tool that can write anything, or read anything private, is where the other steps switch back on.
The bottom line
MCP makes connecting tools quick. So the choice of what each agent may reach has to be made on purpose, before the connection, not after. For where MCP fits among the other parts around a model, see our explainer on what an agent harness is.
Pick the MCP server your agent uses most, open its tool list, and count the tools that can delete, pay or send.
Connecting AI agents to MCP servers? Safe AgentOps covers evals, guardrails, approvals, audits and monitoring for agents in production.
Get started: hello@avestalabs.ai
Frequently asked questions
- Is an MCP server secure?
- Not by default. MCP is a standard for how an AI agent talks to a server, not a promise that the server is safe. Authorization is optional in the specification, and a server's tool descriptions can carry hidden instructions. A server is as secure as its code, the access it is given and the checks your team puts around it.
- What are the disadvantages of using an MCP server?
- Speed is the main benefit and the main risk. One connection can give an agent many tools at once, some of which change or delete data. Each server is more software to vet and keep up to date, and its tool descriptions and results reach the model as text, which an attacker can use for prompt injection.
- What does MCP mean in security?
- In AI security, MCP almost always means the Model Context Protocol, the open standard for connecting AI agents to tools and data. MCP security covers the risks that come with it: untrusted servers, tool poisoning, sign-ins with more permissions than the job needs, and agents taking actions without a person checking.
- Does MCP have built-in authentication?
- MCP defines an optional authorization flow for servers reached over the web, based on OAuth 2.1, the common standard behind 'sign in with' buttons. Servers that run on your own machine are told to take credentials from their environment instead. So a server you find may use the full flow, a fixed key, or nothing at all. Check before you connect it.
Newsletter
Learn how to use AI in your business
Practical lessons on what AI can do, where it falls short, and what’s worth trying.
Share this article




