Skip to content
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

feat(solon-webrx): Add solon-webrx adaptive #110

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

noear
Copy link

@noear noear commented Apr 6, 2025

Motivation and Context

Add solon-webrx adaptive。

Solon is a java enterprise application development framework similar to spring. There is no java-ee. support for java8 ~ java24, and native runtime.

How Has This Been Tested?

junit run mcp-solon/mcp-solon-webrx/src/test/java

Breaking Changes

add module: mcp-solon/mcp-solon-webrx

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

mcp-solon-webrx references the code and unit tests of mcp-spring-webmvc and mcp-spring-webflux

@tzolov
Copy link
Contributor

tzolov commented Apr 6, 2025

Very interesting. Thank you for the contribution @noear !
We will review it shortly!

@tzolov tzolov self-assigned this Apr 6, 2025
@noear
Copy link
Author

noear commented Apr 9, 2025

Hope to support java8! solon supports java8 through java24! vert.x also supports java8+

@tzolov

@noear
Copy link
Author

noear commented Apr 9, 2025

This is what solon (Solon-AI) looks like with mcp integrated:

for Server

solon.ai.mcp.server:  
  enabled: true             
  sseEndpoint: "/mcp/sse"   
@Component
public class McpServerTool {
    @ToolMapping(description = "查询天气预报")
    public String getWeather(@ToolParam(description = "城市位置") String location) {
        return "晴,14度";
    }
}

public class McpServerApp {
    public static void main(String[] args) {
        Solon.start(McpServerApp.class, args);
    }
}

for Client

public void case2(){
    McpClientWrapper mcpClient = new McpClientWrapper("http://localhost:8080", "/mcp/sse");
    ChatModel chatModel = ChatModel.of("http://127.0.0.1:11434/api/chat")
                .provider("ollama")
                .model("qwen2.5:1.5b")
                .build();

    ChatResponse resp = chatModel.prompt("杭州今天的天气怎么样?")
            .options(options -> {
                //转为工具集合用于绑定
                options.toolsAdd(mcpClient.toTools());
            })
            .call();
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants