Skip to content

client code can't execute inside browser due to import spawn #2077

@scastria

Description

@scastria

I am trying to get metadata from a remote MCP server via listTools inside a NextJS webapp client side. Because it is client side, to my understanding, some features are not available, like child_process. Simply importing the main client from this sdk, I get an error complaining about module not found child_process. This is due to the this sdk trying to import spawn from "cross-spawn"; which seems to be only needed for the StdioClientTransport which I am not using.

I am hoping that the importing of spawn can be done elsewhere so that is is done ONLY when actually used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions