# MCP security checklist: constrain

URL: https://mcpservercybersecurity.com/mcp-security-checklist/constrain/
Updated: 2026-11-16

Eight steps limit what approved servers can do: managed allow lists, project approval settings, sandboxes, minimal environments, loopback binding with Origin checks, egress limits, confirmation for sensitive calls and safe URL opening. Settings named, such as allowedMcpServers and managed-mcp.json, come from vendor docs read on 16 Nov 2026.

## What this stage covers

Limit what approved servers can run, reach and send. There are 8 steps here (C-23 to C-30), each a concrete action an engineer can tick.

Sources: [AI settings for enterprise, Visual Studio Code docs](https://code.visualstudio.com/docs/enterprise/ai-settings); [Connect Claude Code to tools via MCP, Claude Code docs](https://code.claude.com/docs/en/mcp); [MCP Security Best Practices, 2026-07-28 revision](https://modelcontextprotocol.io/specification/2026-07-28/basic/security_best_practices).

## Steps in order

Do these in order; each step lists how to do it and the register risks it closes.

- C-23 Allow only approved servers through managed settings (priority high)
- C-24 Keep project servers from approving themselves (priority high)
- C-25 Run local servers in a sandbox (priority high)
- C-26 Start servers with a minimal environment (priority high)
- C-27 Bind local HTTP servers to loopback and check Origin and Host (priority high)
- C-28 Restrict outbound network access from servers (priority high)
- C-29 Require confirmation for sensitive tool calls (priority high)
- C-30 Check URLs before a client opens them (priority high)

Sources: [AI settings for enterprise, Visual Studio Code docs](https://code.visualstudio.com/docs/enterprise/ai-settings); [Connect Claude Code to tools via MCP, Claude Code docs](https://code.claude.com/docs/en/mcp); [MCP Security Best Practices, 2026-07-28 revision](https://modelcontextprotocol.io/specification/2026-07-28/basic/security_best_practices); [Local Server Security, modelcontextprotocol.io](https://modelcontextprotocol.io/docs/tutorials/security/local-server-security).

## Where the settings come from

Setting names appear only where a primary source documents them. Check each against the client version in use before rollout, because the 2026-07-28 MCP revision and client releases changed several defaults.

Sources: [AI settings for enterprise, Visual Studio Code docs](https://code.visualstudio.com/docs/enterprise/ai-settings); [Connect Claude Code to tools via MCP, Claude Code docs](https://code.claude.com/docs/en/mcp); [MCP Security Best Practices, 2026-07-28 revision](https://modelcontextprotocol.io/specification/2026-07-28/basic/security_best_practices); [Local Server Security, modelcontextprotocol.io](https://modelcontextprotocol.io/docs/tutorials/security/local-server-security).

## Constrain: 8 items

### C-23: Allow only approved servers through managed settings

Push an allow list of servers to clients so unapproved servers do not load.

**Impact:** A catalog that clients do not enforce is only advice.

**Controls:**

- VS Code Copilot enterprise-managed settings use allowedMcpServers and deniedMcpServers; an empty allowedMcpServers list blocks all servers and deny rules win over the allow list.
- Claude Code supports managed-mcp.json for a fixed server set and allowedMcpServers and deniedMcpServers for restriction.
- Register risks: R-01, R-07, R-33.

Severity: high

Sources: [AI settings for enterprise, Visual Studio Code docs](https://code.visualstudio.com/docs/enterprise/ai-settings) (read 2026-11-16); [Connect Claude Code to tools via MCP, Claude Code docs](https://code.claude.com/docs/en/mcp) (read 2026-11-16).

### C-24: Keep project servers from approving themselves

Do not enable all project-scoped servers automatically, and require approval for servers that arrive in a repository.

**Impact:** A cloned repository can carry configuration chosen by its author.

**Controls:**

- Leave enableAllProjectMcpServers unset or false in Claude Code and review each project server; Claude Code ignores such approvals committed to the project in an untrusted folder.
- Use the client's workspace trust prompts.
- Register risks: R-33, R-30.

Severity: high

Sources: [Connect Claude Code to tools via MCP, Claude Code docs](https://code.claude.com/docs/en/mcp) (read 2026-11-16); [MCP Security Best Practices, 2026-07-28 revision](https://modelcontextprotocol.io/specification/2026-07-28/basic/security_best_practices) (read 2026-11-16).

### C-25: Run local servers in a sandbox

Run each local server in a container or sandbox with minimal filesystem and network access.

**Impact:** A local server otherwise has everything the user account has.

**Controls:**

- Mount only the directories the server needs and drop network access unless required.
- Note that a bare chroot is not a sandbox, per the OWASP cheat sheet.
- Register risks: R-29, R-32.

Severity: high

Sources: [Local Server Security, modelcontextprotocol.io](https://modelcontextprotocol.io/docs/tutorials/security/local-server-security) (read 2026-11-16); [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html) (read 2026-11-16).

### C-26: Start servers with a minimal environment

Pass each server only the variables it needs instead of the whole shell environment.

**Impact:** Servers inherit the environment of the process that starts them.

**Controls:**

- Build the environment explicitly in the launch config.
- Use separate credentials per server.
- Register risks: R-36.

Severity: high

Sources: [Local Server Security, modelcontextprotocol.io](https://modelcontextprotocol.io/docs/tutorials/security/local-server-security) (read 2026-11-16).

### C-27: Bind local HTTP servers to loopback and check Origin and Host

Listen on 127.0.0.1, validate Origin and answer an invalid one with 403, and allow-list Host values.

**Impact:** These checks close the DNS rebinding route to local services.

**Controls:**

- Follow the Streamable HTTP spec's security requirements for Origin and binding.
- Prefer stdio or a Unix socket with restricted permissions for local servers.
- Register risks: R-16, R-17.

Severity: high

Sources: [MCP Streamable HTTP transport, 2026-07-28 revision](https://modelcontextprotocol.io/specification/2026-07-28/basic/transports/streamable-http) (read 2026-11-16); [MCP Inspector 2.12.0 release notes](https://github.com/modelcontextprotocol/inspector/releases/tag/2.12.0) (read 2026-11-16).

### C-28: Restrict outbound network access from servers

Allow only the destinations a server needs, and route server-side fetches through an egress proxy.

**Impact:** Blocked egress stops credential and data exfiltration and SSRF reaching internal hosts.

**Controls:**

- Block private, loopback and link-local ranges for fetches driven by URLs from servers or models; use a maintained library.
- Alert on connections to destinations outside the allow list.
- Register risks: R-22, R-18.

Severity: high

Sources: [MCP Security Best Practices, 2026-07-28 revision](https://modelcontextprotocol.io/specification/2026-07-28/basic/security_best_practices) (read 2026-11-16); [Local Server Security, modelcontextprotocol.io](https://modelcontextprotocol.io/docs/tutorials/security/local-server-security) (read 2026-11-16).

### C-29: Require confirmation for sensitive tool calls

Show full parameters and ask for approval for destructive, financial and data-sharing operations, and never auto-approve in multi-server setups.

**Impact:** Approvals are the control that sits between injected text and an action.

**Controls:**

- Use your own policy per tool rather than the server's annotations, which clients must treat as untrusted.
- Make sure model-generated text cannot satisfy the confirmation.
- Register risks: R-34, R-26, R-27.

Severity: high

Sources: [OWASP MCP Security Cheat Sheet](https://cheatsheetseries.owasp.org/cheatsheets/MCP_Security_Cheat_Sheet.html) (read 2026-11-16); [MCP Tools, 2026-07-28 revision](https://modelcontextprotocol.io/specification/2026-07-28/server/tools) (read 2026-11-16).

### C-30: Check URLs before a client opens them

In clients you build, allow only http and https for authorization URLs and open them without a shell.

**Impact:** Server-supplied URLs reach the operating system's opener.

**Controls:**

- Reject javascript:, data:, file: and other schemes using an allow list.
- Do not use cmd.exe, sh or PowerShell to open a URL.
- Register risks: R-31, R-18.

Severity: high

Sources: [MCP Security Best Practices, 2026-07-28 revision](https://modelcontextprotocol.io/specification/2026-07-28/basic/security_best_practices) (read 2026-11-16); [MCP Inspector 2.12.0 release notes](https://github.com/modelcontextprotocol/inspector/releases/tag/2.12.0) (read 2026-11-16).

## Related pages

- [The full MCP Security Checklist](/mcp-security-checklist/)
- [Authenticate](/mcp-security-checklist/authenticate/)
- [Observe](/mcp-security-checklist/observe/)
- [Method](/mcp-security-checklist/methodology/)
- [MCP Risk Register](/mcp-risk-register/)
