The Claude Code Changelog
All Episodes
Expanded MCP Denylist Policies in Claude Code 2.1.318

Expanded MCP Denylist Policies in Claude Code 2.1.318

0:00|0:00

Learn how Claude Code 2.1.318 expands deniedMcpServers URL matching to block Anthropic-provided servers and cloud connectors. We cover configuring organizational denylists, verifying policies with claude mcp list, and several smaller MCP quality-of-life fixes.


Chapter 1

deniedMcpServers Now Reaches Anthropic Upstreams and Connectors

Lachlan Reed

This one's brought to you by Jellypod AI, and it's a small line in the 2.1.318 notes that could matter a lot if you manage Claude Code for a team. You'll remember 2.1.318 added auth expiration dates and effort on mod forks. It also quietly widened organizational MCP security policy.

James Turner

Right, and following the managed settings and write boundary stuff from 2.1.316 and 2.1.317, this fits the pattern. The release notes say deniedMcpServers URL entries now also block Anthropic-provided servers whose upstream URL matches. They also block connectors in cloud sessions and on self-hosted runners, where the session is given the connector's own URL. Otherwise, the notes say, you deny a connector by name.

Lachlan Reed

So why care? A lot of admins write URL entries thinking it's a perimeter. Block this vendor endpoint, block that untrusted host, done. The docs already say deniedMcpServers applies even to servers in managed-mcp.json, so a managed server that matches an entry won't load. That's the strong part. The change is about extending where a URL can match.

James Turner

And I'd keep fact and interpretation separate here. The fact is the notes describe the new matching. My read is that if you relied on a URL entry and assumed it covered Anthropic-provided servers or cloud connectors, it's worth rechecking now. The notes don't spell out what happened before, so I won't claim a specific hole.

Lachlan Reed

Okay, using it. In your managed settings, add the entries to deniedMcpServers. Something like this. An array with a URL, say https://untrusted-upstream.example.com/mcp, then another URL, https://api.githubcopilot.com/mcp/, and then a plain name string for a connector you want blocked by name. Same setting, three kinds of entries.

James Turner

The URL has to match the one the session is actually given. In cloud sessions and on self-hosted runners that's the connector's own URL, so a URL entry works. Elsewhere, like connectors the desktop app delivers to local and SSH sessions, the docs say those arrive in-process and are governed from your claude.ai organization settings. So don't lean on a URL there. Use the name, and check those org settings.

Lachlan Reed

To verify, run claude mcp list on a managed machine, and look at the MCP config diagnostics section if something's off. Inside a session, /mcp shows servers. And here's the caveat. The docs warn that servers blocked or dropped by policy can just stop loading with no warning that policy is the reason. So tell your developers before you push a broad entry.

James Turner

Yeah, test a new entry on one machine first. Now the smaller fixes, all MCP flavoured. claude mcp add and remove used to write the config without its lock. Now they wait for the lock or exit 1, though the notes admit another job's save can still replace a saved server. Useful on shared network homes.

Lachlan Reed

Two more. Stdio MCP servers that exit on the version probe aren't re-probed every start anymore. If one dies in under three seconds for its own reason, it's pinned to the legacy handshake for seven days. And calling an MCP tool before it's loaded now returns its input schema, not a vague error.

James Turner

So the takeaway. If you run a denylist, audit your URL entries against cloud and runner connectors, add names for the rest, and verify with claude mcp list. That's 2.1.318.