Skip to content

Mendix MCP Server Thread #1

@XiaoHao-zxh

Description

@XiaoHao-zxh

When integrating MCP Server with Mendix 10.24.3, I encountered an issue. After AI initiates a request using the SSE protocol, a thread is created in the McpServerRequestHandler of the JAVA Action. Each time AI calls the tool, a new thread is created. Then I found a section of code in McpServerRequestHandler:

AsyncContext asyncContext = request.startAsync();

asyncContext.setTimeout(15 * 60 * 1000);

Thread.sleep(15 * 60 * 1000);

I want to know the significance of the line "Thread.sleep(15 * 60 * 1000);" and the considerations behind adding this line of code. Based on my current understanding, when there are a large number of AI requests, this line of code will cause Mendix to have OOM (Out of Memory) due to a sudden surge in threads.
Our project has crashed multiple times because of this issue, and we would like to seek a solution. Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions