Interface McpTransport
- All Known Implementing Classes:
HttpMcpTransport
public interface McpTransport
Interface for MCP communication transports.
Transports are responsible for receiving and sending raw JSON-RPC messages.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceFunctional interface for handling incoming MCP messages. -
Method Summary
Modifier and TypeMethodDescriptionvoidsendMessage(String sessionId, String message) Sends a message to a specific session.voidstart(McpTransport.McpHandler handler) Starts the transport.voidstop()Stops the transport and releases any resources.
-
Method Details
-
start
Starts the transport.- Parameters:
handler- The handler to call when a new message is received.- Throws:
IOException- If the transport fails to start.
-
stop
void stop()Stops the transport and releases any resources. -
sendMessage
-