(options)
| 169 | const notifications = yield* RpcClient.makeNoSerialization(ServerNotificationRpcs, { |
| 170 | spanPrefix: "McpServer/Notifications", |
| 171 | onFromClient(options): Effect.Effect<void> { |
| 172 | const message = options.message |
| 173 | if (message._tag !== "Request") { |
| 174 | return Effect.void |
| 175 | } |
| 176 | if (message.tag.includes("list_changed")) { |
| 177 | if (!listChangedHandles.has(message.tag)) { |
| 178 | listChangedHandles.set( |
| 179 | message.tag, |
| 180 | setTimeout(() => { |
| 181 | notificationsMailbox.unsafeOffer(message) |
| 182 | listChangedHandles.delete(message.tag) |
| 183 | }, 0) |
| 184 | ) |
| 185 | } |
| 186 | } else { |
| 187 | notificationsMailbox.unsafeOffer(message) |
| 188 | } |
| 189 | return notifications.write({ |
| 190 | clientId: 0, |
| 191 | requestId: message.id, |
| 192 | _tag: "Exit", |
| 193 | exit: Exit.void as any |
| 194 | }) |
| 195 | } |
| 196 | }) |
| 197 | |
| 198 | return McpServer.of({ |
no test coverage detected