Skip to content

Fix typos in several files #159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public WebFluxSseServerTransportProvider(ObjectMapper objectMapper, String messa
* Constructs a new WebFlux SSE server transport provider instance.
* @param objectMapper The ObjectMapper to use for JSON serialization/deserialization
* of MCP messages. Must not be null.
* @param baseUrl webflux messag base path
* @param baseUrl webflux message base path
* @param messageEndpoint The endpoint URI where clients should send their JSON-RPC
* messages. This endpoint will be communicated to clients during SSE connection
* setup. Must not be null.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ void testCreateMessageSuccess(String clientType) throws InterruptedException {
McpServerFeatures.AsyncToolSpecification tool = new McpServerFeatures.AsyncToolSpecification(
new McpSchema.Tool("tool1", "tool1 description", emptyJsonSchema), (exchange, request) -> {

var craeteMessageRequest = McpSchema.CreateMessageRequest.builder()
var createMessageRequest = McpSchema.CreateMessageRequest.builder()
.messages(List.of(new McpSchema.SamplingMessage(McpSchema.Role.USER,
new McpSchema.TextContent("Test message"))))
.modelPreferences(ModelPreferences.builder()
Expand All @@ -162,7 +162,7 @@ void testCreateMessageSuccess(String clientType) throws InterruptedException {
.build())
.build();

StepVerifier.create(exchange.createMessage(craeteMessageRequest)).consumeNextWith(result -> {
StepVerifier.create(exchange.createMessage(createMessageRequest)).consumeNextWith(result -> {
assertThat(result).isNotNull();
assertThat(result.role()).isEqualTo(Role.USER);
assertThat(result.content()).isInstanceOf(McpSchema.TextContent.class);
Expand Down Expand Up @@ -282,7 +282,7 @@ void testRootsWithoutCapability(String clientType) {

@ParameterizedTest(name = "{0} : {displayName} ")
@ValueSource(strings = { "httpclient", "webflux" })
void testRootsNotifciationWithEmptyRootsList(String clientType) {
void testRootsNotificationWithEmptyRootsList(String clientType) {
var clientBuilder = clientBuilders.get(clientType);

AtomicReference<List<Root>> rootsRef = new AtomicReference<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ void testCreateMessageSuccess() throws InterruptedException {
McpServerFeatures.AsyncToolSpecification tool = new McpServerFeatures.AsyncToolSpecification(
new McpSchema.Tool("tool1", "tool1 description", emptyJsonSchema), (exchange, request) -> {

var craeteMessageRequest = McpSchema.CreateMessageRequest.builder()
var createMessageRequest = McpSchema.CreateMessageRequest.builder()
.messages(List.of(new McpSchema.SamplingMessage(McpSchema.Role.USER,
new McpSchema.TextContent("Test message"))))
.modelPreferences(ModelPreferences.builder()
Expand All @@ -178,7 +178,7 @@ void testCreateMessageSuccess() throws InterruptedException {
.build())
.build();

StepVerifier.create(exchange.createMessage(craeteMessageRequest)).consumeNextWith(result -> {
StepVerifier.create(exchange.createMessage(createMessageRequest)).consumeNextWith(result -> {
assertThat(result).isNotNull();
assertThat(result.role()).isEqualTo(Role.USER);
assertThat(result.content()).isInstanceOf(McpSchema.TextContent.class);
Expand Down Expand Up @@ -293,7 +293,7 @@ void testRootsWithoutCapability() {
}

@Test
void testRootsNotifciationWithEmptyRootsList() {
void testRootsNotificationWithEmptyRootsList() {
AtomicReference<List<Root>> rootsRef = new AtomicReference<>();

var mcpServer = McpServer.sync(mcpServerTransportProvider)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ void testAddTool() {
.build();

StepVerifier.create(mcpAsyncServer.addTool(new McpServerFeatures.AsyncToolSpecification(newTool,
(excnage, args) -> Mono.just(new CallToolResult(List.of(), false)))))
(exchange, args) -> Mono.just(new CallToolResult(List.of(), false)))))
.verifyComplete();

assertThatCode(() -> mcpAsyncServer.closeGracefully().block(Duration.ofSeconds(10))).doesNotThrowAnyException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,16 +200,16 @@ void testAddResource() {

Resource resource = new Resource(TEST_RESOURCE_URI, "Test Resource", "text/plain", "Test resource description",
null);
McpServerFeatures.SyncResourceSpecification specificaiton = new McpServerFeatures.SyncResourceSpecification(
McpServerFeatures.SyncResourceSpecification specification = new McpServerFeatures.SyncResourceSpecification(
resource, (exchange, req) -> new ReadResourceResult(List.of()));

assertThatCode(() -> mcpSyncServer.addResource(specificaiton)).doesNotThrowAnyException();
assertThatCode(() -> mcpSyncServer.addResource(specification)).doesNotThrowAnyException();

assertThatCode(() -> mcpSyncServer.closeGracefully()).doesNotThrowAnyException();
}

@Test
void testAddResourceWithNullSpecifiation() {
void testAddResourceWithNullSpecification() {
var mcpSyncServer = McpServer.sync(createMcpTransportProvider())
.serverInfo("test-server", "1.0.0")
.capabilities(ServerCapabilities.builder().resources(true, false).build())
Expand Down Expand Up @@ -279,11 +279,11 @@ void testAddPromptWithoutCapability() {
.build();

Prompt prompt = new Prompt(TEST_PROMPT_NAME, "Test Prompt", List.of());
McpServerFeatures.SyncPromptSpecification specificaiton = new McpServerFeatures.SyncPromptSpecification(prompt,
McpServerFeatures.SyncPromptSpecification specification = new McpServerFeatures.SyncPromptSpecification(prompt,
(exchange, req) -> new GetPromptResult("Test prompt description", List
.of(new PromptMessage(McpSchema.Role.ASSISTANT, new McpSchema.TextContent("Test content")))));

assertThatThrownBy(() -> serverWithoutPrompts.addPrompt(specificaiton)).isInstanceOf(McpError.class)
assertThatThrownBy(() -> serverWithoutPrompts.addPrompt(specification)).isInstanceOf(McpError.class)
.hasMessage("Server must be configured with prompt capabilities");
}

Expand All @@ -300,14 +300,14 @@ void testRemovePromptWithoutCapability() {
@Test
void testRemovePrompt() {
Prompt prompt = new Prompt(TEST_PROMPT_NAME, "Test Prompt", List.of());
McpServerFeatures.SyncPromptSpecification specificaiton = new McpServerFeatures.SyncPromptSpecification(prompt,
McpServerFeatures.SyncPromptSpecification specification = new McpServerFeatures.SyncPromptSpecification(prompt,
(exchange, req) -> new GetPromptResult("Test prompt description", List
.of(new PromptMessage(McpSchema.Role.ASSISTANT, new McpSchema.TextContent("Test content")))));

var mcpSyncServer = McpServer.sync(createMcpTransportProvider())
.serverInfo("test-server", "1.0.0")
.capabilities(ServerCapabilities.builder().prompts(true).build())
.prompts(specificaiton)
.prompts(specification)
.build();

assertThatCode(() -> mcpSyncServer.removePrompt(TEST_PROMPT_NAME)).doesNotThrowAnyException();
Expand Down Expand Up @@ -340,7 +340,7 @@ void testRootsChangeHandlers() {

var singleConsumerServer = McpServer.sync(createMcpTransportProvider())
.serverInfo("test-server", "1.0.0")
.rootsChangeHandlers(List.of((exchage, roots) -> {
.rootsChangeHandlers(List.of((exchange, roots) -> {
consumerCalled[0] = true;
if (!roots.isEmpty()) {
rootsReceived[0] = roots.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ public SyncSpec requestTimeout(Duration requestTimeout) {
}

/**
* @param initializationTimeout The duration to wait for the initializaiton
* @param initializationTimeout The duration to wait for the initialization
* lifecycle step to complete.
* @return This builder instance for method chaining
* @throws IllegalArgumentException if initializationTimeout is null
Expand Down Expand Up @@ -435,7 +435,7 @@ public AsyncSpec requestTimeout(Duration requestTimeout) {
}

/**
* @param initializationTimeout The duration to wait for the initializaiton
* @param initializationTimeout The duration to wait for the initialization
* lifecycle step to complete.
* @return This builder instance for method chaining
* @throws IllegalArgumentException if initializationTimeout is null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ private Mono<McpSchema.InitializeResult> asyncInitializeRequestHandler(
}
else {
logger.warn(
"Client requested unsupported protocol version: {}, so the server will sugggest the {} version instead",
"Client requested unsupported protocol version: {}, so the server will suggest the {} version instead",
initializeRequest.protocolVersion(), serverProtocolVersion);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1103,7 +1103,7 @@ public record ProgressNotification(// @formatter:off
* setting minimum log levels, with servers sending notifications containing severity
* levels, optional logger names, and arbitrary JSON-serializable data.
*
* @param level The severity levels. The mimimum log level is set by the client.
* @param level The severity levels. The minimum log level is set by the client.
* @param logger The logger that generated the message.
* @param data JSON-serializable logging data.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ void testAddTool() {
.build();

StepVerifier.create(mcpAsyncServer.addTool(new McpServerFeatures.AsyncToolSpecification(newTool,
(excnage, args) -> Mono.just(new CallToolResult(List.of(), false)))))
(exchange, args) -> Mono.just(new CallToolResult(List.of(), false)))))
.verifyComplete();

assertThatCode(() -> mcpAsyncServer.closeGracefully().block(Duration.ofSeconds(10))).doesNotThrowAnyException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,16 +199,16 @@ void testAddResource() {

Resource resource = new Resource(TEST_RESOURCE_URI, "Test Resource", "text/plain", "Test resource description",
null);
McpServerFeatures.SyncResourceSpecification specificaiton = new McpServerFeatures.SyncResourceSpecification(
McpServerFeatures.SyncResourceSpecification specification = new McpServerFeatures.SyncResourceSpecification(
resource, (exchange, req) -> new ReadResourceResult(List.of()));

assertThatCode(() -> mcpSyncServer.addResource(specificaiton)).doesNotThrowAnyException();
assertThatCode(() -> mcpSyncServer.addResource(specification)).doesNotThrowAnyException();

assertThatCode(() -> mcpSyncServer.closeGracefully()).doesNotThrowAnyException();
}

@Test
void testAddResourceWithNullSpecifiation() {
void testAddResourceWithNullSpecification() {
var mcpSyncServer = McpServer.sync(createMcpTransportProvider())
.serverInfo("test-server", "1.0.0")
.capabilities(ServerCapabilities.builder().resources(true, false).build())
Expand Down Expand Up @@ -278,11 +278,11 @@ void testAddPromptWithoutCapability() {
.build();

Prompt prompt = new Prompt(TEST_PROMPT_NAME, "Test Prompt", List.of());
McpServerFeatures.SyncPromptSpecification specificaiton = new McpServerFeatures.SyncPromptSpecification(prompt,
McpServerFeatures.SyncPromptSpecification specification = new McpServerFeatures.SyncPromptSpecification(prompt,
(exchange, req) -> new GetPromptResult("Test prompt description", List
.of(new PromptMessage(McpSchema.Role.ASSISTANT, new McpSchema.TextContent("Test content")))));

assertThatThrownBy(() -> serverWithoutPrompts.addPrompt(specificaiton)).isInstanceOf(McpError.class)
assertThatThrownBy(() -> serverWithoutPrompts.addPrompt(specification)).isInstanceOf(McpError.class)
.hasMessage("Server must be configured with prompt capabilities");
}

Expand All @@ -299,14 +299,14 @@ void testRemovePromptWithoutCapability() {
@Test
void testRemovePrompt() {
Prompt prompt = new Prompt(TEST_PROMPT_NAME, "Test Prompt", List.of());
McpServerFeatures.SyncPromptSpecification specificaiton = new McpServerFeatures.SyncPromptSpecification(prompt,
McpServerFeatures.SyncPromptSpecification specification = new McpServerFeatures.SyncPromptSpecification(prompt,
(exchange, req) -> new GetPromptResult("Test prompt description", List
.of(new PromptMessage(McpSchema.Role.ASSISTANT, new McpSchema.TextContent("Test content")))));

var mcpSyncServer = McpServer.sync(createMcpTransportProvider())
.serverInfo("test-server", "1.0.0")
.capabilities(ServerCapabilities.builder().prompts(true).build())
.prompts(specificaiton)
.prompts(specification)
.build();

assertThatCode(() -> mcpSyncServer.removePrompt(TEST_PROMPT_NAME)).doesNotThrowAnyException();
Expand Down Expand Up @@ -339,7 +339,7 @@ void testRootsChangeHandlers() {

var singleConsumerServer = McpServer.sync(createMcpTransportProvider())
.serverInfo("test-server", "1.0.0")
.rootsChangeHandlers(List.of((exchage, roots) -> {
.rootsChangeHandlers(List.of((exchange, roots) -> {
consumerCalled[0] = true;
if (!roots.isEmpty()) {
rootsReceived[0] = roots.get(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void testCreateMessageSuccess() throws InterruptedException {
McpServerFeatures.AsyncToolSpecification tool = new McpServerFeatures.AsyncToolSpecification(
new McpSchema.Tool("tool1", "tool1 description", emptyJsonSchema), (exchange, request) -> {

var craeteMessageRequest = McpSchema.CreateMessageRequest.builder()
var createMessageRequest = McpSchema.CreateMessageRequest.builder()
.messages(List.of(new McpSchema.SamplingMessage(McpSchema.Role.USER,
new McpSchema.TextContent("Test message"))))
.modelPreferences(ModelPreferences.builder()
Expand All @@ -160,7 +160,7 @@ void testCreateMessageSuccess() throws InterruptedException {
.build())
.build();

StepVerifier.create(exchange.createMessage(craeteMessageRequest)).consumeNextWith(result -> {
StepVerifier.create(exchange.createMessage(createMessageRequest)).consumeNextWith(result -> {
assertThat(result).isNotNull();
assertThat(result.role()).isEqualTo(Role.USER);
assertThat(result.content()).isInstanceOf(McpSchema.TextContent.class);
Expand Down Expand Up @@ -271,7 +271,7 @@ void testRootsWithoutCapability() {
}

@Test
void testRootsNotifciationWithEmptyRootsList() {
void testRootsNotificationWithEmptyRootsList() {
AtomicReference<List<Root>> rootsRef = new AtomicReference<>();

var mcpServer = McpServer.sync(mcpServerTransportProvider)
Expand Down