codex - 💡(How to fix) Fix Feature request: runtime activation gating for VPN-backed MCP servers [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
openai/codex#18342Fetched 2026-04-18 05:55:36
View on GitHub
Comments
0
Participants
1
Timeline
7
Reactions
2
Author
Participants
Timeline (top)
labeled ×5unlabeled ×2

Add first-class runtime activation gates for MCP servers so a server can stay configured in config.toml but only load when local runtime conditions indicate it is usable.

Root Cause

Add first-class runtime activation gates for MCP servers so a server can stay configured in config.toml but only load when local runtime conditions indicate it is usable.

Code Example

[mcp_servers.clearpass]
url = "https://clearpass.example/mcp"
activation = { local_subnets = ["10.1.0.0/16", "fd00::/8"], require_resolvable_host = true }
RAW_BUFFERClick to expand / collapse

Summary

Add first-class runtime activation gates for MCP servers so a server can stay configured in config.toml but only load when local runtime conditions indicate it is usable.

Problem

Some MCP servers are only available in specific environments, especially:

  • enterprise or internal MCP servers that are only reachable on VPN
  • split-DNS-backed MCP endpoints whose hostname only resolves when connected to the right network

Today the practical options are awkward:

  • leave the server always configured and accept noisy startup/login failures when the environment does not match
  • manually enable and disable the server depending on network context
  • keep separate configs for on-VPN and off-VPN situations

That makes VPN-gated MCP servers harder to use than they need to be.

Proposed behavior

Allow an MCP server to remain configured but be excluded from the effective MCP set when activation conditions do not match.

Example config:

[mcp_servers.clearpass]
url = "https://clearpass.example/mcp"
activation = { local_subnets = ["10.1.0.0/16", "fd00::/8"], require_resolvable_host = true }

Suggested activation conditions

  • activation.local_subnets Enable the server only when at least one local interface IP falls inside one of the configured CIDR ranges.

  • activation.require_resolvable_host = true For streamable HTTP MCP servers, enable the server only when the configured URL host resolves locally.

These conditions should compose with AND semantics when both are present.

Expected UX

When activation does not match:

  • the server should remain visible in configured status/list views
  • the server should be excluded from the effective loaded MCP set
  • manual operations such as MCP OAuth login should fail with a clear disabled reason instead of behaving as if the server is missing

Example disabled reasons:

  • activation (no local interface matched any configured subnet: 10.1.0.0/16)
  • activation (host clearpass.example was not resolvable)

Why this would help

This would make Codex much easier to use with VPN-backed and enterprise MCP endpoints without forcing users to constantly edit config or accept expected startup failures.

Notes

  • hostname resolution should be treated as a runtime availability hint, not a full reachability/health check
  • IP-literal hosts should be treated as already resolvable
  • non-HTTP transports probably should not support require_resolvable_host

extent analysis

TL;DR

Implement runtime activation gates for MCP servers based on local subnet and hostname resolvability to dynamically enable or disable servers.

Guidance

  • Introduce a new activation configuration block for MCP servers to specify conditions like local_subnets and require_resolvable_host.
  • Update the MCP server loading logic to evaluate these conditions at runtime and exclude servers that do not match.
  • Ensure that disabled servers remain visible in the configured status/list views but are excluded from the effective loaded MCP set.
  • Implement clear error messaging for manual operations when a server is disabled due to activation conditions not being met.

Example

[mcp_servers.clearpass]
url = "https://clearpass.example/mcp"
activation = { local_subnets = ["10.1.0.0/16", "fd00::/8"], require_resolvable_host = true }

Notes

The implementation should consider treating hostname resolution as a runtime availability hint and handle IP-literal hosts as already resolvable. Non-HTTP transports may not support require_resolvable_host.

Recommendation

Apply the proposed behavior by implementing runtime activation gates for MCP servers, as this will provide a more seamless user experience with VPN-backed and enterprise MCP endpoints.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING