MCPcopy Create free account
hub / github.com/Effect-TS/effect / protocolForInternalTag

Function protocolForInternalTag

packages/effect/src/unstable/ai/McpServer.ts:2348–2365  ·  view source on GitHub ↗
(
  registry: McpProtocolRegistry.ProtocolRegistry<McpProtocol.ProtocolAdapter>,
  tag: string
)

Source from the content-addressed store, hash-verified

2346}
2347
2348const protocolForInternalTag = (
2349 registry: McpProtocolRegistry.ProtocolRegistry<McpProtocol.ProtocolAdapter>,
2350 tag: string
2351): McpProtocol.ProtocolAdapter => {
2352 for (const protocol of registry.protocols) {
2353 const routed = registry.routeClientRequest(protocol, {
2354 _tag: "Request",
2355 id: 0,
2356 tag: "",
2357 payload: undefined,
2358 headers: []
2359 })
2360 if (tag.startsWith(routed.tag)) {
2361 return protocol
2362 }
2363 }
2364 return registry.protocols[0]
2365}
2366
2367const getProtocolForClient = (
2368 clientProtocols: Map<number, McpProtocol.ProtocolAdapter>,

Callers 1

McpServer.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected