| 1 | import { assert, describe, it } from "@effect/vitest" |
| 2 | import * as McpProtocol from "effect/ai/McpProtocol" |
| 3 | import * as Effect from "effect/Effect" |
| 4 | import * as BaseProtocolTest from "./McpConformance/BaseProtocolTest.ts" |
| 5 | import * as LifecycleTest from "./McpConformance/LifecycleTest.ts" |
| 6 | import * as LoggingTest from "./McpConformance/LoggingTest.ts" |
| 7 | import * as McpConformance from "./McpConformance/McpConformance.ts" |
| 8 | import * as PromptsTest from "./McpConformance/PromptsTest.ts" |
| 9 | import * as ResourcesTest from "./McpConformance/ResourcesTest.ts" |
| 10 | import * as RootsTest from "./McpConformance/RootsTest.ts" |
| 11 | import * as SamplingTest from "./McpConformance/SamplingTest.ts" |
| 12 | import * as ToolsTest from "./McpConformance/ToolsTest.ts" |
| 13 | import * as TransportsTest from "./McpConformance/TransportsTest.ts" |
| 14 | import * as UtilitiesTest from "./McpConformance/UtilitiesTest.ts" |
| 15 | |
| 16 | const protocol = McpProtocol.v2024_11_05 |
| 17 | const testLayer = McpConformance.layer(protocol) |
| 18 | |
| 19 | LifecycleTest.suite(protocol, testLayer) |
| 20 | BaseProtocolTest.suite(protocol, testLayer) |
| 21 | BaseProtocolTest.statefulLegacySuite(protocol, testLayer) |
| 22 | TransportsTest.suite(protocol, testLayer) |
| 23 | UtilitiesTest.suite(protocol, testLayer) |
| 24 | UtilitiesTest.statefulLegacySuite(protocol, testLayer) |
| 25 | LoggingTest.suite(protocol, testLayer) |
| 26 | ToolsTest.suite(protocol, testLayer) |
| 27 | ToolsTest.statefulLegacySuite(protocol, testLayer) |
| 28 | ResourcesTest.suite(protocol, testLayer) |
| 29 | ResourcesTest.statefulLegacySuite(protocol, testLayer) |
| 30 | PromptsTest.suite(protocol, testLayer) |
| 31 | PromptsTest.statefulLegacySuite(protocol, testLayer) |
| 32 | RootsTest.suite(protocol, testLayer) |
| 33 | SamplingTest.suite(protocol, testLayer) |
| 34 | |
| 35 | it.layer(testLayer)(`Mcp Conformance (${protocol.protocolVersion})`, (it) => { |
| 36 | describe("Completion", () => { |
| 37 | describe("Capabilities", () => { |
| 38 | it.effect("MUST NOT advertise completions", () => |
| 39 | Effect.gen(function*() { |
| 40 | const test = yield* McpConformance.McpConformance |
| 41 | const initialized = yield* test.initialize({ server: "features" }) |
| 42 | |
| 43 | assert.notProperty(initialized.message.result.capabilities, "completions") |
| 44 | })) |
| 45 | }) |
| 46 | }) |
| 47 | }) |