You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] : Enterprise MCP security policy: allowlist remote servers while allowing local MCP #54100
I have verified this feature I'm about to request hasn't been suggested before.
Describe the enhancement you want to request
Allow enterprise administrators to enforce an organization-wide MCP security policy that permits local MCP servers (stdio), while restricting remote MCP connections to an administrator-managed allowlist.
The policy should be enforced before establishing a remote MCP connection and should not be overridable by project-level or user-level configuration.
To restate it: you'd like an administrator-managed MCP policy that always allows local (stdio) MCP servers but limits remote MCP servers to an allowlist of hosts. It would be checked before connecting (including after redirects) and users or projects could not override it.
v2 already has policy statements, under experimental.policies or delivered by a connected OpenCode Console. For MCP they currently match only the server ID, e.g. { "effect": "deny", "action": "integration.use", "resource": "mcp:*" }. They can't tell local from remote servers or match a URL host, which is the gap you describe. Maintainers will consider it.
Thanks for the clarification and for pointing out the related PRs.
I agree that extending the existing v2 policy engine would be preferable to
introducing a separate MCP policy mechanism.
The main requirement is to distinguish between local (stdio) and remote MCP
servers, and to enforce an administrator-managed allowlist for remote MCP
endpoints.
Ideally, this would support:
-
Allowing all local MCP servers.
-
Allowing remote MCP servers only when their destination matches an
approved host.
-
Denying all other remote MCP connections before connection establishment.
-
Preventing user or project configurations from overriding the
administrator policy.
-
Applying the policy consistently across CLI and Desktop.
The policy should also validate redirect destinations to prevent bypassing
the allowlist.
This would be particularly useful in enterprise environments where
developers need flexibility with local MCP servers while the organization
must retain control over external MCP connections.
Thanks for considering this enhancement!
Le ven. 9 oct. 2026 à 10:46, opencode-agent[bot] ***@***.***>
a écrit :
--
----------------------------------------------------------------------------------------
*Nicolas Evrard*
*Be green, keep it on the screen*
----------------------------------------------------------------------------------------
Default deny for remote servers with an explicit allowlist is the right enterprise shape. Two details matter: identity per server, so approvals name which server they cover, and logging every connection decision so a later audit can explain why a server was reachable. Local MCP staying frictionless is fine since it inherits the user's own trust.
Could this policy also support the inverse: deny all local stdio MCP servers while allowing remote servers that match an administrator's host allowlist? A managed deployment may permit approved hosted connectors but block local subprocesses because they execute on the server under its account.
In v2.2.1, integration.use matches mcp:<server-name> (policy code), while local and remote are separate MCP config types (schema). The current matcher cannot distinguish those types. Supporting both directions would let administrators express the MCP server policy that fits their deployment.
Disclosure: I maintain a community OpenCode plugin, @hamzaabili/opencode-integrity.
This does not implement the destination allowlist this issue asks for (host matching, redirects, local-vs-remote), so the native policy engine is still the right place for that. What it does today is the reviewed-server-set half: opencode-integrity policy --deny-unlisted emits native mcp.usedeny * plus allow statements from a committed lockfile, so only the MCP servers a project has pinned remain usable. It is name-based and static, not host/redirect-aware, and it does not distinguish local from remote. If the policy engine gains a destination-aware action, the lockfile could feed it, but I don't want to pretend that solves this request.
Activity
opencode-agent commentedon Oct 9, 2026
Thanks for the detailed request, @Morpheis83!
To restate it: you'd like an administrator-managed MCP policy that always allows local (stdio) MCP servers but limits remote MCP servers to an allowlist of hosts. It would be checked before connecting (including after redirects) and users or projects could not override it.
v2 already has policy statements, under
experimental.policiesor delivered by a connected OpenCode Console. For MCP they currently match only the server ID, e.g.{ "effect": "deny", "action": "integration.use", "resource": "mcp:*" }. They can't tell local from remote servers or match a URL host, which is the gap you describe. Maintainers will consider it.Related issues and PRs:
managed-settings.jsonauthoritative, so users can't add extra MCP servers next to managed onesMorpheis83 commentedon Oct 9, 2026
cc-bb-aa commentedon Oct 9, 2026
Default deny for remote servers with an explicit allowlist is the right enterprise shape. Two details matter: identity per server, so approvals name which server they cover, and logging every connection decision so a later audit can explain why a server was reachable. Local MCP staying frictionless is fine since it inherits the user's own trust.
Skeptomenos commentedon Oct 29, 2026
Could this policy also support the inverse: deny all local stdio MCP servers while allowing remote servers that match an administrator's host allowlist? A managed deployment may permit approved hosted connectors but block local subprocesses because they execute on the server under its account.
In v2.2.1,
integration.usematchesmcp:<server-name>(policy code), while local and remote are separate MCP config types (schema). The current matcher cannot distinguish those types. Supporting both directions would let administrators express the MCP server policy that fits their deployment.Hamza-Abili commentedon Nov 10, 2026
Disclosure: I maintain a community OpenCode plugin,
@hamzaabili/opencode-integrity.This does not implement the destination allowlist this issue asks for (host matching, redirects, local-vs-remote), so the native policy engine is still the right place for that. What it does today is the reviewed-server-set half:
opencode-integrity policy --deny-unlistedemits nativemcp.usedeny *plusallowstatements from a committed lockfile, so only the MCP servers a project has pinned remain usable. It is name-based and static, not host/redirect-aware, and it does not distinguish local from remote. If the policy engine gains a destination-aware action, the lockfile could feed it, but I don't want to pretend that solves this request.