Skip to content

Commit b4585ef

Browse files
committed
unify all JSONRPC stuff into one type
1 parent feaf981 commit b4585ef

File tree

17 files changed

+272
-427
lines changed

17 files changed

+272
-427
lines changed

.swiftpm/xcode/xcshareddata/xcschemes/SwiftMCPDemo.xcscheme

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
</CommandLineArgument>
7070
<CommandLineArgument
7171
argument = "--token secret"
72-
isEnabled = "NO">
72+
isEnabled = "YES">
7373
</CommandLineArgument>
7474
</CommandLineArguments>
7575
<EnvironmentVariables>

Sources/SwiftMCP/Models/JSONRPC/ErrorObject.swift

Lines changed: 0 additions & 71 deletions
This file was deleted.

Sources/SwiftMCP/Models/JSONRPC/JSONRPC.swift

Lines changed: 0 additions & 8 deletions
This file was deleted.

Sources/SwiftMCP/Models/JSONRPC/JSONRPCRequest.swift

Lines changed: 0 additions & 17 deletions
This file was deleted.

Sources/SwiftMCP/Models/JSONRPC/JSONRPCResponse.swift

Lines changed: 0 additions & 56 deletions
This file was deleted.

Sources/SwiftMCP/Models/JSONRPC/Notification.swift

Lines changed: 0 additions & 26 deletions
This file was deleted.

Sources/SwiftMCP/Models/JSONRPC/Request.swift

Lines changed: 0 additions & 31 deletions
This file was deleted.

Sources/SwiftMCP/Models/JSONRPC/RequestID.swift

Lines changed: 0 additions & 44 deletions
This file was deleted.

Sources/SwiftMCP/Models/JSONRPC/Response.swift

Lines changed: 0 additions & 41 deletions
This file was deleted.

Sources/SwiftMCP/Models/JSONRPC/JSONRPCMessage.swift renamed to Sources/SwiftMCP/Models/JSONRPCMessage.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ import Foundation
99
import AnyCodable
1010

1111
/// JSON-RPC Request structure used for communication with the MCP server
12-
public struct JSONRPCMessage: Encodable {
12+
public struct JSONRPCMessage: Codable {
1313

14-
public struct Error: Encodable {
14+
public struct Error: Codable {
1515
public var code: Int
1616
public var message: String
1717
}
@@ -20,5 +20,7 @@ public struct JSONRPCMessage: Encodable {
2020
public var id: Int?
2121
public var method: String?
2222
public var params: [String: AnyCodable]?
23+
public var result: [String: AnyCodable]?
24+
2325
public var error: Error?
2426
}

0 commit comments

Comments
 (0)