-
Notifications
You must be signed in to change notification settings - Fork 326
[FEL]MCP Streamable Client implement with Java MCP SDK #361
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
Merged
CodeCasterX
merged 18 commits into
ModelEngine-Group:main
from
relat-ivity:mcp-sdk-client
Nov 10, 2025
Merged
Changes from 13 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
05b6d2f
MCP SDK Client first commit.
relat-ivity 40c2bda
MCP SDK Client first commit.
relat-ivity 2e901e8
实现fit接口
relat-ivity 591308b
Merge remote-tracking branch 'origin/mcp-sdk-client' into mcp-sdk-client
relat-ivity 4cf12f9
因为jsonMapper问题暂时回退0.12.0版本
relat-ivity 4aa02a1
SDK版本更新为0.15.0
relat-ivity f94556e
格式化,加callTool错误日志更新
relat-ivity 3ce782c
修改客户端默认超时时间
relat-ivity cc8116a
优化过长类
relat-ivity ae0ec6b
Merge branch 'main' into mcp-sdk-client
c38ae25
修改工厂类逻辑
9d5e552
添加测试,修改log格式
2cb20b3
修改client和server部分日志输出
e492942
移除elicitation能力
9c03bb1
恢复testcontroller
89c4443
删除testcontroller的log依赖
a5438f6
删除service的sdk依赖
122cb0e
声明线程不安全,以及加this.
relat-ivity File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
429 changes: 0 additions & 429 deletions
429
...ol-mcp-client/src/main/java/modelengine/fel/tool/mcp/client/support/DefaultMcpClient.java
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
...src/main/java/modelengine/fel/tool/mcp/client/support/DefaultMcpClientMessageHandler.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) 2025 Huawei Technologies Co., Ltd. All rights reserved. | ||
| * This file is a part of the ModelEngine Project. | ||
| * Licensed under the MIT License. See License.txt in the project root for license information. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| package modelengine.fel.tool.mcp.client.support; | ||
|
|
||
| import io.modelcontextprotocol.spec.McpSchema; | ||
| import modelengine.fitframework.annotation.Component; | ||
| import modelengine.fitframework.log.Logger; | ||
|
|
||
| import java.util.HashMap; | ||
| import java.util.Map; | ||
| import java.util.Scanner; | ||
|
|
||
| /** | ||
| * Handles MCP client messages received from MCP server, | ||
| * including logging notifications and elicitation requests. | ||
| * | ||
| * @author 黄可欣 | ||
| * @since 2025-11-03 | ||
| */ | ||
| @Component | ||
relat-ivity marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| public class DefaultMcpClientMessageHandler { | ||
| private static final Logger log = Logger.get(DefaultMcpClientMessageHandler.class); | ||
|
|
||
| /** | ||
| * Handles logging messages received from the MCP server. | ||
| * | ||
| * @param notification The {@link McpSchema.LoggingMessageNotification} containing the log level and data. | ||
| */ | ||
| public static void defaultLoggingMessageHandler(McpSchema.LoggingMessageNotification notification) { | ||
| log.info("Received logging message from MCP server. [level={}, data={}]", | ||
| notification.level(), | ||
| notification.data()); | ||
| } | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.