feat(mcp): support server log notifications (#31752)
This commit is contained in:
parent
c51a1588c7
commit
07b983e82f
2 changed files with 30 additions and 2 deletions
|
|
@ -1,4 +1,5 @@
|
|||
import { expect, mock, beforeEach } from "bun:test"
|
||||
import { ToolListChangedNotificationSchema } from "@modelcontextprotocol/sdk/types.js"
|
||||
import { Cause, Effect, Exit } from "effect"
|
||||
import type { MCP as MCPNS } from "../../src/mcp/index"
|
||||
import { testEffect } from "../lib/effect"
|
||||
|
|
@ -394,7 +395,7 @@ it.instance(
|
|||
{ name: "next_tool", description: "next", inputSchema: { type: "object", properties: {} } },
|
||||
]
|
||||
|
||||
const handler = Array.from(serverState.notificationHandlers.values())[0]
|
||||
const handler = serverState.notificationHandlers.get(ToolListChangedNotificationSchema)
|
||||
expect(handler).toBeDefined()
|
||||
yield* Effect.promise(() => handler?.())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue