|
110 | 110 | matchIfMissing = true) |
111 | 111 | public class McpClientAutoConfiguration { |
112 | 112 |
|
| 113 | + /** |
| 114 | + * Create a dynamic client name based on the client name and the name of the server |
| 115 | + * connection. |
| 116 | + * @param clientName the client name as defined by the configuration |
| 117 | + * @param serverConnectionName the name of the server connection being used by the |
| 118 | + * client |
| 119 | + * @return the connected client name |
| 120 | + */ |
| 121 | + private String connectedClientName(String clientName, String serverConnectionName) { |
| 122 | + return clientName + " - " + serverConnectionName; |
| 123 | + } |
| 124 | + |
113 | 125 | /** |
114 | 126 | * Creates a list of {@link McpSyncClient} instances based on the available |
115 | 127 | * transports. |
@@ -145,7 +157,8 @@ public List<McpSyncClient> mcpSyncClients(McpSyncClientConfigurer mcpSyncClientC |
145 | 157 | for (NamedClientMcpTransport namedTransport : namedTransports) { |
146 | 158 |
|
147 | 159 | McpSchema.Implementation clientInfo = new McpSchema.Implementation( |
148 | | - commonProperties.getName() + " - " + namedTransport.name(), commonProperties.getVersion()); |
| 160 | + this.connectedClientName(commonProperties.getName(), namedTransport.name()), |
| 161 | + commonProperties.getVersion()); |
149 | 162 |
|
150 | 163 | McpClient.SyncSpec syncSpec = McpClient.sync(namedTransport.transport()) |
151 | 164 | .clientInfo(clientInfo) |
@@ -257,7 +270,8 @@ public List<McpAsyncClient> mcpAsyncClients(McpAsyncClientConfigurer mcpSyncClie |
257 | 270 | for (NamedClientMcpTransport namedTransport : namedTransports) { |
258 | 271 |
|
259 | 272 | McpSchema.Implementation clientInfo = new McpSchema.Implementation( |
260 | | - commonProperties.getName() + " - " + namedTransport.name(), commonProperties.getVersion()); |
| 273 | + this.connectedClientName(commonProperties.getName(), namedTransport.name()), |
| 274 | + commonProperties.getVersion()); |
261 | 275 |
|
262 | 276 | McpClient.AsyncSpec syncSpec = McpClient.async(namedTransport.transport()) |
263 | 277 | .clientInfo(clientInfo) |
|
0 commit comments