Skip to content

Commit 1645ecb

Browse files
committed
Formatting
Signed-off-by: Dariusz Jędrzejczyk <[email protected]>
1 parent f83db45 commit 1645ecb

19 files changed

+348
-262
lines changed

mcp/src/main/java/io/modelcontextprotocol/server/McpAsyncServer.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ public class McpAsyncServer {
127127
* @param objectMapper The ObjectMapper to use for JSON serialization/deserialization
128128
*/
129129
McpAsyncServer(McpServerTransportProvider mcpTransportProvider, ObjectMapper objectMapper,
130-
McpServerFeatures.Async features, Duration requestTimeout,
131-
McpUriTemplateManagerFactory uriTemplateManagerFactory, JsonSchemaValidator jsonSchemaValidator) {
130+
McpServerFeatures.Async features, Duration requestTimeout,
131+
McpUriTemplateManagerFactory uriTemplateManagerFactory, JsonSchemaValidator jsonSchemaValidator) {
132132
this.mcpTransportProvider = mcpTransportProvider;
133133
this.objectMapper = objectMapper;
134134
this.serverInfo = features.serverInfo();
@@ -151,8 +151,8 @@ public class McpAsyncServer {
151151
}
152152

153153
McpAsyncServer(McpStreamableServerTransportProvider mcpTransportProvider, ObjectMapper objectMapper,
154-
McpServerFeatures.Async features, Duration requestTimeout,
155-
McpUriTemplateManagerFactory uriTemplateManagerFactory, JsonSchemaValidator jsonSchemaValidator) {
154+
McpServerFeatures.Async features, Duration requestTimeout,
155+
McpUriTemplateManagerFactory uriTemplateManagerFactory, JsonSchemaValidator jsonSchemaValidator) {
156156
this.mcpTransportProvider = mcpTransportProvider;
157157
this.objectMapper = objectMapper;
158158
this.serverInfo = features.serverInfo();
@@ -169,7 +169,8 @@ public class McpAsyncServer {
169169
Map<String, McpRequestHandler<?>> requestHandlers = prepareRequestHandlers();
170170
Map<String, McpNotificationHandler> notificationHandlers = prepareNotificationHandlers(features);
171171

172-
mcpTransportProvider.setSessionFactory(new DefaultMcpStreamableServerSessionFactory(requestTimeout, this::asyncInitializeRequestHandler, requestHandlers, notificationHandlers));
172+
mcpTransportProvider.setSessionFactory(new DefaultMcpStreamableServerSessionFactory(requestTimeout,
173+
this::asyncInitializeRequestHandler, requestHandlers, notificationHandlers));
173174
}
174175

175176
private Map<String, McpNotificationHandler> prepareNotificationHandlers(McpServerFeatures.Async features) {

mcp/src/main/java/io/modelcontextprotocol/server/McpAsyncServerExchange.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public class McpAsyncServerExchange {
5757
* @param clientInfo The client implementation information.
5858
*/
5959
public McpAsyncServerExchange(McpSession session, McpSchema.ClientCapabilities clientCapabilities,
60-
McpSchema.Implementation clientInfo) {
60+
McpSchema.Implementation clientInfo) {
6161
this.session = session;
6262
this.clientCapabilities = clientCapabilities;
6363
this.clientInfo = clientInfo;
@@ -69,11 +69,12 @@ public McpAsyncServerExchange(McpSession session, McpSchema.ClientCapabilities c
6969
* @param session The server session representing a 1-1 interaction.
7070
* @param clientCapabilities The client capabilities that define the supported
7171
* features and functionality.
72-
* @param transportContext context associated with the client as extracted from the transport
72+
* @param transportContext context associated with the client as extracted from the
73+
* transport
7374
* @param clientInfo The client implementation information.
7475
*/
7576
public McpAsyncServerExchange(McpSession session, McpSchema.ClientCapabilities clientCapabilities,
76-
McpSchema.Implementation clientInfo, McpTransportContext transportContext) {
77+
McpSchema.Implementation clientInfo, McpTransportContext transportContext) {
7778
this.session = session;
7879
this.clientCapabilities = clientCapabilities;
7980
this.clientInfo = clientInfo;

mcp/src/main/java/io/modelcontextprotocol/server/McpInitRequestHandler.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,11 @@
88
*/
99
public interface McpInitRequestHandler {
1010

11-
/**
12-
* Handles the initialization request.
13-
*
14-
* @param initializeRequest the initialization request by the client
15-
* @return a Mono that will emit the result of the initialization
16-
*/
17-
Mono<McpSchema.InitializeResult> handle(McpSchema.InitializeRequest initializeRequest);
11+
/**
12+
* Handles the initialization request.
13+
* @param initializeRequest the initialization request by the client
14+
* @return a Mono that will emit the result of the initialization
15+
*/
16+
Mono<McpSchema.InitializeResult> handle(McpSchema.InitializeRequest initializeRequest);
1817

1918
}

mcp/src/main/java/io/modelcontextprotocol/server/McpNotificationHandler.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@
77
*/
88
public interface McpNotificationHandler {
99

10-
/**
11-
* Handles a notification from the client.
12-
*
13-
* @param exchange the exchange associated with the client that allows calling
14-
* back to the connected client or inspecting its capabilities.
15-
* @param params the parameters of the notification.
16-
* @return a Mono that completes once the notification is handled.
17-
*/
18-
Mono<Void> handle(McpAsyncServerExchange exchange, Object params);
10+
/**
11+
* Handles a notification from the client.
12+
* @param exchange the exchange associated with the client that allows calling back to
13+
* the connected client or inspecting its capabilities.
14+
* @param params the parameters of the notification.
15+
* @return a Mono that completes once the notification is handled.
16+
*/
17+
Mono<Void> handle(McpAsyncServerExchange exchange, Object params);
1918

2019
}

mcp/src/main/java/io/modelcontextprotocol/server/McpRequestHandler.java

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,17 @@
66
* A handler for client-initiated requests.
77
*
88
* @param <T> the type of the response that is expected as a result of handling the
9-
* request.
9+
* request.
1010
*/
1111
public interface McpRequestHandler<T> {
1212

13-
/**
14-
* Handles a request from the client.
15-
*
16-
* @param exchange the exchange associated with the client that allows calling
17-
* back to the connected client or inspecting its capabilities.
18-
* @param params the parameters of the request.
19-
* @return a Mono that will emit the response to the request.
20-
*/
21-
Mono<T> handle(McpAsyncServerExchange exchange, Object params);
13+
/**
14+
* Handles a request from the client.
15+
* @param exchange the exchange associated with the client that allows calling back to
16+
* the connected client or inspecting its capabilities.
17+
* @param params the parameters of the request.
18+
* @return a Mono that will emit the response to the request.
19+
*/
20+
Mono<T> handle(McpAsyncServerExchange exchange, Object params);
2221

2322
}

0 commit comments

Comments
 (0)