Skip to content
Open
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
@@ -1,7 +1,5 @@
package org.springframework.ai.mcp.samples.client;

import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springaicommunity.mcp.annotation.McpElicitation;
Expand Down Expand Up @@ -32,7 +30,7 @@ public class McpClientHandlerProviders {
* <li>{@code spring.ai.mcp.client.sse.connections.server1.url=...}</li>
* <li>{@code spring.ai.mcp.client.streamable-http.connections.server1.url=...}</li>
* </ul>
*
*
* The handler is assigned only to the client with ID "server1".
*
* @param progressNotification the progress notification received from the server
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/*
/*
* Copyright 2025 - 2025 the original author or authors.
*
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
*
* https://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand All @@ -21,9 +21,6 @@
import org.springaicommunity.mcp.annotation.McpProgressToken;
import org.springaicommunity.mcp.annotation.McpTool;
import org.springaicommunity.mcp.annotation.McpToolParam;
import org.springaicommunity.mcp.context.DefaultMcpSyncRequestContext;

import org.springframework.stereotype.Service;

import io.modelcontextprotocol.server.McpSyncServerExchange;
import io.modelcontextprotocol.spec.McpSchema;
Expand All @@ -50,7 +47,7 @@ public String toolLggingSamplingElicitationProgress(McpSyncServerExchange exchan
new ProgressNotification(progressToken, 0.0, 1.0, "tool call start"));

exchange.ping(); // call client ping

// call elicitation
var elicitationRequest = McpSchema.ElicitRequest.builder()
.message("Test message")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@
import io.modelcontextprotocol.client.transport.HttpClientStreamableHttpTransport;
import io.modelcontextprotocol.spec.McpSchema.CallToolRequest;
import io.modelcontextprotocol.spec.McpSchema.CallToolResult;
import io.modelcontextprotocol.spec.McpSchema.ListToolsResult;

/**
* @author Christian Tzolov
*/
public class StreamableHttpClient {

public static void main(String[] args) {

HttpClientStreamableHttpTransport transport = HttpClientStreamableHttpTransport.builder("http://localhost:8080")
.build();

Expand Down