{"slug": "an-mcp-server-security-checklist-for-claude-code-codex-and-cursor", "title": "An MCP server security checklist for Claude Code, Codex and Cursor", "summary": "Security consultancy PTS published a 15-minute checklist for auditing MCP servers used by coding agents such as Claude Code, Codex and Cursor, warning that local servers run as ordinary processes that inherit environment variables and can read anything the user's account can read. The guidance, citing official MCP documentation, urges developers to inventory each configured server, remove unused ones, verify an identifiable publisher and pin versions, and give each server narrowly scoped credentials rather than inheriting shell environment. It also notes that every added server shares the same model context, so a malicious server can influence how the agent uses other servers' tools.", "body_md": "*Originally published on [agents.paxtechnologyservices.com](https://agents.paxtechnologyservices.com/articles/mcp-server-security-checklist.html). I'm PTS, an IT and security consulting shop. Corrections welcome in the comments.*\n\nAn 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](https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/local-server-security)).\n\nThis 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.\n\nIf you have not yet mapped accounts, env names and existing servers, start with the [15-minute inventory](https://agents.paxtechnologyservices.com/articles/what-can-your-coding-agent-read.html). The [permissions audit](https://agents.paxtechnologyservices.com/articles/ai-coding-agent-permissions-audit.html) covers deny lists, sandboxes and Cursor ignore files.\n\nOfficial 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](https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/local-server-security)).\n\nWhere to look:\n\n`/mcp` in 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 (`[mcp_servers.*]` in `~/.codex/config.toml` and any project `.codex/config.toml` (`.cursor/mcp.json` in the project, or `~/.cursor/mcp.json` for user-level servers.\nWrite 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.\n\nMost 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](https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/local-server-security)).\n\nThe 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.\n\nClaude 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](https://code.claude.com/docs/en/mcp)).\n\nThe 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](https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/local-server-security). Read that command. A typosquat or an abandoned package with a new publisher is a different threat from a protocol bug.\n\nPrefer 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.\n\nOfficial 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](https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/local-server-security)).\n\nIf 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.\n\nClaude 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](https://code.claude.com/docs/en/mcp) 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.\n\nOfficial local-server defaults:\n\nNone of that is provided by the MCP protocol itself. You or your tools have to set it.\n\nRemember 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](https://code.claude.com/docs/en/sandboxing)). Cursor's ignore file does not block the terminal or MCP tools ([ignore file](https://cursor.com/docs/reference/ignore-file)).\n\nFor Claude Code:\n\n`mcp__<server>__<tool>`, including wildcards when you mean them (\nFor 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](https://cursor.com/docs/agent/security) and [ignore file](https://cursor.com/docs/reference/ignore-file) pages are the source for those limits.\n\nFor 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](https://developers.openai.com/codex/config-basic).\n\nOfficial 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](https://modelcontextprotocol.io/docs/2026-07-28/tutorials/security/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.\n\nIf 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](https://modelcontextprotocol.io/docs/2025-11-25/tutorials/security/security_best_practices)). The practical version for a developer machine:\n\nYou do not need to implement the protocol to follow those habits.\n\nCopy this into your notes, or use the worksheet in the free [Agent Blast Radius Checklist](https://paxtechservices.gumroad.com/l/agent-blast-radius?utm_source=devto&utm_medium=article&utm_campaign=devto-mcp-server-security-checklist):\n\nThe free [AI + Blockchain Map](https://paxtechservices.gumroad.com/l/ai-blockchain-map?utm_source=devto) is a starting point for this series. More guides live on the [PTS site](https://agents.paxtechnologyservices.com/guides/).\n\nIf you want new notes like this in your inbox, the newsletter is at [https://paxtechservices.substack.com](https://paxtechservices.substack.com)", "url": "https://wpnews.pro/news/an-mcp-server-security-checklist-for-claude-code-codex-and-cursor", "canonical_source": "https://dev.to/paxtechnologyservices/an-mcp-server-security-checklist-for-claude-code-codex-and-cursor-2d10", "published_at": "2026-12-04 21:41:19+00:00", "updated_at": "2026-12-04 21:44:40.300057+00:00", "lang": "en", "topics": ["ai-agents", "agent-protocols", "ai-safety", "ai-tools", "developer-tools"], "entities": ["PTS", "Claude Code", "Codex", "Cursor", "Model Context Protocol"], "also_reported_by": [], "takeaway": "Local stdio MCP servers share a trust domain with the client and inherit your environment, so inventory each server, remove unused ones, pin versions from identifiable publishers, and scope credentials per server.", "recommendation": {"advice": "Audit your MCP configs now: remove unused servers, verify each publisher and pin its version, and give each server only narrowly scoped credentials instead of inherited shell environment.", "playbook": "agent-security", "playbook_url": "https://wpnews.pro/playbooks/agent-security"}, "alternates": {"html": "https://wpnews.pro/news/an-mcp-server-security-checklist-for-claude-code-codex-and-cursor", "markdown": "https://wpnews.pro/news/an-mcp-server-security-checklist-for-claude-code-codex-and-cursor.md", "text": "https://wpnews.pro/news/an-mcp-server-security-checklist-for-claude-code-codex-and-cursor.txt", "jsonld": "https://wpnews.pro/news/an-mcp-server-security-checklist-for-claude-code-codex-and-cursor.jsonld"}}