Skip to content

Commit 59b6b75

Browse files
authored
Revert "Update capabilities to be expressible by Boolean literals (#16)" (#18)
This reverts commit 3e628db.
1 parent eba4f62 commit 59b6b75

File tree

4 files changed

+8
-46
lines changed

4 files changed

+8
-46
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ let server = Server(
5151
name: "MyServer",
5252
version: "1.0.0",
5353
capabilities: .init(
54-
prompts: true,
55-
resources: true,
56-
tools: true
54+
prompts: .init(),
55+
resources: .init(
56+
subscribe: true
57+
),
58+
tools: .init()
5759
)
5860
)
5961

Sources/MCP/Client/Client.swift

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -423,17 +423,3 @@ public actor Client {
423423
return value
424424
}
425425
}
426-
427-
// MARK: - ExpressibleByBooleanLiteral
428-
429-
extension Client.Capabilities.Roots: ExpressibleByBooleanLiteral {
430-
public init(booleanLiteral value: Bool) {
431-
self.init()
432-
}
433-
}
434-
435-
extension Client.Capabilities.Sampling: ExpressibleByBooleanLiteral {
436-
public init(booleanLiteral value: Bool) {
437-
self.init()
438-
}
439-
}

Sources/MCP/Server/Server.swift

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -408,29 +408,3 @@ public actor Server {
408408
self.isInitialized = true
409409
}
410410
}
411-
412-
// MARK: - ExpressibleByBooleanLiteral
413-
414-
extension Server.Capabilities.Logging: ExpressibleByBooleanLiteral {
415-
public init(booleanLiteral value: Bool) {
416-
self.init()
417-
}
418-
}
419-
420-
extension Server.Capabilities.Prompts: ExpressibleByBooleanLiteral {
421-
public init(booleanLiteral value: Bool) {
422-
self.init()
423-
}
424-
}
425-
426-
extension Server.Capabilities.Resources: ExpressibleByBooleanLiteral {
427-
public init(booleanLiteral value: Bool) {
428-
self.init()
429-
}
430-
}
431-
432-
extension Server.Capabilities.Tools: ExpressibleByBooleanLiteral {
433-
public init(booleanLiteral value: Bool) {
434-
self.init()
435-
}
436-
}

Tests/MCPTests/RoundtripTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ struct RoundtripTests {
3434
name: "TestServer",
3535
version: "1.0.0",
3636
capabilities: .init(
37-
prompts: true,
38-
resources: true,
39-
tools: true
37+
prompts: .init(),
38+
resources: .init(),
39+
tools: .init()
4040
)
4141
)
4242
await server.withMethodHandler(ListTools.self) { _ in

0 commit comments

Comments
 (0)