Skip to content

Commit 474641e

Browse files
committed
feat(server): Make toSpecification methods public in McpServerFeatures
Changed visibility of toSpecification() methods from package-private to public in all registration classes: - AsyncToolRegistration - AsyncResourceRegistration - AsyncPromptRegistration - SyncToolRegistration - SyncResourceRegistration - SyncPromptRegistration Signed-off-by: Christian Tzolov <[email protected]>
1 parent cbf2b54 commit 474641e

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ static AsyncToolRegistration fromSync(SyncToolRegistration tool) {
459459
map -> Mono.fromCallable(() -> tool.call().apply(map)).subscribeOn(Schedulers.boundedElastic()));
460460
}
461461

462-
AsyncToolSpecification toSpecification() {
462+
public AsyncToolSpecification toSpecification() {
463463
return new AsyncToolSpecification(tool(), (exchange, map) -> call.apply(map));
464464
}
465465
}
@@ -505,7 +505,7 @@ static AsyncResourceRegistration fromSync(SyncResourceRegistration resource) {
505505
.subscribeOn(Schedulers.boundedElastic()));
506506
}
507507

508-
AsyncResourceSpecification toSpecification() {
508+
public AsyncResourceSpecification toSpecification() {
509509
return new AsyncResourceSpecification(resource(), (exchange, request) -> readHandler.apply(request));
510510
}
511511
}
@@ -554,7 +554,7 @@ static AsyncPromptRegistration fromSync(SyncPromptRegistration prompt) {
554554
.subscribeOn(Schedulers.boundedElastic()));
555555
}
556556

557-
AsyncPromptSpecification toSpecification() {
557+
public AsyncPromptSpecification toSpecification() {
558558
return new AsyncPromptSpecification(prompt(), (exchange, request) -> promptHandler.apply(request));
559559
}
560560
}
@@ -597,7 +597,7 @@ AsyncPromptSpecification toSpecification() {
597597
@Deprecated
598598
public record SyncToolRegistration(McpSchema.Tool tool,
599599
Function<Map<String, Object>, McpSchema.CallToolResult> call) {
600-
SyncToolSpecification toSpecification() {
600+
public SyncToolSpecification toSpecification() {
601601
return new SyncToolSpecification(tool, (exchange, map) -> call.apply(map));
602602
}
603603
}
@@ -632,7 +632,7 @@ SyncToolSpecification toSpecification() {
632632
@Deprecated
633633
public record SyncResourceRegistration(McpSchema.Resource resource,
634634
Function<McpSchema.ReadResourceRequest, McpSchema.ReadResourceResult> readHandler) {
635-
SyncResourceSpecification toSpecification() {
635+
public SyncResourceSpecification toSpecification() {
636636
return new SyncResourceSpecification(resource, (exchange, request) -> readHandler.apply(request));
637637
}
638638
}
@@ -670,7 +670,7 @@ SyncResourceSpecification toSpecification() {
670670
@Deprecated
671671
public record SyncPromptRegistration(McpSchema.Prompt prompt,
672672
Function<McpSchema.GetPromptRequest, McpSchema.GetPromptResult> promptHandler) {
673-
SyncPromptSpecification toSpecification() {
673+
public SyncPromptSpecification toSpecification() {
674674
return new SyncPromptSpecification(prompt, (exchange, request) -> promptHandler.apply(request));
675675
}
676676
}

0 commit comments

Comments
 (0)