MCPcopy
hub / github.com/codeaashu/claude-code / findChannelEntry

Function findChannelEntry

src/services/mcp/channelNotification.ts:161–173  ·  view source on GitHub ↗
(
  serverName: string,
  channels: readonly ChannelEntry[],
)

Source from the content-addressed store, hash-verified

159 * kind — that's the user's trust declaration, not inferred from runtime shape.
160 */
161export function findChannelEntry(
162 serverName: string,
163 channels: readonly ChannelEntry[],
164): ChannelEntry | undefined {
165 // split unconditionally — for a bare name like 'slack', parts is ['slack']
166 // and the plugin-kind branch correctly never matches (parts[0] !== 'plugin').
167 const parts = serverName.split(':')
168 return channels.find(c =>
169 c.kind === 'server'
170 ? serverName === c.name
171 : parts[0] === 'plugin' && parts[1] === c.name,
172 )
173}
174
175/**
176 * Gate an MCP server's channel-notification path. Caller checks

Callers 4

useManageMCPConnectionsFunction · 0.85
gateChannelServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected