Originally published on agents.paxtechnologyservices.com. I'm PTS, an IT and security consulting shop. Corrections welcome in the comments.
An MCP server is not a harmless plugin. A local server is an ordinary process your coding agent launches. Official MCP docs are blunt about that: it inherits your environment variables, can read anything your account can read, and can open outbound network connections, unless you isolate it yourself (local server security).
This is a practical pass you can finish in about 15 minutes. Setting names and limits were checked against official docs on December 3, 2026. Tools change fast. If a key does not match your version, trust the vendor docs over this page. Test any change on a non-production project first.
If you have not yet mapped accounts, env names and existing servers, start with the 15-minute inventory. The permissions audit covers deny lists, sandboxes and Cursor ignore files.
1. Inventory every server, then delete the ones you do not use
Official MCP guidance says that if you do one thing after reading it, open your client's MCP configuration, remove the servers you no longer use, and make sure you know where each remaining one comes from, with its version pinned (local server security).
Where to look:
- Claude Code: run
/mcpin a session, and check project.mcp.json, user and local MCP config. Project servers are shared through version control, and interactive sessions prompt for approval before using them (Claude Code MCP). - Codex: look for
[mcp_servers.*]in~/.codex/config.tomland any project.codex/config.toml(config basics). - Cursor:
.cursor/mcp.jsonin the project, or~/.cursor/mcp.jsonfor user-level servers.
Write down, for each server: the name, how it is launched (command or URL), the publisher, the pinned version if you have one, and the account or API it can reach. If you cannot explain why it is there, remove it.
2. Treat a local stdio server as code you chose to run
Most local servers use stdio: the client starts the server as a child process and talks to it over stdin and stdout. Official MCP docs say the client and a stdio server share one trust domain. The protocol does not sandbox one against the other. A server already has code execution on your machine by being launched. Isolation is your job, and the host application's, not the transport's (local server security).
The trust is also cumulative. Every server you add shares the same model context, so a bad server can influence how the agent uses the tools of every other server.
Claude Code's MCP page adds a direct warning: verify you trust each server before connecting it, because servers that fetch external content can expose you to prompt injection risk (Claude Code MCP).
3. Pin the publisher and the version
The same official local-server guide tells you to confirm an identifiable publisher and pin the version. Clients that offer one-click install are supposed to show the exact command before it runs. Official MCP docs describe that requirement as SEP-1024 in local server security. Read that command. A typosquat or an abandoned package with a new publisher is a different threat from a protocol bug.
Prefer a remote, hosted server when the tool needs nothing from your laptop. A remote server still has to be trusted, but it is not an extra process with your home directory and your shell environment.
4. Do not let servers inherit your whole shell
Official guidance: give each server only its own narrowly scoped credentials in per-server config. Nothing inherited from your shell, and nothing reused across servers (local server security).
If a server needs an API token, put that token in the server's own env block, scoped to the least privilege the tool needs. Do not point a server at your personal cloud admin keys because they were already in the terminal.
Claude Code also documents a specific case for headersHelper commands that a repository or plugin might supply. Those helpers can be arbitrary shell. For a server in a project .mcp.json, Claude Code runs the helper only after you accept the trust dialog for that project directory. It also strips many credential-looking environment variables from helpers in project scope. Read the current MCP reference for your version before you rely on that stripping as a complete control. It is a mitigation, not a reason to leave broad secrets in the environment.
5. Limit files and network, on purpose
Official local-server defaults:
- Limit filesystem access to specific directories, read-only where possible.
- If a server does not need the network, disable egress. If it does, write down the destinations.
- Run third-party local servers isolated (container, sandbox or VM), not as a bare process with your full user account.
None of that is provided by the MCP protocol itself. You or your tools have to set it.
Remember the limit you already saw in the inventory and audit guides: a tool sandbox that wraps shell commands does not automatically wrap MCP servers. Official Claude Code docs describe the sandbox as wrapping shell, while built-in file tools, MCP servers and hooks can run outside it (sandboxing). Cursor's ignore file does not block the terminal or MCP tools (ignore file).
6. Approve project servers and MCP tools deliberately
For Claude Code:
- Do not turn on a blanket "approve every project MCP server" setting unless you understand the trade. Prefer approving specific servers.
- Permission rules can name MCP tools. The pattern in official permissions docs is
mcp__<server>__<tool>, including wildcards when you mean them (permissions). Put high-impact tools (writes, payments, production APIs, message sending) on an ask or deny list, then test. - Keep bypass-permissions or skip-all-prompts modes off on any machine that holds real keys. Those modes are covered in the permissions audit.
For Cursor, keep approval prompts on for MCP and terminal use, and treat auto-run or "yolo" style modes as best-effort guardrails, not a hard boundary. Cursor's own agent security and ignore file pages are the source for those limits.
For Codex, read the project and user config.toml so you know which servers start with the session, and keep approval and sandbox settings at the safe defaults from the config basics.
7. Watch for tool descriptions that change
Official MCP local-server guidance includes this item on its own-machine checklist: skim each server's tool descriptions, and use a client that re-prompts when a tool definition changes (local server security). A server that was safe at install time can grow a new tool later. If your client does not re-prompt, re-read the tool list yourself after updates.
8. Be careful with tokens and proxies on remote servers
If you connect to remote MCP servers over HTTP, official Security Best Practices cover a different threat model: confused-deputy issues in proxy servers, token passthrough, and over-broad OAuth scopes (security best practices). The practical version for a developer machine:
- Do not hand a server a token that can also reach systems the server should never see.
- Prefer narrowly scoped tokens and separate credentials per server.
- Read the consent screen. A token that says "everything" is a wider blast radius than one that can only read one repo or one mailbox.
You do not need to implement the protocol to follow those habits.
A compact checklist
Copy this into your notes, or use the worksheet in the free Agent Blast Radius Checklist:
- I can name every MCP server in Claude Code, Codex and Cursor, and I removed the ones I do not use.
- I know the publisher and pinned version for each remaining server.
- Each server has its own narrowly scoped credentials. Nothing is inherited from my shell "because it was already there."
- Filesystem access is limited to the directories the server actually needs.
- Servers that do not need the network cannot reach the network. The rest have a known destination list.
- Third-party local servers run isolated, not as a bare process with my full user account.
- Project MCP configs are approved on purpose, not with a blanket allow.
- High-impact MCP tools are on an ask or deny list, and skip-all-prompts modes are off on machines with real keys.
- I have skimmed the tool descriptions, and I will re-check them after a server updates.
- I know that ignore files and some sandboxes do not automatically contain MCP servers.
Official pages to re-check
- MCP local server security
- MCP security best practices
- Connect Claude Code to tools via MCP
- Claude Code permissions
- Claude Code sandboxing
- Cursor ignore file
- Cursor agent security
- Codex config basics
The free AI + Blockchain Map is a starting point for this series. More guides live on the PTS site.
If you want new notes like this in your inbox, the newsletter is at https://paxtechservices.substack.com
