MCPcopy Create free account
hub / github.com/coder/mux / filterServersByPolicy

Method filterServersByPolicy

src/node/services/mcpServerManager.ts:793–806  ·  view source on GitHub ↗

* Filter servers based on the effective policy (e.g. disallow stdio/remote).

(servers: MCPServerMap)

Source from the content-addressed store, hash-verified

791 * Filter servers based on the effective policy (e.g. disallow stdio/remote).
792 */
793 private filterServersByPolicy(servers: MCPServerMap): MCPServerMap {
794 if (!this.policyService?.isEnforced()) {
795 return servers;
796 }
797
798 const filtered: MCPServerMap = {};
799 for (const [name, info] of Object.entries(servers)) {
800 if (this.policyService.isMcpTransportAllowed(info.transport)) {
801 filtered[name] = info;
802 }
803 }
804
805 return filtered;
806 }
807
808 /**
809 * Apply workspace MCP overrides to determine final server enabled state.

Callers 2

listServersMethod · 0.95
getToolsForWorkspaceMethod · 0.95

Calls 2

isEnforcedMethod · 0.80
isMcpTransportAllowedMethod · 0.80

Tested by

no test coverage detected