Skip to content

Performance Issue: Server Restarts on Every Invocation #361

@cjnoname

Description

@cjnoname

Hi,

We're encountering a performance issue with this setup. It seems the server restarts every time the following command is executed:

return await stdioServerAdapter(serverParams, event, context);

This triggers all the server startup scripts inside the ./mcp-server.js file, including database connections, secret fetching, and other initialization logic.

Is there a recommended way to cache the server instance so that it starts only once and stays in memory for future invocations?

Thanks!

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