MCP server security checklist
Last verified against the official documentation linked below.
MCP servers can read files, call APIs and run code on your behalf, so treat adding one like installing software with your permissions. This checklist pulls together the security guidance in the MCP specification and in the Claude, Cursor and VS Code docs.
Steps
Install only from sources you trust
Use servers from developers and repositories you trust, and for important integrations read the server's source code.
Source: cursor.com/docs/context/mcp
Read the exact command before you approve it
The spec requires clients that offer one-click local installs to show the full command, with all arguments, and to get your explicit approval. Watch for sudo, rm -rf, network calls or access to places like your home folder or SSH keys.
Source: modelcontextprotocol.io/specification/2025-06-18/basic/security_best_practices
Give each server the least access that works
Only allow the folders a server needs, and give it API keys restricted to the minimum permissions.
Source: modelcontextprotocol.io/docs/develop/connect-local-servers · cursor.com/docs/context/mcp
Keep secrets out of config files
Pass keys through environment variables (for example ${env:NAME} in Cursor) rather than hard-coding them, and don't paste credentials into chat or commit them to a project.
Source: cursor.com/docs/context/mcp · code.visualstudio.com/docs/copilot/customization/mcp-servers
Prefer stdio for local servers, and lock down local HTTP
For servers meant to run locally, the spec recommends stdio so only the client can reach them. If a local server uses HTTP, it should require an authorisation token, bind to localhost and validate the Origin header.
Source: modelcontextprotocol.io/specification/2025-06-18/basic/security_best_practices · modelcontextprotocol.io/specification/2025-06-18/basic/transports
Sandbox where you can
The spec recommends running local servers with restricted access to the file system and network, using containers or other sandboxing, and granting extra access only when needed.
Source: modelcontextprotocol.io/specification/2025-06-18/basic/security_best_practices
Keep approvals on and read them
Claude Desktop and Cursor ask before running MCP tools. Check the arguments, and approve only actions you understand.
Source: modelcontextprotocol.io/docs/develop/connect-local-servers · cursor.com/docs/context/mcp · code.visualstudio.com/docs/copilot/customization/mcp-servers
Review remote connectors regularly
Check the permissions a remote server asks for when you sign in, and remove connectors you no longer use.
Source: modelcontextprotocol.io/docs/develop/connect-remote-servers
Safety notes
- If you build a server: the spec forbids accepting access tokens that weren't issued for your server (token passthrough) and recommends asking for the narrowest OAuth scopes first. (modelcontextprotocol.io/specification/2025-06-18/basic/security_best_practices)
Related listings
More guides
- Remote vs local MCP servers: how they differ and which to use
- How to add an MCP server to Claude Desktop
- How to add an MCP server to Cursor
- How to add an MCP server to VS Code
Sources: cursor.com/docs/context/mcp · modelcontextprotocol.io/specification/2025-06-18/basic/security_best_practices · modelcontextprotocol.io/docs/develop/connect-local-servers · code.visualstudio.com/docs/copilot/customization/mcp-servers · modelcontextprotocol.io/specification/2025-06-18/basic/transports · modelcontextprotocol.io/docs/develop/connect-remote-servers. Menus and file paths change between versions: if a step doesn't match what you see, follow the official page linked for that step.