Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@

<!-- Nacos -->
<nacos2.version>2.5.1</nacos2.version>
<nacos3.version>3.0.2</nacos3.version>
<nacos3.version>3.0.3</nacos3.version>
<nacos-client-mse-extension.version>1.0.4</nacos-client-mse-extension.version>
<spring-alibaba-nacos-config.version>2023.0.1.3</spring-alibaba-nacos-config.version>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public McpEndpointInfo selectEndpoint(McpServiceRef mcpServiceRef) throws NacosE
return mcpEndpointInfo;
}

public boolean createMcpServer(String mcpName, McpServerBasicInfo serverSpec, McpToolSpecification toolSpec,
public String createMcpServer(String mcpName, McpServerBasicInfo serverSpec, McpToolSpecification toolSpec,
McpEndpointSpec endpointSpec) throws NacosException {
endpointSpec.getData().put("namespaceId", this.namespace);
return aiMaintainerService.createMcpServer(this.namespace, mcpName, serverSpec, toolSpec, endpointSpec);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,16 @@ private void updateAll(NacosMcpServerEndpoint newServerEndpoint) {
private McpAsyncClient clientByEndpoint(McpEndpointInfo mcpEndpointInfo, String exportPath) {
McpAsyncClient asyncClient;

String baseUrl = "http://" + mcpEndpointInfo.getAddress() + ":" + mcpEndpointInfo.getPort();
String protocol = mcpEndpointInfo.getProtocol();
if (protocol == null || !"http".equals(protocol) && !"https".equals(protocol)) {
if (mcpEndpointInfo.getPort() == 443) {
protocol = "https";
}
else {
protocol = "http";
}
}
String baseUrl = protocol + "://" + mcpEndpointInfo.getAddress() + ":" + mcpEndpointInfo.getPort();
WebClient.Builder webClientBuilder = webClientBuilderTemplate.clone().baseUrl(baseUrl);

WebFluxSseClientTransport transport;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,16 @@ public void setLoggingLevel(McpSchema.LoggingLevel loggingLevel) {

private McpSyncClient clientByEndpoint(McpEndpointInfo mcpEndpointInfo, String exportPath) {
McpSyncClient syncClient;
String baseUrl = "http://" + mcpEndpointInfo.getAddress() + ":" + mcpEndpointInfo.getPort();
String protocol = mcpEndpointInfo.getProtocol();
if (protocol == null || !"http".equals(protocol) && !"https".equals(protocol)) {
if (mcpEndpointInfo.getPort() == 443) {
protocol = "https";
}
else {
protocol = "http";
}
}
String baseUrl = protocol + "://" + mcpEndpointInfo.getAddress() + ":" + mcpEndpointInfo.getPort();
WebClient.Builder webClientBuilder = webClientBuilderTemplate.clone().baseUrl(baseUrl);

// Using the build method with link tracking
Expand Down
Loading