Skip to content
This repository was archived by the owner on May 29, 2025. It is now read-only.
This repository was archived by the owner on May 29, 2025. It is now read-only.

Chat app demo MUST define the environment. #12

@jamesrochabrun

Description

@jamesrochabrun

In the app demo I had to define the env or I will get

Failed to initialize MCPClient: dataStreamClosed

Image

I had to define the env like this...

            var env = ProcessInfo.processInfo.environment
            env["PATH"] = "/opt/homebrew/bin:/usr/local/bin:" + (env["PATH"] ?? "")
            self.client = try await MCPClient(
               info: .init(name: "GIthubMCPClient", version: "1.0.0"),
               transport: .stdioProcess(
                  "npx",
                  args: ["-y", "@modelcontextprotocol/server-github"],
                  env: env,
                  verbose: true
               ),
               capabilities: .init()
            )

Also: FYI APP MUST be set to sandbox to false.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions